[FIX] stock_account: performance of unlinking account_move_line

The index is needed to be able to unlink/delete lines because of the
check of foreign keys.

closes odoo/odoo#149417

Signed-off-by: Cedric Snauwaert <csn@odoo.com>
This commit is contained in:
william-andre
2024-01-15 19:58:57 +00:00
parent d10d0ca242
commit 6b70028eac
+3 -1
View File
@@ -236,7 +236,9 @@ class AccountMoveLine(models.Model):
stock_valuation_layer_ids = fields.One2many('stock.valuation.layer', 'account_move_line_id', string='Stock Valuation Layer')
cogs_origin_id = fields.Many2one( # technical field used to keep track in the originating line of the anglo-saxon lines
"account.move.line", copy=False,
comodel_name="account.move.line",
copy=False,
index="btree_not_null",
)
def _compute_account_id(self):