diff --git a/addons/account/models/account_full_reconcile.py b/addons/account/models/account_full_reconcile.py index 9516045ffba..4bfa8e38a05 100644 --- a/addons/account/models/account_full_reconcile.py +++ b/addons/account/models/account_full_reconcile.py @@ -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="btree_not_null") def unlink(self): """ When removing a full reconciliation, we need to revert the eventual journal entries we created to book the diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 61c903d36e8..0e38a5da4d2 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -265,7 +265,7 @@ class PosOrder(models.Model): [('draft', 'New'), ('cancel', 'Cancelled'), ('paid', 'Paid'), ('done', 'Posted'), ('invoiced', 'Invoiced')], 'Status', readonly=True, copy=False, default='draft') - account_move = fields.Many2one('account.move', string='Invoice', readonly=True, copy=False, index=True) + account_move = fields.Many2one('account.move', string='Invoice', readonly=True, copy=False, index="btree_not_null") picking_ids = fields.One2many('stock.picking', 'pos_order_id') picking_count = fields.Integer(compute='_compute_picking_count') failed_pickings = fields.Boolean(compute='_compute_picking_count') diff --git a/addons/stock_account/models/stock_valuation_layer.py b/addons/stock_account/models/stock_valuation_layer.py index 9b62a24d00a..7191c2fcb10 100644 --- a/addons/stock_account/models/stock_valuation_layer.py +++ b/addons/stock_account/models/stock_valuation_layer.py @@ -28,8 +28,8 @@ 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_line_id = fields.Many2one('account.move.line', 'Invoice Line', readonly=True, check_company=True, index=True) + account_move_id = fields.Many2one('account.move', 'Journal Entry', readonly=True, check_company=True, index="btree_not_null") + account_move_line_id = fields.Many2one('account.move.line', 'Invoice Line', readonly=True, check_company=True, index="btree_not_null") reference = fields.Char(related='stock_move_id.reference') price_diff_value = fields.Float('Invoice value correction with invoice currency')