[IMP] account: Add auto_join on account move line

As the number of journal entries can grow quickly, domains such as
[('move_id.state', 'in', ['draft'])] will degrade very quickly.
Fixes #5573
This commit is contained in:
Laetitia Gangloff 2015-03-04 10:52:45 +01:00 committed by Martin Trigaux
parent a81a7513b2
commit f18304c0cd
1 changed files with 1 additions and 1 deletions

View File

@ -439,7 +439,7 @@ class account_move_line(osv.osv):
'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')),
'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')),
'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade", domain=[('type','<>','view'), ('type', '<>', 'closed')], select=2),
'move_id': fields.many2one('account.move', 'Journal Entry', ondelete="cascade", help="The move of this entry line.", select=2, required=True),
'move_id': fields.many2one('account.move', 'Journal Entry', ondelete="cascade", help="The move of this entry line.", select=2, required=True, auto_join=True),
'narration': fields.related('move_id','narration', type='text', relation='account.move', string='Internal Note'),
'ref': fields.related('move_id', 'ref', string='Reference', type='char', size=64, store=True),
'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),