mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] delivery_hibou: changes on models, migration completed
This commit is contained in:
@@ -318,7 +318,7 @@ class ChooseDeliveryPackage(models.TransientModel):
|
||||
and not ml.result_package_id
|
||||
)
|
||||
if not move_line_ids:
|
||||
move_line_ids = picking_move_lines.filtered(lambda ml: float_compare(ml.product_uom_qty, 0.0,
|
||||
move_line_ids = picking_move_lines.filtered(lambda ml: float_compare(ml.reserved_uom_qty, 0.0,
|
||||
precision_rounding=ml.product_uom_id.rounding) > 0 and float_compare(
|
||||
ml.qty_done, 0.0,
|
||||
precision_rounding=ml.product_uom_id.rounding) == 0)
|
||||
|
||||
@@ -84,7 +84,7 @@ class StockPicking(models.Model):
|
||||
cost = sum([(l.product_id.standard_price * l.qty_done) for l in self.move_line_ids] or [0.0])
|
||||
if not cost:
|
||||
# Assume Full Value
|
||||
cost = sum([(l.product_id.standard_price * l.product_uom_qty) for l in self.move_lines] or [0.0])
|
||||
cost = sum([(l.product_id.standard_price * l.product_uom_qty) for l in self.move_ids] or [0.0])
|
||||
return cost
|
||||
|
||||
def clear_carrier_tracking_ref(self):
|
||||
|
||||
@@ -88,7 +88,7 @@ class TestDeliveryHibou(common.TransactionCase):
|
||||
# This relies heavily on the 'stock' demo data.
|
||||
# Should only have a single move_line_ids and it should not be done at all.
|
||||
self.assertEqual(picking_out.move_line_ids.mapped('qty_done'), [0.0])
|
||||
self.assertEqual(picking_out.move_line_ids.mapped('product_uom_qty'), [15.0])
|
||||
self.assertEqual(picking_out.move_line_ids.mapped('reserved_uom_qty'), [15.0])
|
||||
self.assertEqual(picking_out.move_line_ids.mapped('product_id.standard_price'), [100.0])
|
||||
test_whole_value = 15.0 * 100.0
|
||||
test_one_value = 100.0
|
||||
@@ -138,7 +138,7 @@ class TestDeliveryHibou(common.TransactionCase):
|
||||
# This relies heavily on the 'stock' demo data.
|
||||
# Should only have a single move_line_ids and it should not be done at all.
|
||||
self.assertEqual(picking_in.move_line_ids.mapped('qty_done'), [0.0])
|
||||
self.assertEqual(picking_in.move_line_ids.mapped('product_uom_qty'), [35.0])
|
||||
self.assertEqual(picking_in.move_line_ids.mapped('reserved_uom_qty'), [35.0])
|
||||
self.assertEqual(picking_in.move_line_ids.mapped('product_id.standard_price'), [55.0])
|
||||
|
||||
self.assertEqual(picking_in.carrier_id._classify_picking(picking=picking_in), 'in')
|
||||
|
||||
Reference in New Issue
Block a user