Skip to content

Commit

Permalink
[MIG] product_pricelist_supplierinfo: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mdurepos committed Jun 26, 2024
1 parent 1a57fd5 commit 126f0bc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion product_pricelist_supplierinfo/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Supplier info prices in sales pricelists",
"summary": "Allows to create priceslists based on supplier info",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"category": "Sales/Sales",
"website": "https://github.com/OCA/product-attribute",
"author": "Tecnativa, Odoo Community Association (OCA), Vauxoo",
Expand Down
4 changes: 2 additions & 2 deletions product_pricelist_supplierinfo/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _get_supplierinfo_pricelist_price(self, rule, date=None, quantity=None):
rule, date=date, quantity=quantity, product_id=self.id
)

def price_compute(
def _price_compute(
self, price_type, uom=None, currency=None, company=None, date=False
):
"""Return dummy not falsy prices when computation is done from supplier
Expand All @@ -34,7 +34,7 @@ def price_compute(
"""
if price_type == "supplierinfo":
return dict.fromkeys(self.ids, 1.0)
return super().price_compute(
return super()._price_compute(
price_type,
uom=uom,
currency=currency,
Expand Down
4 changes: 2 additions & 2 deletions product_pricelist_supplierinfo/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _get_supplierinfo_pricelist_price(
price = min(price, price_limit + price_max_margin)
return price

def price_compute(
def _price_compute(
self, price_type, uom=None, currency=None, company=False, date=False
):
"""Return dummy not falsy prices when computation is done from supplier
Expand All @@ -91,6 +91,6 @@ def price_compute(
"""
if price_type == "supplierinfo":
return dict.fromkeys(self.ids, 1.0)
return super().price_compute(
return super()._price_compute(

Check warning on line 94 in product_pricelist_supplierinfo/models/product_template.py

View check run for this annotation

Codecov / codecov/patch

product_pricelist_supplierinfo/models/product_template.py#L93-L94

Added lines #L93 - L94 were not covered by tests
price_type, uom=uom, currency=currency, company=company, date=date
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
<xpath expr="//field[@name='price_max_margin']/.." position="after">
<field
name="no_supplierinfo_min_quantity"
attrs="{'invisible':[('base', '!=', 'supplierinfo')]}"
/>
<field
name="filter_supplier_id"
attrs="{'invisible':[('base', '!=', 'supplierinfo')]}"
invisible="base != 'supplierinfo'"
/>
<field name="filter_supplier_id" invisible="base != 'supplierinfo'" />
</xpath>
</field>
</record>
Expand Down

0 comments on commit 126f0bc

Please sign in to comment.