be8731cc6a0350a7506b2b33262d502cb00d15e0
This commit tries to fix multi company problem in Expense application. Indeed, no check were done to ensure this business flow. Some technical decisions were made: - journal company: the journal define the company in which the accounting entries will be created. We know ensure with 'domains' and constraints that the journal have the same company as the expense sheet. - journal conditionnally required: the journal is only required when posting the expense. It is set by defaut on creation, but can be modify by accountant users. This is why the expense company determine the journal and not the opposite. - company fields required: As we need to use the company from the expense / expense sheet to determine the journal field and since expense models are business models, we needed to put company fields required. Business Flow When an employee creates an expense, the expense should be in its current company. A product from any allowed company can be chosen. Only the taxes of the expense company are applied to compute amounts. Then a report (sheet) can be created. We ensure that the expense lines of a report belongs to the same company as the report and to the same employee. Once submitted and approved by manager, the account journal can be set: it is forced to be in the same company as the expense report. The accounting entries are created in the journal (and expense report) company. As the analytic account can be shared (company is not set) the analytic entries will be in the expense company (handle by the accounting module). The payment is now registered in the expense company. Migration As company fields are now required, fill the company fields with the company of the related employee, or fallback on the one from the journal. Task-1999686 closes odoo/odoo#36447 Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
…
…
…
…
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
Then follow the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%