[FIX] product_sale_price_from_pricelist: Correct _compute_price method signature

- Changed parameter from 'qty' to 'quantity' to match Odoo 18.0 base class
- Fixes TypeError: ProductPricelistItem._compute_price() got an unexpected keyword argument 'quantity'
- This was causing price calculation failures when saving sale orders

[FIX] website_sale_aplicoop: Fix logging format string

- Changed logging format from %d to %s for existing_draft_id which is a string from JSON
- Fixes 'TypeError: %d format: a real number is required, not str' in logging
This commit is contained in:
snt 2026-02-16 15:26:22 +01:00
parent d90f043617
commit 10ae5bcbf6
2 changed files with 5 additions and 4 deletions

View file

@ -2,7 +2,8 @@
# @author Santi Noreña (<santi@criptomart.net>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
from odoo import fields
from odoo import models
class ProductPricelistItem(models.Model):
@ -13,8 +14,8 @@ class ProductPricelistItem(models.Model):
ondelete={"last_purchase_price": "set default"},
)
def _compute_price(self, product, qty, uom, date, currency=None):
result = super()._compute_price(product, qty, uom, date, currency)
def _compute_price(self, product, quantity, uom, date, currency=None):
result = super()._compute_price(product, quantity, uom, date, currency)
if self.compute_price == "formula" and self.base == "last_purchase_price":
result = product.sudo().last_purchase_price_received
return result