Some code only applies for France

Bug #930994 reported by Kellogs on 2012-02-12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
New report intrastat

Bug Description


Reading the source code, some features only apply to France. Examples :

1) checking of departments (from 1 to 99 in France)
Really, there is no interest in checking this.
People will not make any error.
Also, this only applies for France:

    def real_department_check(self, dpt_list):
        for dpt in dpt_list:
            if not dpt:
            if len(dpt) <> 2: # '1' is not accepted -> must be '01'
                raise osv.except_osv(_('Error :'), _("The department code must be 2 caracters long."))
            if dpt in ['2A', '2B', '99']: # 99 = Monaco, cf page 24 du BOD n°6883 du 06/01/2011
            if not dpt.isdigit():
                raise osv.except_osv(_('Error :'), _("The department code must be a number or have the value '2A' or '2B' for Corsica."))
            if int(dpt) < 1 or int(dpt) > 95:
                raise osv.except_osv(_('Error :'), _("The department code must be between 01 and 95 or have the value '2A' or '2B' for Corsica or '99' for Monaco."))
        return True

    def _check_default_intrastat_department(self, cr, uid, ids):
        dpt_list = []
        for dpt_to_check in, uid, ids, ['default_intrastat_department']):
        return self.real_department_check(dpt_list)

    def _check_statistical_pricelist_id(self, cr, uid, ids):
        for company_to_check in self.browse(cr, uid, ids):
            if company_to_check.statistical_pricelist_id:
                if <> 'EUR':
                    raise osv.except_osv(_('Error :'), _("The pricelist for statistical value must be in EUR currency."))
        return True

2) Siret is French term
Use "EDORI" instead.
EDORI is the European company number.
In France, it equals to SIRET.

    _constraints = [
            (_5digits, "The 'SIRET complement' should have exactly 5 digits.", ['siret_complement']),
            (_check_default_intrastat_department, "Error msg is in raise", ['default_intrastat_department']),
            (_check_statistical_pricelist_id, "Error msg in raise", ['statistical_pricelist_id']),

3) Transportation is still in French
        'default_intrastat_transport': fields.selection([
            (1, 'Transport maritime'),
            (2, 'Transport par chemin de fer'),
            (3, 'Transport par route'),
            (4, 'Transport par air'),
            (5, 'Envois postaux'),
            (7, 'Installations de transport fixes'),
            (8, 'Transport par navigation intérieure'),
            (9, 'Propulsion propre'),
            ], 'Default type of transport',

Kind regards,

Alexis de Lattre (alexis-via) wrote :

Yes, the code that you quote only apply to France. That's why it is located in the module l10n_fr_intrastat_product ! The "l10n_fr" prefix MEANS that it only applies to France !

Changed in new-report-intrastat:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers