You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a multicompany environment, user A is allowed to access multiple companies, eg. Company1 and Company2.
For Company1, a vendor (partner) with vat number = XYX is present.
In Company2 there is also a vendor with same vat number = XYX; so that vendor is known in both Company1 and Company2.
The module base_business_document_import is capable to select the partner based on the result of method def _match_partner(). In our scenario, the match is based on the vat number: see lines.
User A logs in with Company1 and tries to import a document (eg. an invoice).
I would expect that the retrieved vendor (partner) is the one with vat = XYX belonging to Company1.
But it could happen that the def _match_partner() retrieves the wrong partner: the one of Company2.
Adding ('company_id', '=', self.env.user.company_id.id) in the domain of these lines seems fixing the problem.
However there could be other cases where a patch is needed in order to make the module multicompany compliant.
I don't have time to investigate further and I will not have time to propose a PR during the next weeks, so I open this issue as a reminder to open a PR. In the meanwhile any help will be very appreciated!
The text was updated successfully, but these errors were encountered:
Tested with 11.0.
Here is the scenario:
base_business_document_import
is capable to select the partner based on the result of methoddef _match_partner()
. In our scenario, the match is based on the vat number: see lines.User A logs in with Company1 and tries to import a document (eg. an invoice).
I would expect that the retrieved vendor (partner) is the one with vat = XYX belonging to Company1.
But it could happen that the
def _match_partner()
retrieves the wrong partner: the one of Company2.Adding
('company_id', '=', self.env.user.company_id.id)
in the domain of these lines seems fixing the problem.However there could be other cases where a patch is needed in order to make the module multicompany compliant.
I don't have time to investigate further and I will not have time to propose a PR during the next weeks, so I open this issue as a reminder to open a PR. In the meanwhile any help will be very appreciated!
The text was updated successfully, but these errors were encountered: