Commits

Korbinian Preisler  committed 55b753e

either code or iban is required on bank account

  • Participants
  • Parent commits 779cc6a

Comments (0)

Files changed (1)

     _description = __doc__
     _rec_name = 'code'
 
-    code = fields.Char('Account Number', help='National Standard Code')
-    iban = fields.Char('IBAN')
+    code = fields.Char('Account Number', help='National Standard Code',
+            states={
+                'required': Not(Bool(Eval('iban')))
+                }, depends=['iban'])
+    iban = fields.Char('IBAN',
+            states={
+                'required': Not(Bool(Eval('code')))
+                }, depends=['code'])
     bank = fields.Many2One('bank.bank', 'Bank', required=True,
             on_change=['bank'], context={'is_bank': True})
     bank_code = fields.Function('get_bank_code', type='char',