Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion product_multi_price/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Product Multi Price",
"version": "16.0.1.0.1",
"version": "16.0.1.0.2",
"author": "Tecnativa," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-attribute",
"category": "Product Management",
Expand Down
2 changes: 1 addition & 1 deletion product_multi_price/models/product_pricelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ def _compute_base_price(self, product, quantity, uom, date, target_currency):
product, quantity, uom, date, target_currency
)
if self.compute_price == "formula" and self.base == "multi_price":
result = product.sudo()._get_multiprice_pricelist_price(self)
result = product.sudo()._get_multiprice_pricelist_base_price(self)
return result
11 changes: 7 additions & 4 deletions product_multi_price/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ def _convert_to_price_uom(self, price):
price_uom = self.env["uom.uom"].browse([qty_uom_id])
return self.uom_id._compute_price(price, price_uom)

def _get_multiprice_pricelist_price(self, rule):
"""Method for getting the price from multi price."""
self.ensure_one()
def _get_multiprice_pricelist_base_price(self, rule):
company = rule.company_id or self.env.user.company_id
price = (
return (
self.env["product.multi.price"]
.sudo()
.search(
Expand All @@ -33,6 +31,11 @@ def _get_multiprice_pricelist_price(self, rule):
.price
or 0
)

def _get_multiprice_pricelist_price(self, rule):
"""Method for getting the price from multi price."""
self.ensure_one()
price = self._get_multiprice_pricelist_base_price(rule)
if price:
# We have to replicate this logic in this method as pricelist
# method are atomic and we can't hack inside.
Expand Down