mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
FIX product_catch_weight if line moved doesn't have a lot, then the ratio is implicitly 0 despite having a default ratio.
This commit is contained in:
@@ -25,7 +25,7 @@ class AccountInvoiceLine(models.Model):
|
||||
move_lines = self.sale_line_ids.mapped('move_ids.move_line_ids')
|
||||
else:
|
||||
move_lines = self.purchase_line_id.mapped('move_ids.move_line_ids')
|
||||
for move_line in move_lines:
|
||||
for move_line in move_lines.filtered(lambda l: l.lot_id):
|
||||
qty_done = move_line.qty_done
|
||||
current_qty_done = qty_done + qty_done_total
|
||||
r = move_line.lot_id.catch_weight_ratio
|
||||
|
||||
@@ -30,6 +30,7 @@ class TestPicking(TransactionCase):
|
||||
'uom_po_id': self.product_uom_id.id,
|
||||
'catch_weight_uom_id': self.ref_uom_id.id,
|
||||
})
|
||||
self.pricelist = self.env.ref('product.list0')
|
||||
|
||||
|
||||
# def test_creation(self):
|
||||
@@ -69,6 +70,7 @@ class TestPicking(TransactionCase):
|
||||
'partner_invoice_id': self.partner1.id,
|
||||
'partner_shipping_id': self.partner1.id,
|
||||
'order_line': [(0, 0, {'product_id': self.product1.id})],
|
||||
'pricelist_id': self.pricelist.id,
|
||||
})
|
||||
so.action_confirm()
|
||||
self.assertTrue(so.state in ('sale', 'done'))
|
||||
@@ -104,6 +106,7 @@ class TestPicking(TransactionCase):
|
||||
'partner_invoice_id': self.partner1.id,
|
||||
'partner_shipping_id': self.partner1.id,
|
||||
'order_line': [(0, 0, {'product_id': self.product1.id, 'product_uom_qty': 2.0})],
|
||||
'pricelist_id': self.pricelist.id,
|
||||
})
|
||||
so.action_confirm()
|
||||
self.assertTrue(so.state in ('sale', 'done'))
|
||||
|
||||
Reference in New Issue
Block a user