Skip to content

Commit

Permalink
UPD black and remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
bealdav committed Jan 6, 2025
1 parent b7dba1a commit 6454801
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 34 deletions.
20 changes: 1 addition & 19 deletions base_c/models/partner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from odoo import fields, models, api
from odoo import fields, models
import logging

logger = logging.getLogger(__name__)
Expand All @@ -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
Expand Down
10 changes: 0 additions & 10 deletions base_c/views/partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,4 @@

<function model="ir.actions.act_window.view" name="_contact_default_view_type" />

<!-- <record id="view_partner_form" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name="ref" position="after">
<field name="typology_id" />
</field>
</field>
</record>
-->
</odoo>
3 changes: 1 addition & 2 deletions product_pricelist_supplierinfo_category/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
"views/product_category.xml",
"views/product_supplierinfo.xml",
],
"demo": [
],
"demo": [],
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 6454801

Please sign in to comment.