Wizard BVR
bzr revid: pinky-c679abd51c8c8bcf8f1c30455b43f703abbe0e1b
This commit is contained in:
parent
4bfeef46b5
commit
00cfe18c32
|
@ -58,12 +58,13 @@ check_fields = {
|
||||||
|
|
||||||
def _check(self, cr, uid, data, context):
|
def _check(self, cr, uid, data, context):
|
||||||
for invoice in pooler.get_pool(cr.dbname).get('account.invoice').browse(cr, uid, data['ids'], context):
|
for invoice in pooler.get_pool(cr.dbname).get('account.invoice').browse(cr, uid, data['ids'], context):
|
||||||
if not invoice.bank_id:
|
bank = pooler.get_pool(cr.dbname).get('res.partner.bank').browse(cr, uid, data['form']['bank'], context)
|
||||||
raise wizard.except_wizard('UserError','The invoice "%s" has no bank associated !' % (invoice.number,))
|
if not data['form']['bank']:
|
||||||
if not re.compile('[0-9][0-9]?\-[0-9]+-[0-9]+').match(invoice.bank_id.bvr_number or ''):
|
raise wizard.except_wizard('UserError','No bank specified !')
|
||||||
raise wizard.except_wizard('UserError','Your bank BVR number should be of the form 0X-XXX-X !\nSee invoice "%s".' % (invoice.number,))
|
if not re.compile('[0-9][0-9]?\-[0-9]+-[0-9]+').match(bank.bvr_number or ''):
|
||||||
if invoice.bank_id.bank_code and not re.compile('^[0-9]+$').match(invoice.bank_id.bank_code):
|
raise wizard.except_wizard('UserError','Your bank BVR number should be of the form 0X-XXX-X !')
|
||||||
raise wizard.except_wizard('UserError','Your bank code should be a number !\nSee invoice "%s".' % (invoice.number,))
|
if bank.bank_code and not re.compile('^[0-9]+$').match(bank.bank_code):
|
||||||
|
raise wizard.except_wizard('UserError','Your bank code must be a number !')
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
class wizard_report(wizard.interface):
|
class wizard_report(wizard.interface):
|
||||||
|
|
Loading…
Reference in New Issue