Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base_business_document_import: selecting partner in a multicompany environment #54

Closed
astirpe opened this issue Apr 12, 2018 · 0 comments

Comments

@astirpe
Copy link
Member

astirpe commented Apr 12, 2018

Tested with 11.0.

Here is the scenario:

  • 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant