[IMP] Fixes lp:1223834 in case of insert. Batch updates remains error prone. It would be safer to call the update method from the orm for records updating 'complex' fields.

A new completion rule based on the bank account number is also provided by the proposal.

About modules dependencies. The module 'account_statement_base_import' depends of 'account_statement_base_completion' but the file statement.py of 'account_statement_base_completion' at line 513 call the method _update_line defined in 'account_statement_base_import'. Since the 'AccountStatementLine' is defined in both addons, I've the feeling that we can merge the two overrides in 'account_statement_base_completion'.
This commit is contained in:
Laurent Mignon (Acsone)
2013-10-16 10:58:12 +02:00
committed by Joel Grand-Guillaume
10 changed files with 379 additions and 51 deletions

View File

@@ -571,7 +571,11 @@ class AccountBankSatementLine(Model):
if context is None:
context = {}
date = context.get('date')
periods = self.pool.get('account.period').find(cr, uid, dt=date)
try:
periods = self.pool.get('account.period').find(cr, uid, dt=date)
except osv.except_osv:
# if no period defined, we are certainly at installation time
return False
return periods and periods[0] or False
def _get_default_account(self, cr, uid, context=None):