[FIX] account: bank statement line needaction domain

Before 8.0, the field journal_entry_id did not exist.

For database coming from older release, like 7.0, this field is not filled in during the migration, because this is not possible.
Set the needaction to depend only on the journal_entry_id will have as effect to have every bank statement line entered when the database was under 7.0 to match the domain, while the needaction is made to display the number of records that need an action.

Besides, even in 8.0, this is possible that a line has not the journal_entry_id set, while not needing any actions (see 2bb38ca89d)
This commit is contained in:
Denis Ledoux 2015-01-15 16:49:42 +01:00
parent 2bb38ca89d
commit e07309d809
1 changed files with 1 additions and 1 deletions

View File

@ -825,7 +825,7 @@ class account_bank_statement_line(osv.osv):
# Unfortunately, that spawns a "no access rights" error ; it shouldn't.
def _needaction_domain_get(self, cr, uid, context=None):
user = self.pool.get("res.users").browse(cr, uid, uid)
return ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id]), ('journal_entry_id', '=', False)]
return ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id]), ('journal_entry_id', '=', False), ('account_id', '=', False)]
_order = "statement_id desc, sequence"
_name = "account.bank.statement.line"