Buffer Procurement Wizard planned date wrong for manufactured buffer
In the case of a manufactured buffer, the planned date computation depends on the bom context location. Changing the context location on the bom shows how the dlt is affected.
When we procure manually a buffer with the wizard, it prepares the lines based on the location of the buffer. However, the planned date is based on the "Stock" location dlt instead of that procurement location.
It looks to me that when buffer._get_date_planned() is called in ddmrp/wizards/make_procurement_buffer.py
https://github.com/OCA/ddmrp/blob/8a98e41bfb94f5dc1733fb8061de5de610025545/ddmrp/wizards/make_procurement_buffer.py#L33
it's missing to put the location in the context
https://github.com/OCA/ddmrp/blob/8a98e41bfb94f5dc1733fb8061de5de610025545/ddmrp/models/mrp_bom.py#L66
The consequence, in my case, is that the planned date is using the supplier lead time instead of the dlt of buffered components. On Stock it's purchased, on the production location it is buffered.
cc @LoisRForgeFlow @BernatPForgeFlow @JordiBForgeFlow @meredith-alana @Highcooley
Hi @jbaudoux
Without testing, what you describe sound logical and feasible. Are you planning to open a PR to fix the bug?
Thanks!
I also fixed this side issue https://github.com/OCA/ddmrp/pull/565 regarding dlt computation on BOM
Hi @jbaudoux
I'm actually testing this without your PR, and it works fine for me. If I change the location of the buffer, the planned date changes accordingly:
What am I missing?
@LoisRForgeFlow Do you have a manufactured buffer? On the bom, you should see that changing the location changes the dlt. Then in the request procurement, it's always the date from stock.
@jbaudoux Yes, FP-01 from demo data. I might be not understanding the issue. See the video below from runboat:
https://github.com/user-attachments/assets/9f78600f-b715-42ba-9f1a-8da240caca7c