diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-01-28 09:20:32 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-01-28 12:15:02 +0000 |
| commit | f06397b2e68b8cfb1de274e4a96b69a78a85339c (patch) | |
| tree | b53185790d61ad8d0864c4b8a1fb06b4a929bece | |
| parent | a74a6480302620be364d2d15717fce59db3ddf4e (diff) | |
[FIX] stock_landed_costs: skip cancel move
- Create a product A, FIFO and Automated
- Create a PO for 50 units
- Receive 45 units, no backorder
- Create a landed cost for the picking
The landed cost is split between the two move lines (45 units and 5
units).
This occurs since in v13, there is no canceled picking created for the
backorder, but a canceled stock move.
We filter out canceled moves.
opw-2179145
closes odoo/odoo#44095
X-original-commit: 120a2d116e4820fa9a4529e8ef01569823d02d13
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
| -rw-r--r-- | addons/stock_landed_costs/models/stock_landed_cost.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock_landed_costs/models/stock_landed_cost.py b/addons/stock_landed_costs/models/stock_landed_cost.py index 91f8d42cdae..0e7f69c901d 100644 --- a/addons/stock_landed_costs/models/stock_landed_cost.py +++ b/addons/stock_landed_costs/models/stock_landed_cost.py @@ -201,7 +201,7 @@ class LandedCost(models.Model): for move in self.mapped('picking_ids').mapped('move_lines'): # it doesn't make sense to make a landed cost for a product that isn't set as being valuated in real time at real cost - if move.product_id.valuation != 'real_time' or move.product_id.cost_method not in ('fifo', 'average'): + if move.product_id.valuation != 'real_time' or move.product_id.cost_method not in ('fifo', 'average') or move.state == 'cancel': continue vals = { 'product_id': move.product_id.id, |
