Merge pull request #3723 from expsa/dev_odex25_donation

Dev odex25 donation
This commit is contained in:
Tahir Hassan 2025-07-01 13:43:03 +04:00 committed by GitHub
commit 1cb8739265
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -44,11 +44,15 @@ class SaleOrder(models.Model):
for sale in self:
sale.sale_order_portal_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') + sale.get_portal_url()
def _cart_update(self, *args, **kwargs):
res = super()._cart_update(*args, **kwargs)
def _cart_update(self, product_id=None, line_id=None, add_qty=0, set_qty=0, **kwargs):
res = super()._cart_update(product_id=product_id,
line_id=line_id,
add_qty=add_qty,
set_qty=set_qty,
**kwargs)
order_line = self.env['sale.order.line'].browse(res.get('line_id'))
qty = kwargs.get('add_qty', False) or kwargs.get('set_qty', False)
qty = add_qty or set_qty
if qty and order_line:
self.convert_donation_qty_to_price(order_line, qty)