Before fce296acd9f4187c8473ca5ae0b68fb96e9026ff, the retrieve partner
function first looked for a partner with company_id = env.company.id. If
a parter wasn't found, a global search without constraining `company_id`
was made.
Thus, a search in a database with 2 partners with the same VAT (one has
a company_id, the other not) would return the partner linked to the
right company.
After fce296acd9f4187c8473ca5ae0b68fb96e9026ff, it is no longer the
case. The search is done with `[('company_id', 'in',
[self.env.company.id, False])`, so 2 partners are found, and none are
returned.
We reintroduce that loop in this commit to fix that case.
closes odoo/odoo#163702
X-original-commit: ff71f130cf19732f803fe8c2fbf1fc08c41dbc35
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
Odoo Accounting
The Odoo Open Source Accounting app allows a better way to collaborate with your accountants, your customers and control your suppliers.
Activate features on demand, from integrated analytic accounting to budget, assets and multiple companies consolidation.
A Smart User Interface
Record transactions in a few clicks and easily manage all financial activities in one place. Odoo's user interface is designed with productivity in mind.
A Better Way To Work – Together
Share access to your latest business numbers with your team and your accountant – so everyone is up to speed. From work, home or on the go.
Connect Your Bank Accounts
Import your bank statements and reconcile them in just a few clicks. Prepare payment orders based on your supplier invoices and payment terms.
Electronic invoicing and automated follow-ups
Create and send professional invoices & get paid online. Get rid of the stress of having to constantly remind your debtors. Simply set-up and automate follow-ups to get paid quickly.
Sales Integration
Automatically create invoices from sales orders, delivery orders or base them on time and material. Re-invoice expenses on projects to your customer in just a few clicks.
Purchase Integration
Control supplier invocies based on purchase orders. Get real-time inventory valuation reports automatically posted in your accounts.
Multi-Level Analytic Accounting
Integrate your analytic accounting operations with timesheets, projects, invoices, expenses, etc. No need to record transactions, all analytic entries are posted automatically following your business rules.
Everything you need to grow
Manage your assets, track expenses, control budgets, multi-level analytic accounting; Odoo has all the features you need to sustain all your business activities.
Scale With Your Organization
Odoo supports multiple currencies, multiple users with different access rights, multiple companies with real time consolidation and unlimited analytic plans.