Skip to content
Snippets Groups Projects
Commit c9209664 authored by Florent de Labarre's avatar Florent de Labarre
Browse files

[FIX] account,pos,stock_account: time to unlink account.move


On large database this can take 700 ms per moves. After a few ms.

closes odoo/odoo#97000

Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
Co-authored-by: default avatarLaurent Smet <las@openerp.com>
parent 075323b1
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ class AccountFullReconcile(models.Model):
name = fields.Char(string='Number', required=True, copy=False, default=lambda self: self.env['ir.sequence'].next_by_code('account.reconcile'))
partial_reconcile_ids = fields.One2many('account.partial.reconcile', 'full_reconcile_id', string='Reconciliation Parts')
reconciled_line_ids = fields.One2many('account.move.line', 'full_reconcile_id', string='Matched Journal Items')
exchange_move_id = fields.Many2one('account.move')
exchange_move_id = fields.Many2one('account.move', index=True)
def unlink(self):
""" When removing a full reconciliation, we need to revert the eventual journal entries we created to book the
......
......@@ -28,7 +28,7 @@ class StockValuationLayer(models.Model):
stock_valuation_layer_id = fields.Many2one('stock.valuation.layer', 'Linked To', readonly=True, check_company=True)
stock_valuation_layer_ids = fields.One2many('stock.valuation.layer', 'stock_valuation_layer_id')
stock_move_id = fields.Many2one('stock.move', 'Stock Move', readonly=True, check_company=True, index=True)
account_move_id = fields.Many2one('account.move', 'Journal Entry', readonly=True, check_company=True)
account_move_id = fields.Many2one('account.move', 'Journal Entry', readonly=True, check_company=True, index=True)
def init(self):
tools.create_index(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment