Skip to content

Commit

Permalink
[MIG] website_sale_product_brand: Migration to v12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-teruel committed Dec 10, 2019
1 parent cb907ff commit 947c049
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 37 deletions.
15 changes: 8 additions & 7 deletions website_sale_product_brand/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Product Brand Filtering in Website
: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/11.0/website_sale_product_brand
:target: https://github.com/OCA/e-commerce/tree/12.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-11-0/e-commerce-11-0-website_sale_product_brand
:target: https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-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/11.0
:target: https://runbot.odoo-community.org/runbot/113/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -42,7 +42,7 @@ Installation
============

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

Usage
=====
Expand Down Expand Up @@ -72,7 +72,7 @@ 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:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_product_brand%0Aversion:%2012.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.

Expand All @@ -92,7 +92,8 @@ Contributors
* Meet Dholakia <m.dholakia.serpentcs@gmail.com>
* `Tecnativa <https://www.tecnativa.com>`_:

* Ernesto Tejeda <ernesto.tejeda87@gmail.com>
* Ernesto Tejeda <ernesto.tejeda@tecnativa.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>

Maintainers
~~~~~~~~~~~
Expand All @@ -107,6 +108,6 @@ 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/11.0/website_sale_product_brand>`_ project on GitHub.
This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/12.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: 1 addition & 3 deletions website_sale_product_brand/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
"Tecnativa, "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/e-commerce',
'version': '11.0.1.0.0',
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'depends': [
'product_brand',
'website_sale'
],
'data': [
"data/website_menu.xml",
"security/ir.model.access.csv",
"views/product_brand.xml",
],
'demo': [
Expand All @@ -25,5 +24,4 @@
"demo/product_product_demo.xml",
],
'installable': True,
'auto_install': False,
}
2 changes: 1 addition & 1 deletion website_sale_product_brand/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def product_brands(self, **post):
domain = []
if post.get('search'):
domain += [('name', 'ilike', post.get('search'))]
brand_rec = b_obj.search(domain)
brand_rec = b_obj.sudo().search(domain)

keep = QueryURL('/page/product_brands', brand_id=[])
values = {'brand_rec': brand_rec,
Expand Down
3 changes: 2 additions & 1 deletion website_sale_product_brand/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
* Meet Dholakia <m.dholakia.serpentcs@gmail.com>
* `Tecnativa <https://www.tecnativa.com>`_:

* Ernesto Tejeda <ernesto.tejeda87@gmail.com>
* Ernesto Tejeda <ernesto.tejeda@tecnativa.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>
2 changes: 1 addition & 1 deletion website_sale_product_brand/readme/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
To install this module, you need to install following module:
->https://github.com/OCA/product-attribute/tree/11.0/product_brand
->https://github.com/OCA/product-attribute/tree/12.0/product_brand
13 changes: 7 additions & 6 deletions website_sale_product_brand/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Product Brand Filtering in Website</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Product Brand Filtering in Website</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/e-commerce/tree/11.0/website_sale_product_brand"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_brand"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/113/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/e-commerce/tree/12.0/website_sale_product_brand"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_product_brand"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/113/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module was written to extend the functionality of product filtering on website.
It will allow you to filter product based on its brand.</p>
<p>While shopping online, we have seen various eShops having a feature to shop by brands
Expand All @@ -391,7 +391,7 @@ <h1 class="title">Product Brand Filtering in Website</h1>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#id1">Installation</a></h1>
<p>To install this module, you need to install following module:
-&gt;https://github.com/OCA/product-attribute/tree/11.0/product_brand</p>
-&gt;https://github.com/OCA/product-attribute/tree/12.0/product_brand</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
Expand Down Expand Up @@ -423,7 +423,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/e-commerce/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_product_brand%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_product_brand%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -445,7 +445,8 @@ <h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<li><p class="first"><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:</p>
<blockquote>
<ul class="simple">
<li>Ernesto Tejeda &lt;<a class="reference external" href="mailto:ernesto.tejeda87&#64;gmail.com">ernesto.tejeda87&#64;gmail.com</a>&gt;</li>
<li>Ernesto Tejeda &lt;<a class="reference external" href="mailto:ernesto.tejeda&#64;tecnativa.com">ernesto.tejeda&#64;tecnativa.com</a>&gt;</li>
<li>Sergio Teruel &lt;<a class="reference external" href="mailto:sergio.teruel&#64;tecnativa.com">sergio.teruel&#64;tecnativa.com</a>&gt;</li>
</ul>
</blockquote>
</li>
Expand All @@ -458,7 +459,7 @@ <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/11.0/website_sale_product_brand">OCA/e-commerce</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/12.0/website_sale_product_brand">OCA/e-commerce</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
34 changes: 16 additions & 18 deletions website_sale_product_brand/views/product_brand.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<div class="row">
<form action="/page/product_brands" class="form-horizontal mt32 col-md-8" method="post" >
<div class="input-group" style="margin-left:60%;">
<div class='col-md-6'>
<input type="text" name="search" class="form-control" placeholder="Search..." t-att-value='search'/>
<div class="col-md-6">
<input type="text" name="search" class="form-control" placeholder="Search..." t-att-value="search"/>
</div>
<div class='col-md-2'>
<div class="col-md-2">
<button class="btn btn-primary">Search</button>
</div>
</div>
Expand All @@ -22,21 +22,23 @@
</div>
<br/>
<section>
<t t-if='brand_rec'>
<t t-if="brand_rec">
<t t-foreach="brand_rec" t-as="o">
<div class="col-md-3" style="display: inline-block;">
<div class="col-md-3 d-md-inline-block">
<a t-att-href="keep('/shop/brands',brand = o.id)">
<div class='row' style='margin-left:15%;'>
<img itemprop="image" width="200px" height="200px" class="img" t-attf-src="/website/image/product.brand/#{o.id}/logo#{'?max_width=300&amp;max_height=300'}"/>
<div class="row">
<div class="col">
<img itemprop="image" width="200px" height="200px" class="img" t-attf-src="/website/image/product.brand/#{o.id}/logo#{'?max_width=300&amp;max_height=300'}"/>
</div>
</div>
<div class='row' style='text-align:center;'>
<t t-esc='o.name' />
<div class="row text-center">
<t t-esc="o.name" />
</div>
</a>
</div>
</t>
</t>
<t t-if='not brand_rec'>
<t t-if="not brand_rec">
<div class="text-center text-muted">
<h3 class="css_editable_display">No Brands Found.</h3>
</div>
Expand All @@ -47,14 +49,10 @@
</t>
</template>

<template id="website_sale.categories_recursive" name="Category list">
<li t-att-class="'active' if c.id == int(category or 0) else ''">
<a t-att-href="keep('/shop/category/' + slug(c), category=0, brand=brand)" t-field="c.name"/>
<ul t-if="c.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
<t t-foreach="c.child_id" t-as="c">
<t t-call="website_sale.categories_recursive"/></t>
</ul>
</li>
<template id="categories_recursive" inherit_id="website_sale.categories_recursive">
<xpath expr="//span[@t-field='c.name']/.." position="attributes">
<attribute name="t-att-href">keep('/shop/category/' + slug(c), category=0, brand=brand)</attribute>
</xpath>
</template>

</odoo>

0 comments on commit 947c049

Please sign in to comment.