Skip to content

Commit

Permalink
Merge PR #335 into 13.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Feb 3, 2020
2 parents 3770fe7 + da7f5b0 commit efa13d5
Show file tree
Hide file tree
Showing 71 changed files with 3,242 additions and 0 deletions.
1 change: 1 addition & 0 deletions oca_dependencies.txt
@@ -0,0 +1 @@
brand
114 changes: 114 additions & 0 deletions website_sale_product_brand/README.rst
@@ -0,0 +1,114 @@
==================================
Product Brand Filtering in Website
==================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github
:target: https://github.com/OCA/e-commerce/tree/13.0/website_sale_product_brand
:alt: OCA/e-commerce
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/e-commerce-13-0/e-commerce-13-0-website_sale_product_brand
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/113/13.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module was written to extend the functionality of product filtering on website.
It will allow you to filter product based on its brand.

While shopping online, we have seen various eShops having a feature to shop by brands
which ODOO does not yet provide officially. Website Sale Product Brand fills the gap at certain
extent and by providing basic search by brands, thus reducing end-user’s efforts in
searching the products he/she wants to purchase.

**Table of contents**

.. contents::
:local:

Installation
============

To install this module, you need to install following module:
->https://github.com/OCA/product-attribute/tree/12.0/product_brand

Usage
=====

Shop by brand feature is available on various famous e-commerce websites like amazon, flipkart and many.
Shop by brand feature enables you to display product relevant to that particular brand.

To use this module, you need to:

Once you install this module, user will be able to create a new brand and define the brand to a product.

- To create product brand
go to:
sales>products>product brands

User can assign a nice logo with brand description.

- After configuring the brand, user can assign a particular brand to a particular products.

Based on this configuration, you will see the menuitem shop by brand next to shop menu.
It will show all the brands and once you select that brand it will show product's which
is related to this brand.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_product_brand%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Serpent Consulting Services Pvt. Ltd.
* Tecnativa

Contributors
~~~~~~~~~~~~

* Jay Vora <jay.vora@serpentcs.com>
* Meet Dholakia <m.dholakia.serpentcs@gmail.com>
* `Tecnativa <https://www.tecnativa.com>`_:

* Ernesto Tejeda <ernesto.tejeda@tecnativa.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>
* Alexandre Díaz

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/13.0/website_sale_product_brand>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions website_sale_product_brand/__init__.py
@@ -0,0 +1,4 @@
# © 2016 Serpent Consulting Services Pvt. Ltd. (http://www.serpentcs.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import controllers
25 changes: 25 additions & 0 deletions website_sale_product_brand/__manifest__.py
@@ -0,0 +1,25 @@
# © 2016 Serpent Consulting Services Pvt. Ltd. (http://www.serpentcs.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Product Brand Filtering in Website",
"category": "e-commerce",
"author": "Serpent Consulting Services Pvt. Ltd., "
"Tecnativa, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/e-commerce",
"version": "13.0.1.1.0",
"license": "AGPL-3",
"depends": ["product_brand", "website_sale"],
"data": [
"security/ir.model.access.csv",
"data/website_menu.xml",
"views/product_brand.xml",
],
"demo": [
"demo/assets.xml",
"demo/product_brand_demo.xml",
"demo/product_product_demo.xml",
],
"installable": True,
}
4 changes: 4 additions & 0 deletions website_sale_product_brand/controllers/__init__.py
@@ -0,0 +1,4 @@
# © 2016 Serpent Consulting Services Pvt. Ltd. (http://www.serpentcs.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import main
52 changes: 52 additions & 0 deletions website_sale_product_brand/controllers/main.py
@@ -0,0 +1,52 @@
# © 2016 Serpent Consulting Services Pvt. Ltd. (http://www.serpentcs.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import http
from odoo.http import request

from odoo.addons.website_sale.controllers.main import QueryURL, WebsiteSale


class WebsiteSale(WebsiteSale):
def _get_search_domain(self, search, category, attrib_values):
domain = super()._get_search_domain(search, category, attrib_values)
if "brand_id" in request.env.context:
domain.append(("product_brand_id", "=", request.env.context["brand_id"]))
return domain

@http.route(
[
"/shop",
"/shop/page/<int:page>",
'/shop/category/<model("product.public.category"):category>',
'/shop/category/<model("product.public.category"):category'
">/page/<int:page>", # Continue previous line
"/shop/brands",
],
type="http",
auth="public",
website=True,
)
def shop(self, page=0, category=None, brand=None, search="", **post):
if brand:
context = dict(request.env.context)
context.setdefault("brand_id", int(brand))
request.env.context = context
return super().shop(
page=page, category=category, brand=brand, search=search, **post
)

# Method to get the brands.
@http.route(["/page/product_brands"], type="http", auth="public", website=True)
def product_brands(self, **post):
b_obj = request.env["product.brand"]
domain = []
if post.get("search"):
domain += [("name", "ilike", post.get("search"))]
brand_rec = b_obj.sudo().search(domain)

keep = QueryURL("/page/product_brands", brand_id=[])
values = {"brand_rec": brand_rec, "keep": keep}
if post.get("search"):
values.update({"search": post.get("search")})
return request.render("website_sale_product_brand.product_brands", values)
12 changes: 12 additions & 0 deletions website_sale_product_brand/data/website_menu.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">

<!-- Menu in website for Brand -->
<record id="menu_website_sale_brand" model="website.menu">
<field name="name">Shop by Brand</field>
<field name="url">/page/product_brands</field>
<field name="sequence" type="int">25</field>
<field name="parent_id" ref="website.main_menu" />
</record>

</odoo>
13 changes: 13 additions & 0 deletions website_sale_product_brand/demo/assets.xml
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->

<odoo>

<template id="assets_frontend" inherit_id="website.assets_frontend">
<xpath expr=".">
<script type="text/javascript"
src="/website_sale_product_brand/static/src/js/tour.js"/>
</xpath>
</template>

</odoo>
6 changes: 6 additions & 0 deletions website_sale_product_brand/demo/product_brand_demo.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_brand_apple_demo" model="product.brand">
<field name="name">Apple</field>
</record>
</odoo>
9 changes: 9 additions & 0 deletions website_sale_product_brand/demo/product_product_demo.xml
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product.product_product_7" model="product.product">
<field name="product_brand_id" ref="product_brand_apple_demo"/>
</record>
<record id="product.product_product_9" model="product.product">
<field name="product_brand_id" ref="product_brand_apple_demo"/>
</record>
</odoo>
48 changes: 48 additions & 0 deletions website_sale_product_brand/i18n/ar.po
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_brand
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-29 01:20+0000\n"
"PO-Revision-Date: 2016-11-29 01:20+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "No Brands Found."
msgstr ""

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "Product Brands"
msgstr ""

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "Search"
msgstr ""

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "Search..."
msgstr ""

#. module: website_sale_product_brand
#: model:website.menu,name:website_sale_product_brand.menu_website_sale_brand
msgid "Shop by Brand"
msgstr ""

#~ msgid "Website"
#~ msgstr "الموقع"
47 changes: 47 additions & 0 deletions website_sale_product_brand/i18n/bg.po
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_brand
#
# Translators:
# Kaloyan Naumov <kaloyan@lumnus.net>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-29 01:20+0000\n"
"PO-Revision-Date: 2016-11-29 01:20+0000\n"
"Last-Translator: Kaloyan Naumov <kaloyan@lumnus.net>, 2016\n"
"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\n"
"Language: bg\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "No Brands Found."
msgstr ""

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "Product Brands"
msgstr ""

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "Search"
msgstr ""

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "Search..."
msgstr ""

#. module: website_sale_product_brand
#: model:website.menu,name:website_sale_product_brand.menu_website_sale_brand
msgid "Shop by Brand"
msgstr ""

#~ msgid "Website"
#~ msgstr "Уебсайт"
48 changes: 48 additions & 0 deletions website_sale_product_brand/i18n/bs.po
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_brand
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-29 01:20+0000\n"
"PO-Revision-Date: 2016-11-29 01:20+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Bosnian (https://www.transifex.com/oca/teams/23907/bs/)\n"
"Language: bs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "No Brands Found."
msgstr ""

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "Product Brands"
msgstr ""

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "Search"
msgstr ""

#. module: website_sale_product_brand
#: model:ir.ui.view,arch_db:website_sale_product_brand.product_brands
msgid "Search..."
msgstr ""

#. module: website_sale_product_brand
#: model:website.menu,name:website_sale_product_brand.menu_website_sale_brand
msgid "Shop by Brand"
msgstr ""

#~ msgid "Website"
#~ msgstr "Web stranica"

0 comments on commit efa13d5

Please sign in to comment.