OCA / multi-company

GNU Affero General Public License v3.0
98 stars 280 forks source link

[14.0][FIX] product_multi_company: recompute variant companies #590

Closed ilyasProgrammer closed 5 months ago

ilyasProgrammer commented 5 months ago

FIX https://github.com/OCA/multi-company/issues/585 Need to force recompute related product.product company_ids field. Otherwise it takes wrong values from the cache.

pedrobaeza commented 5 months ago

This doesn't seem the correct approach, as it causes an overhead on all models. Why don't you redefine the field as computed in product variant, like other fields like weight do?

ilyasProgrammer commented 5 months ago

This doesn't seem the correct approach, as it causes an overhead on all models. Why don't you redefine the field as computed in product variant, like other fields like weight do?

Looks like it worked as well. Updated

ilyasProgrammer commented 5 months ago

With store=False error is still there

pedrobaeza commented 5 months ago

Uhm, that's very weird. This should be an ORM fault, as there's nothing in the business side leading to the problem. OK, restore it and clean commit history, and let me check once again.

pedrobaeza commented 5 months ago

/ocabot merge minor

OCA-git-bot commented 5 months ago

This PR looks fantastic, let's merge it! Prepared branch 14.0-ocabot-merge-pr-590-by-pedrobaeza-bump-minor, awaiting test results.

OCA-git-bot commented 5 months ago

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