diff --git a/README.md b/README.md index ca0a7bcfb8595b529106dd9d5d598abaa14d6e94..fad77ec3d7338ed4a482b1f1785c243b81ca35d7 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ## Description - rend configurable par produit la possibilité d'éditer le prix depuis un devis +- stocke les champs ajoutés par le module product_standard_margin (pour pouvoir ordonner +les listes sur ces champs) ## Exemple diff --git a/__manifest__.py b/__manifest__.py index 03def7ae20ef3a8cf15301e5aed5667e49b547a4..f0d1d6c35c5437c508a61d2dac36188b552b013d 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -5,7 +5,7 @@ "website": "https://le-filament.com", "version": "16.0.1.0.0", "license": "AGPL-3", - "depends": ["sale_margin", "product"], + "depends": ["sale_margin", "product_standard_margin"], "data": [ # views "views/sale_order_view.xml", diff --git a/models/product_template.py b/models/product_template.py index eef7801e76012fd4a85185e221f334a363f90891..cae048f700447af2b02c47be7e3f65ec8d9c1142 100644 --- a/models/product_template.py +++ b/models/product_template.py @@ -3,8 +3,6 @@ from odoo import fields, models -# modify product to add a boolean to allow price to be modified - class ProductTemplate(models.Model): _inherit = "product.template" @@ -17,6 +15,12 @@ class ProductTemplate(models.Model): "Le prix d'achat peut être édité depuis un devis.", default=False ) + # Change computed margin fields to stored + list_price_vat_excl = fields.Float(store=True) + standard_margin = fields.Float(store=True) + standard_margin_rate = fields.Float(store=True) + standard_markup_rate = fields.Float(store=True) + # ------------------------------------------------------ # SQL Constraints # ------------------------------------------------------