[FIX] account: name of bank statement is not required
authorMartin Trigaux <mat@openerp.com>
Tue, 26 Aug 2014 12:45:00 +0000 (14:45 +0200)
committerMartin Trigaux <mat@openerp.com>
Tue, 26 Aug 2014 14:33:58 +0000 (16:33 +0200)
At the confirmation of a bank statement, the name may not be set (e.g. generated by point of sale). This field is not requred so make a fallack on the statement line (which is required).

addons/account/account_bank_statement.py

index cbbcd49..1f4d6a9 100644 (file)
@@ -735,7 +735,7 @@ class account_bank_statement_line(osv.osv):
                     raise osv.except_osv(_('Error!'), _('A selected move line was already reconciled.'))
 
         # Create the move
-        move_name = st_line.statement_id.name + "/" + str(st_line.sequence)
+        move_name = (st_line.statement_id.name or st_line.name) + "/" + str(st_line.sequence)
         move_vals = bs_obj._prepare_move(cr, uid, st_line, move_name, context=context)
         move_id = am_obj.create(cr, uid, move_vals, context=context)