[IMP] account: faster account_move unlink
On huge DB, unlinking an account_move can take a lot of time. Most of this time is wasted checking for foreign key constraint. closes odoo/odoo#84817 Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -297,8 +297,14 @@ class AccountMove(models.Model):
|
||||
help='If this checkbox is ticked, this entry will be automatically posted at its date.')
|
||||
|
||||
# ==== Reverse feature fields ====
|
||||
reversed_entry_id = fields.Many2one('account.move', string="Reversal of", readonly=True, copy=False,
|
||||
check_company=True)
|
||||
reversed_entry_id = fields.Many2one(
|
||||
comodel_name='account.move',
|
||||
string="Reversal of",
|
||||
index='btree_not_null',
|
||||
readonly=True,
|
||||
copy=False,
|
||||
check_company=True
|
||||
)
|
||||
reversal_move_id = fields.One2many('account.move', 'reversed_entry_id')
|
||||
|
||||
# =========================================================
|
||||
|
||||
Reference in New Issue
Block a user