[7.0] account_statement_base_import: default account_id to false (mp:197755) breaks import of line without account_id
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Banking Addons |
Fix Released
|
High
|
Laurent Mignon (Acsone) |
Bug Description
For performance reasons, the creation of lines in the account_
The problem with the mp:197755 (https:/
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_
Related branches
- Joël Grand-Guillaume @ camptocamp: Approve (code review + test)
- Yannick Vaucher @ Camptocamp: Approve (code review, no test)
- Guewen Baconnier @ Camptocamp: Approve (code review)
-
Diff: 185 lines (+137/-11)4 files modifiedaccount_statement_base_import/data/statement.csv (+1/-1)
account_statement_base_import/statement.py (+4/-10)
account_statement_base_import/tests/__init__.py (+27/-0)
account_statement_base_import/tests/test_base_import.py (+105/-0)
- Laurent Mignon (Acsone) (community): Approve (code veview, no tests)
- Joël Grand-Guillaume @ camptocamp: Approve (code review, no tests)
- Banking Addons Core Editors: Pending requested
-
Diff: 108 lines (+25/-17)2 files modifiedaccount_statement_base_completion/statement.py (+23/-0)
account_statement_base_import/statement.py (+2/-17)
summary: |
- default account_id to false (mp:197755) breaks import of line without - account_id + [7.0] account_statement_base_import: default account_id to false + (mp:197755) breaks import of line without account_id |
description: | updated |
description: | updated |
description: | updated |
Changed in banking-addons: | |
assignee: | nobody → Laurent Mignon (Acsone) (lmi) |
Changed in banking-addons: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in banking-addons: | |
status: | Confirmed → Fix Committed |
Changed in banking-addons: | |
status: | Fix Committed → Confirmed |
Changed in banking-addons: | |
status: | Confirmed → Fix Released |
Hi,
I re-open the bug cause we still have trouble on this one. Making the import of a file manually still raise the error mention above.
I see here 2 remaining troubles:
* The _insert_lines and _update_line method in *_base_ completion/ statement. py should call the symbol_f method to prorperly initiate the default value (e.g. integer default null value should be Null not False).
* The mechanism that allow to have a null account_id in bank statement line should be part of *_base_completion, not *_base_import.
My args:
- account_ bank_statement_ ext should keep the original behavior where account_id is mandatory
- account_ statement_ completion provide a way of completing a statement line from only partial info, it is his responsability to provide an account_id if none has been provided. So IMO this is in this module that we should allow not to provide an account_id for a line. But then, required one for the statement confirmation.
- account_ statement_ base_import which depends on account_ statement_ completion will benefit from that
Regards,