OCA / operating-unit

Manage Operating Units in Odoo
GNU Affero General Public License v3.0
69 stars 235 forks source link

[MIG] stock_operating_unit: Migration to 17.0 #673

Open jdidderen-nsi opened 1 month ago

jdidderen-nsi commented 1 month ago

Depends on:

AaronHForgeFlow commented 1 month ago

/ocabot migration stock_operating_unit

jdidderen-nsi commented 1 month ago

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?

AaronHForgeFlow commented 1 month ago

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.