if total != 0:
res = {
- 'amount':total
+ 'amount':total,
+ 'state':voucher.state
}
self.write(dbcr, uid, ids, res)
else:
raise osv.except_osv(_('Invalid amount !'), _('You can not create Pro-Forma voucher with Total amount <= 0 !'))
return True
-
+
+ def write(self, cr, uid, ids, vals, context={}):
+ res = super(account_voucher, self).write(cr, uid, ids, vals, context)
+
+ if not 'state' in vals.keys():
+ self.open_voucher(cr, uid, ids, context)
+
+ return res
+
def voucher_recheck(self, cr, uid, ids, context={}):
- self.open_voucher(cr, uid, ids, context)
+ #self.open_voucher(cr, uid, ids, context)
self.write(cr, uid, ids, {'state':'recheck'}, context)
return True
def proforma_voucher(self, cr, uid, ids, context={}):
+ #self.open_voucher(cr, uid, ids, context)
self.action_move_line_create(cr, uid, ids)
self.write(cr, uid, ids, {'state':'posted'})
return True