Fix compute_ packaging
This commit is contained in:
parent
92869e7e7f
commit
09d260b354
1 changed files with 1 additions and 4 deletions
|
|
@ -26,9 +26,6 @@ class SaleMaxQtyLine(models.TransientModel):
|
||||||
@api.depends('packaging_size', 'qty')
|
@api.depends('packaging_size', 'qty')
|
||||||
def _compute_quantity_fits_packaging(self):
|
def _compute_quantity_fits_packaging(self):
|
||||||
for sale_order in self:
|
for sale_order in self:
|
||||||
order_lines = self.env['sale.max.qty.line'].search([
|
order_lines = self.sale_max_qty_chooser.sale_max_qty_ids.filtered(lambda line: line.sale_line_id.product_id == sale_order.product_id)
|
||||||
('product_id', '=', sale_order.product_id.id),
|
|
||||||
('sale_max_qty_chooser', '=', sale_order.sale_max_qty_chooser.id),
|
|
||||||
])
|
|
||||||
total_quantity = sum(order_lines.mapped('qty'))
|
total_quantity = sum(order_lines.mapped('qty'))
|
||||||
sale_order.quantity_fits_packaging = total_quantity % sale_order.packaging_size == 0
|
sale_order.quantity_fits_packaging = total_quantity % sale_order.packaging_size == 0
|
||||||
Loading…
Reference in a new issue