diff options
| author | jem-odoo <jem@openerp.com> | 2018-11-20 08:41:00 +0000 |
|---|---|---|
| committer | jem-odoo <jem@openerp.com> | 2019-04-01 07:05:02 +0000 |
| commit | a742279ad27f221326f8823f55ac6eaa2eb3856c (patch) | |
| tree | 0fcb43eb69e79d798b0b37fa1bfa1c75041fc7de /addons/web/static/src/js/views/graph/graph_controller.js | |
| parent | bc9e5ea36118f037a3660db9b48a01c680e6ee8a (diff) | |
[REF] sale,sale_expense: clean and optimize reinvoice code
In the previous commit the analytic entries generation when posting a
move was optimized to be done in batch. The performance is break
when sale module is installed. Indeed, in case of reinvoicing a
analytic line, AAL creation will trigger a sale.line creation.
This mecanism is very inefficient because
1/ AAL creation and Sales line creation are not batched
2/ sale line creation is done after the AAL creation, and then linked
with a `write` operation. So one `create` and one `write` per AAL to
reinvoice.
3/ To determine on which Sales Order to reinvoice, many `search` can
be performed per AAL.
Also, this looks strange that AAL creation might result into a sales line
creation.
This commit changes this in order to optimize and clean the code:
- the account.move.line (that creates the AAL) will also create the
Sales lines
- SO lines creation will be done in batch
- minimize the number of `search` done during the process
- the SO line will be linked to the AAL by passing the SO line id in the
create values of AAL (no `write` operation one AAL and SOL are created).
This was the last part of legacy code of 'sale_analytic.py' that we need
to get rid of. There are still work to do, but I think now, the
business case handled here can now breathe and have a peacefull life.
Task-1911898
closes odoo/odoo#28939
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views/graph/graph_controller.js')
0 files changed, 0 insertions, 0 deletions
