~nicolariolini/openobject-italia/adding_riba_v7_fix_richiesto

« back to all changes in this revision

Viewing changes to l10n_it_fiscalcode/wizard/compute_fc.py

  • Committer: Lorenzo Battistini
  • Date: 2013-03-12 08:01:48 UTC
  • mfrom: (205.1.1 italia-addons-7.0)
  • Revision ID: lorenzo.battistini@agilebg.com-20130312080148-mbqzufb70imta4d9
[FIX] error when cadaster_code is missing

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
        form_obj = self.browse(cr, uid, ids, context)
117
117
        for fields in form_obj:
118
118
            if not fields.fiscalcode_surname or not fields.fiscalcode_firstname or not fields.birth_date or not fields.birth_city or not fields.sex:
119
 
                raise osv.except_osv('Error', 'One or more fields are missing')
 
119
                raise osv.except_osv(_('Error'), _('One or more fields are missing'))
 
120
            if not fields.birth_city.cadaster_code:
 
121
                raise osv.except_osv(_('Error'), _('Cataster code is missing'))
120
122
            birth_date = datetime.datetime.strptime(fields.birth_date, "%Y-%m-%d")
121
123
            CF = self._codicefiscale(fields.fiscalcode_surname, fields.fiscalcode_firstname, str(birth_date.day),
122
124
                str(birth_date.month), str(birth_date.year), fields.sex,