ddmrp icon indicating copy to clipboard operation
ddmrp copied to clipboard

Buffer Procurement Wizard planned date wrong for manufactured buffer

Open jbaudoux opened this issue 3 months ago • 5 comments

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

jbaudoux avatar Oct 09 '25 16:10 jbaudoux

Hi @jbaudoux

Without testing, what you describe sound logical and feasible. Are you planning to open a PR to fix the bug?

Thanks!

LoisRForgeFlow avatar Oct 10 '25 08:10 LoisRForgeFlow

I also fixed this side issue https://github.com/OCA/ddmrp/pull/565 regarding dlt computation on BOM

jbaudoux avatar Oct 10 '25 14:10 jbaudoux

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:

Image Image

What am I missing?

LoisRForgeFlow avatar Oct 14 '25 10:10 LoisRForgeFlow

@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 avatar Oct 14 '25 13:10 jbaudoux

@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

LoisRForgeFlow avatar Oct 16 '25 15:10 LoisRForgeFlow