[IMP]added error message if no lines.
bzr revid: kbh@tinyerp.com-20120613065930-6wyjkh4yb1tt7y7p
This commit is contained in:
parent
bd053e72bb
commit
13ce1a7d1a
|
@ -159,7 +159,11 @@ class payroll_advice(osv.osv):
|
|||
self.write(cr, uid, ids, {'number':number}, context=context)
|
||||
|
||||
def confirm_sheet(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
|
||||
for advice in self.browse(cr, uid, ids, context=context):
|
||||
if not advice.line_ids:
|
||||
raise osv.except_osv(_('No Payment Advice Lines !'), _('Please create some advice lines.'))
|
||||
else:
|
||||
return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
|
||||
|
||||
def set_to_draft(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state':'draft'}, context=context)
|
||||
|
|
Loading…
Reference in New Issue