** Changed in: banking-addons
Status: Confirmed => Fix Released
--
You received this bug notification because you are a member of Banking
Addons Core Editors, which is subscribed to Banking Addons.
https://bugs.launchpad.net/bugs/1313689
Title:
[7.0] account_statement_base_import: default account_id to false
(mp:197755) breaks import of line without account_id
Status in OpenERP Banking Addons:
Fix Released
Bug description:
For performance reasons, the creation of lines in the
account_statement_base_import is done by bypassing the ORM . (method
_insert_lines defined in
account_base_completion.statement.AccountStatementLine). The method
_insert_lines must be called with a list of values (as dict) used to
build a plain batch SQL insert 'INSERT INTO
account_bank_statement_line (%s) VALUES (%s)'
The problem with the mp:197755 (https://code.launchpad.net/~akretion-
team/banking-addons/bank-statement-reconcile-70-account-not-
mandatory/+merge/197755) is that if no value is provided for the
account_id by the parser, the default value is added by the call to
"statement_line_obj._add_missing_default_values(cr, uid, values,
context)" at line 130 in account_statement_base_import.statement.py.
(values = [.... {..., 'account_id':False, ..} ... ] )
As these values are used to build a plain SQL insert (" Insert into ....
(..., account_id) values ((...,False )) the method fails with the exception:
except_osv:
(u'Statement import error', u'The statement cannot be created: Error:
except_osv\nDescription: (u\'ORM bypass error\', \'ERROR: column "account_id"
is of type integer but expression is of type boolean\\nLINE 1: ...note,
period_id, ref, statement_id, type) VALUES (false, \\\'{"...\\n
^\\nHINT: You will need to rewrite
or cast the expression.\\n\')\nTraceback: File
"/home/lmi/projects/openerp/openerp-deldrive-multi-company/addons-banking/account_statement_base_import/statement.py",
line 195, in statement_import\n statement_line_obj._insert_lines(cr, uid,
statement_store, context=context)\n File
"/home/lmi/projects/openerp/openerp-deldrive-multi-company/addons-banking/account_statement_base_completion/statement.py",
line 479, in _insert_lines\n sql_err.pgerror)\n')
To manage notifications about this bug go to:
https://bugs.launchpad.net/banking-addons/+bug/1313689/+subscriptions
--
Mailing list: https://launchpad.net/~banking-addons-team
Post to : [email protected]
Unsubscribe : https://launchpad.net/~banking-addons-team
More help : https://help.launchpad.net/ListHelp