Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRP with multiple uoms fails to confirm #2060

Open
juliaprieto opened this issue Jun 4, 2024 · 2 comments
Open

MRP with multiple uoms fails to confirm #2060

juliaprieto opened this issue Jun 4, 2024 · 2 comments
Labels

Comments

@juliaprieto
Copy link

Module

stock_reserve

Describe the bug

When confirming a manufacturing order with products which have different units of mesurements, an error is raised.
ValueError: Expected singleton: uom.uom(1, 8)
from
stock_reserve/models/stock_reserve.py", line 193, in write
rounding = self.product_uom.rounding

To Reproduce

Affected versions: 14.0 (maybe others)
confirm manufacturing orders

Steps to reproduce the behavior:

  1. Create a manufacturing order,
  2. Add products with different units of measurements (units, meters, g...)
  3. Add amounts available in source stock for each product
  4. Confirm manufacturing orders

Expected behavior
Manufacturing order is confirmed and reservations are created for required products

Additional context

@juliaprieto juliaprieto added the bug label Jun 4, 2024
@dorcyv
Copy link

dorcyv commented Sep 30, 2024

Is this still relevant?
I can't reproduce this bug on version 14.0.

@juliaprieto
Copy link
Author

Thank you for your reply.
We extended your module (without overriding the write method) to include stock reservations in our stock move workflow.
In our customization, we call write method on many stock.reservation at once, which triggers the error.
For best practices, the fix should be included in your stock.reservation write method where you set the "rounding" variable line 193 rounding = self.product_uom.rounding that is dependant on the record.
To my understanding, the write method should be callable on multiple records at once, what do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants