diff --git a/models/product_category.py b/models/product_category.py index 28593e32a4c02b51fc192a40a80b419ff1b1639b..c2330f95f4c669b0ef60586e9b982678803a8a85 100644 --- a/models/product_category.py +++ b/models/product_category.py @@ -12,10 +12,6 @@ class ProductCategory(models.Model): # ------------------------------------------------------ symbol = fields.Char("Symbole") accessory_label = fields.Char("Nom de l'accessoire associƩ") - mulch_quantity_multiplier = fields.Integer( - "Multiplicateur paillage", - default=1 - ) # ------------------------------------------------------ # SQL Constraints diff --git a/models/product_template.py b/models/product_template.py index d991d840461c50e69498180ad5e2f4478c47ba66..b67b60fa4b7883ff9730f4f181fd60c68c11b18f 100644 --- a/models/product_template.py +++ b/models/product_template.py @@ -14,7 +14,8 @@ class ProductTemplate(models.Model): related="categ_id.accessory_label", readonly=True ) mulch_quantity_multiplier = fields.Integer( - related="categ_id.mulch_quantity_multiplier", readonly=True + "Multiplicateur paillage", + default=1 ) # ------------------------------------------------------ diff --git a/views/product_template_views.xml b/views/product_template_views.xml index 104603e1b3b0966b2a11833501f0ad03336ccafa..31b5080f097de04f4663f078576d24c6b3cbfccf 100644 --- a/views/product_template_views.xml +++ b/views/product_template_views.xml @@ -10,12 +10,6 @@ <field name="symbol" /> <field name="accessory_label" /> <field name="name" /> - - <t t-if="record.name == 'Paillage'"> - <div> - <field name="mulch_quantity_multiplier" /> - </div> - </t> </field> </field> </record> @@ -48,6 +42,9 @@ </tbody> </table> </xpath> + <field name="categ_id" position="after"> + <field name="mulch_quantity_multiplier" attrs="{'invisible': [('categ_id', '!=', %(product_category_mulch)d)]}"/> + </field> </field> </record>