Skip to content
Snippets Groups Projects
Commit 01c26ea7 authored by Walid's avatar Walid
Browse files

[FIX] purchase_stock: merge allocated moves


Steps to reproduce:
- In User settings add 'allocation reports' group to the admin User
- In Inventory settings enable allocation reports
- Create a stored product with 0/0 reordering rules and set a vendor
- Create an SO for that product
- Confirm the generated PO and click assign all on its receipt's allocation report
- Reduce the quantity on the SO and save

Bug:
a return is created instead of adjusting the quantity to deliver
the stock moves were not merged because their procurement method do not
match ('make_to_stock' / 'make_to_order')

Fix:
ignore procurement method when merging the moves
(introducing new config parameter)

opw-3621316

closes odoo/odoo#154658

X-original-commit: 54bd4416
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
Signed-off-by: default avatarWalid Hanniche (waha) <waha@odoo.com>
parent 1ac4aab6
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,10 @@ class StockMove(models.Model):
@api.model
def _prepare_merge_negative_moves_excluded_distinct_fields(self):
return super()._prepare_merge_negative_moves_excluded_distinct_fields() + ['created_purchase_line_id']
excluded_fields = super()._prepare_merge_negative_moves_excluded_distinct_fields() + ['created_purchase_line_id']
if self.env['ir.config_parameter'].sudo().get_param('purchase_stock.merge_different_procurement'):
excluded_fields += ['procure_method']
return excluded_fields
def _should_ignore_pol_price(self):
self.ensure_one()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment