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>
8 lines
208 B
Python
8 lines
208 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from . import hr_expense
|
|
from . import sale_order
|
|
from . import product_template
|
|
from . import account_move
|