[UPD] Change definition 0f recurrent_sequence_type and type fields in account_banking_sepa_direct_debit module

This commit is contained in:
EL HADJI DEM
2014-10-08 12:17:32 -04:00
parent 48e9de2bc1
commit e574d232ef

View File

@@ -118,18 +118,32 @@ class sdd_mandate(orm.Model):
} }
} }
def _get_type(self, cr, uid, context=None):
return [
('recurrent', _('Recurrent')),
('oneoff', _('One-Off')),
]
def _get_recurrent_sequence_type(self, cr, uid, context=None):
return [
('first', _('First')),
('recurring', _('Recurring')),
('final', _('Final')),
]
_columns = { _columns = {
'type': fields.selection([ 'type': fields.selection(
('recurrent', 'Recurrent'), lambda self, *a, **kw: self._get_type(*a, **kw),
('oneoff', 'One-Off'), string='Type of Mandate',
], 'Type of Mandate', required=True, track_visibility='always'), required=True, track_visibility='always'
'recurrent_sequence_type': fields.selection([ ),
('first', 'First'), 'recurrent_sequence_type': fields.selection(
('recurring', 'Recurring'), lambda self, *a, **kw: self._get_recurrent_sequence_type(*a, **kw),
('final', 'Final'), string='Sequence Type for Next Debit',
], 'Sequence Type for Next Debit', track_visibility='onchange', track_visibility='onchange',
help="This field is only used for Recurrent mandates, not for " help="This field is only used for Recurrent mandates, not for "
"One-Off mandates."), "One-Off mandates."
),
'sepa_migrated': fields.boolean( 'sepa_migrated': fields.boolean(
'Migrated to SEPA', track_visibility='onchange', 'Migrated to SEPA', track_visibility='onchange',
help="If this field is not active, the mandate section of the " help="If this field is not active, the mandate section of the "