On deletion of records, foreign keys are updated.
For larger tables (like account.move, account.bank.statement.line) this could take some time.
adding a "not null btree index" on sparsely populated many2one fields significantly improves performance.
In the analysis of deleting a bank statement line.
Before:
7.4s to delete the bank statement line (missing index on suspense_statement_line_id consuming 99% of the execution time)
3.8s to delete the corresponding account move
After:
With the indexes, a 700x performance improvement was found.
This opportunity is taken to add an index on all many2one fields to account.move & bank.statement.line.
Issue report by @tsb-odoo
closesodoo/odoo#145643
X-original-commit: f10b87991cc72f5e16b587b6c9ede7e338ec79ac
Related: odoo/enterprise#52466
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Debit Notes are a type of financial documents that is not very often used. Even though it's an official document type, in many countries their usage is not
Odoo does not come with a preinstalled Debit Note management, but it can be added by installing the module account_debit_note. The module as mostly been developped following localisation requirements, and while it's a corner case, it appears all the time in one of our most critical screen. Let's make it a bit more discrete.
task-3125955
closesodoo/odoo#109539
Signed-off-by: Laurent Smet <las@odoo.com>
This commit modifies most of the usages of read_group and uses
_read_group instead. _read_group doesn't join automatically on the
many2one fields when no order_by is specified, making it more performant
when the "name" of the many2one is not relevant, which is the case for
most back-end cases
closesodoo/odoo#84908
Task-id: 2479334
Related: odoo/enterprise#24877
Signed-off-by: Raphael Collet <rco@odoo.com>
You might think that if the debit note is like the inverse
of a credit note, that it is just a regular invoice.
Well, it is, except that we had several localizations
adding a link with the original invoice for the debit note.
This way, we can share that many2one and add a wizard that is
similar as the one for the credit once and for all.
In order to keep things simple, we always create a
draft debit note. The only option we give, is to copy
the original invoice lines or not.
You can also create a debit note from a credit note,
in which case the type needs to change, but we don't
copy the lines in that case (for now).
opw-2181586
closesodoo/odoo#45542
X-original-commit: f1af011d0966fa6e436168879b7f18fabb955934
Signed-off-by: Josse Colpaert <jco@openerp.com>