diff --git a/base_c/models/partner.py b/base_c/models/partner.py index c579d87..2cc1102 100644 --- a/base_c/models/partner.py +++ b/base_c/models/partner.py @@ -1,4 +1,4 @@ -from odoo import fields, models, api +from odoo import fields, models import logging logger = logging.getLogger(__name__) @@ -9,24 +9,6 @@ class ResPartner(models.Model): lang = fields.Selection(default="fr_FR") invoice_sending_method = fields.Selection(default="email") - typology_id = fields.Many2one( - comodel_name="res.partner.category", - compute="_compute_typology_id", - store=True, - ) - - @api.depends("category_id") - def _compute_typology_id(self): - for rec in self: - res = [] - if rec.category_id: - res = [ - x - for x in rec.category_id - if x.parent_id in self.env.ref("base_c.client_partner_category") - ] - res = res and res[0] or res - rec.typology_id = res def _country_df_sage100_replacement(self): # Used by db_process module that is not in dependency of this module diff --git a/base_c/views/partner.xml b/base_c/views/partner.xml index 714c4f2..77989a3 100644 --- a/base_c/views/partner.xml +++ b/base_c/views/partner.xml @@ -2,14 +2,4 @@ - diff --git a/product_pricelist_supplierinfo_category/__manifest__.py b/product_pricelist_supplierinfo_category/__manifest__.py index 4bf4820..363e2aa 100644 --- a/product_pricelist_supplierinfo_category/__manifest__.py +++ b/product_pricelist_supplierinfo_category/__manifest__.py @@ -17,6 +17,5 @@ "views/product_category.xml", "views/product_supplierinfo.xml", ], - "demo": [ - ], + "demo": [], } diff --git a/product_pricelist_supplierinfo_category/models/product_category.py b/product_pricelist_supplierinfo_category/models/product_category.py index fe681f2..a26c32c 100644 --- a/product_pricelist_supplierinfo_category/models/product_category.py +++ b/product_pricelist_supplierinfo_category/models/product_category.py @@ -7,5 +7,5 @@ class ProductCategory(models.Model): supplierinfo_margin = fields.Float( string="Marge sur prix fournisseur (%)", digits=(16, 2), - help="Si la marge du prix fournisseur n'est pas définie, celle de la catégorie sera prise en compte à la place." + help="Si la marge du prix fournisseur n'est pas définie, celle de la catégorie sera prise en compte à la place.", ) diff --git a/product_pricelist_supplierinfo_category/models/product_supplierinfo.py b/product_pricelist_supplierinfo_category/models/product_supplierinfo.py index bb75e0f..f6c8814 100644 --- a/product_pricelist_supplierinfo_category/models/product_supplierinfo.py +++ b/product_pricelist_supplierinfo_category/models/product_supplierinfo.py @@ -5,9 +5,9 @@ class ProductSupplierinfo(models.Model): _inherit = "product.supplierinfo" categ_margin = fields.Float( - "Marge Catégorie (%)", + "Marge Catégorie (%)", related="product_tmpl_id.categ_id.supplierinfo_margin", - help="Ce pourcentage de marge est appliqué si la marge au niveau du produit n'est pas remplie" + help="Ce pourcentage de marge est appliqué si la marge au niveau du produit n'est pas remplie", ) def _get_supplierinfo_pricelist_price(self):