OCA / multi-company

GNU Affero General Public License v3.0
100 stars 281 forks source link

[FIX]purchase_sale_inter_company: handle pickings with lots/serials #541

Closed aleuffre closed 9 months ago

aleuffre commented 9 months ago

Previously an intercompany picking with tracked products would would throw an error.

With this fix, the method searches for a lot in the destination company that matches the one in the source company (same name and same product); a new lot is created by duplicating the original, if none is found.

In this PR I'm also adding myself and my colleague @renda-dev as maintainers of the module.

francesco-ooops commented 9 months ago

@pedrobaeza good for you?

OCA-git-bot commented 9 months ago

What a great day to merge this nice PR. Let's do it! Prepared branch 14.0-ocabot-merge-pr-541-by-pedrobaeza-bump-patch, awaiting test results.

OCA-git-bot commented 9 months ago

Congratulations, your PR was merged at 5c944c10adf550f7367f797cb0980f47f4eaf732. Thanks a lot for contributing to OCA. ❤️

aleuffre commented 9 months ago

Another candidate one to be fw-port it

/ocabot merge patch

Thank you once again for the merge @pedrobaeza

Unfortunately, this whole part of the code that deals with synchronizing the picking between two companies (and not just the SO/PO) was only added to v12 and then to v14 quite recently.

v12: https://github.com/OCA/multi-company/pull/508 v14: https://github.com/OCA/multi-company/pull/507

In v15 and v16 there is a whole new module stock_intercompany https://github.com/OCA/multi-company/tree/15.0/stock_intercompany that's entirely independent code.

So a few of our recent PRs can't be FW easily. I'm not sure if you have any advice on how to proceed from here.

pedrobaeza commented 9 months ago

In fact, I think this should go into purchase_sale_stock_intercompany or similar module name, to act as glue module, unless the other module is enough to join everything. The new split is logical, as you may have service sale/purchase inter-connection, but not forcing to have stock installed. You should accommodate the code of this PR to the new module structure.

pedrobaeza commented 9 months ago

It seems the module already exists: https://github.com/OCA/multi-company/tree/15.0/purchase_sale_stock_inter_company, so you only need to plug this code into them.