Open jdidderen-nsi opened 1 month ago
/ocabot migration stock_operating_unit
Open discussion for the constraint on locations : _check_required_operating_unit
In previous versions of the module, the operating unit was mandatory on locations (except customer and supplier ones). In the case of one of my projects, the customer wants to have a "central" warehouse common to all operating units. With the constraint, I have to define an operating unit, even if it's not coherent with the business need.
Right now, I remove this part of the code from the constraint, but maybe there is another solution.
What's the opinion on this?
I am not completely sure, but I think the condition is there mainly for correctly inventory accounting, so to ensure that the inventory value is owned by a specific operating unit. If that is the case maybe we can move the contraint to the stock_account_operating_unit module.
Another solution is to consider using hierarchy in operating units: https://github.com/OCA/operating-unit/pull/319 like if the parent OU represents the company. This approach is more complex because all the contraints definitions should be refactored.
Depends on: