You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
# © 2019 Le Filament (<http://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, api
class SaleOrder(models.Model): _inherit = "sale.order"
@api.one def _compute_website_order_line(self): self.website_order_line = self.order_line.filtered( lambda t: not t.pack_parent_line_id.exists(), )
@api.multi def _cart_update(self, product_id=None, line_id=None, add_qty=0, set_qty=0, **kwargs): self.ensure_one() if line_id is not False: order_line = self.env['sale.order.line'].browse(line_id) # order_line = self._cart_find_product_line(product_id, line_id, **kwargs)[:1] if order_line.pack_parent_line_id: return {'line_id': order_line.id, 'quantity': 0} return super(SaleOrder, self)._cart_update(product_id, line_id, add_qty, set_qty, **kwargs)
|