[FIX] review remarks adressed

This commit is contained in:
Quentin Dupont
2024-12-20 14:43:34 +01:00
parent 7507026dd7
commit 94ed502def
3 changed files with 17 additions and 20 deletions

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-08 13:58+0000\n"
"PO-Revision-Date: 2024-11-08 13:58+0000\n"
"POT-Creation-Date: 2024-12-20 13:38+0000\n"
"PO-Revision-Date: 2024-12-20 13:38+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -128,7 +128,7 @@ msgstr "Cela définira le coût du Produit avec ce total."
#. module: mrp_bom_product_price_margin
#: model:ir.model.fields,field_description:mrp_bom_product_price_margin.field_mrp_bom__product_margin_rate
msgid "Margin (%)"
msgstr "Marge théorique (%)"
msgstr "Taux de marque (%)"
#. module: mrp_bom_product_price_margin
#: model:ir.model.fields,help:mrp_bom_product_price_margin.field_mrp_bom__product_margin_rate
@@ -148,11 +148,6 @@ msgstr ""
msgid "Product"
msgstr "Produit"
#. module: mrp_bom_product_price_margin
#: model:ir.model.fields,field_description:mrp_bom_product_price_margin.field_mrp_bom__product_margin_rate_percentage
msgid "Product Margin"
msgstr "Produit - Marge"
#. module: mrp_bom_product_price_margin
#: model:ir.model.fields,field_description:mrp_bom_product_price_margin.field_mrp_bom__product_sale_price
msgid "Product Sale Price"
@@ -188,6 +183,15 @@ msgstr "Sous-total"
msgid "Subtotal price %"
msgstr "Sous-total %"
#. module: mrp_bom_product_price_margin
#: model:ir.model.fields,help:mrp_bom_product_price_margin.field_mrp_bom__diff_product_bom_standard_price
msgid ""
"Technical field used to display or hide button 'Apply this cost to Product "
"standard price' in the form view"
msgstr ""
"Champ technique utilisé pour afficher ou cacher le bouton 'Définir le coût du Produit "
"avec ce prix.' dans la vue formulaire."
#. module: mrp_bom_product_price_margin
#: model_terms:ir.ui.view,arch_db:mrp_bom_product_price_margin.view_mrp_bom_sale_product_margin_form
msgid "Total"

View File

@@ -21,8 +21,9 @@ class MrpBom(models.Model):
help="Calculated with raw components cost divided by the BoM quantity.",
)
diff_product_bom_standard_price = fields.Boolean(
default=False,
compute="_compute_diff_product_bom_standard_price",
help="Technical field used to display or hide button 'Apply this cost "
"to Product standard price' in the form view",
)
# Fields related to sale price
@@ -30,9 +31,6 @@ class MrpBom(models.Model):
string="Product Sale Price", related="product_tmpl_id.list_price"
)
product_margin_rate = fields.Float(related="product_tmpl_id.standard_margin_rate")
product_margin_rate_percentage = fields.Float(
string="Product Margin", compute="_compute_product_margin_rate_percentage"
)
# Compute functions
@api.depends("product_tmpl_id", "product_tmpl_id.standard_price")
@@ -58,11 +56,6 @@ class MrpBom(models.Model):
else:
bom.diff_product_bom_standard_price = False
@api.depends("product_margin_rate")
def _compute_product_margin_rate_percentage(self):
for bom in self:
bom.product_margin_rate_percentage = bom.product_margin_rate / 100
# Functions to change product fields
def set_product_standard_price(self):
for bom in self.filtered(lambda x: x.product_tmpl_id):

View File

@@ -128,7 +128,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<xpath expr="//tree" position="attributes">
<attribute
name="decoration-danger"
>product_margin_rate_percentage &lt; 0</attribute>
>product_margin_rate &lt; 0</attribute>
</xpath>
<xpath expr="//field[@name='product_tmpl_id']" position="after">
<field name="currency_id" invisible="1" />
@@ -142,8 +142,8 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
help="It will set Product's standard price with this price"
/>
<field name="product_standard_price" widget="monetary" />
<field name="product_sale_price" widget="monetary" />
<field name="product_margin_rate_percentage" widget="percentage" />
<field name="product_sale_price" widget="monetary" optional="hide" />
<field name="product_margin_rate" optional="hide" />
</xpath>
</field>
</record>