Skip to content

Commit

Permalink
[MIG] product_variant_specific_description: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Luis-Mora committed May 8, 2024
1 parent e6ae638 commit ddbd54e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
3 changes: 3 additions & 0 deletions product_variant_specific_description/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ Contributors
------------

- Lois Rilo <[email protected]>
- `Binhex <https://binhex.cloud//com>`__:

- David Luis Mora <[email protected]>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion product_variant_specific_description/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Product Variant Specific Description",
"version": "16.0.1.0.1",
"version": "17.0.1.0.1",
"category": "Product",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-variant",
Expand Down
4 changes: 2 additions & 2 deletions product_variant_specific_description/init_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
logger = logging.getLogger(__name__)


def post_init_hook(cr, registry):
def post_init_hook(env):
logger.info("Setting product variant description with product template description")
cr.execute(
env.cr.execute(
"""
UPDATE product_product pp
SET description = pt.description
Expand Down
4 changes: 4 additions & 0 deletions product_variant_specific_description/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
- Lois Rilo \<<[email protected]>\>
- [Binhex](https://binhex.cloud//com):
- David Luis Mora \<<[email protected]>\>


Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
<li><a class="reference external" href="https://binhex.cloud//com">Binhex</a>:<ul>
<li>David Luis Mora &lt;<a class="reference external" href="mailto:d.luis&#64;binhex.cloud">d.luis&#64;binhex.cloud</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<xpath expr="//field[@name='description']/.." position="attributes">
<attribute
name="attrs"
>{'invisible': [('product_variant_count', '>', 1)]}</attribute>
<attribute name="invisible">'product_variant_count', '>', 1</attribute>
</xpath>
<xpath expr="//field[@name='description']" position="attributes">
<attribute
name="attrs"
>{'readonly': [('is_system_multi_lang', '=', True)]}</attribute>
<attribute name="readonly">is_system_multi_lang</attribute>
</xpath>
<xpath expr="//field[@name='description']" position="before">
<field name="is_system_multi_lang" invisible="1" />
<p
colspan="2"
attrs="{'invisible': [('is_system_multi_lang', '=', False)]}"
>
<field name="is_system_multi_lang" column_invisible="1" />
<p colspan="2" invisible="not is_system_multi_lang">
<i
class="fa fa-info-circle"
/> This field is maintained in the product variant form.
Expand Down

0 comments on commit ddbd54e

Please sign in to comment.