Closed pedrobaeza closed 9 months ago
/ocabot merge patch
What a great day to merge this nice PR. Let's do it! Prepared branch 15.0-ocabot-merge-pr-536-by-pedrobaeza-bump-patch, awaiting test results.
Congratulations, your PR was merged at f4876155cecd9863501b9ca74c9c39ec9942f288. Thanks a lot for contributing to OCA. ❤️
Forward-port of #535
Steps to reproduce:
Result:
'Stock>Inventory adjustment' belongs to company 'C2' and 'Product' (product_id: 'Product 1') belongs to another company.
Explanation:
This is because the computed field
company_id
that is used for checking the product company vs the stock.move company (the error is not accurate, as it says the location, but it's the move), is returning the main company where the user is.Solution:
Inject a context whenever we run
_check_company
for having available the company involved, and use that company as value for the record being checked if included in the allowed companies.@Tecnativa