Skip to content

Commit 82703b2

Browse files
committed
[FIX] delivery_postlogistics: remove obsoleted code, get sale pickings
history_ids has been removed as below link. So the code is obsoleted. odoo/odoo@b3180c8#diff-9a22420c4a72cc9b6d558b3d832846c2e44a4f3731c6df9579d66c6279c4804eL54-L57 _get_origin_pickings is to determine number of pickings of a sale order. So it should get pickings from sale_id of found picking.
1 parent ee2883b commit 82703b2

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

delivery_postlogistics/models/stock_quant_package.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _get_origin_pickings(self):
1919
self.ensure_one()
2020
move_line_model = self.env["stock.move.line"]
2121
move_line = move_line_model.search([("package_id", "=", self.id)])
22-
return move_line.mapped("picking_id")
22+
return move_line.mapped("picking_id.sale_id.picking_ids")
2323

2424
def postlogistics_cod_amount(self):
2525
""" Return the PostLogistics Cash on Delivery amount of a package
@@ -59,16 +59,4 @@ def postlogistics_cod_amount(self):
5959
)
6060
)
6161

62-
order_moves = order.mapped("order_line.procurement_ids.move_ids")
63-
package_moves = self.mapped("quant_ids.history_ids")
64-
# check if the package delivers the whole sales order
65-
if order_moves != package_moves:
66-
raise exceptions.Warning(
67-
_(
68-
"The cash on delivery amount must be manually specified "
69-
"on the packages when a sales order is delivered "
70-
"in several packages."
71-
)
72-
)
73-
7462
return order.amount_total

0 commit comments

Comments
 (0)