[cgscop #226] gestion CP des DOM-TOM

parent e02e1c6c
......@@ -35,6 +35,7 @@
"views/scop_period_views.xml",
"views/scop_federation_activity.xml",
"datas/union_regionale_data.xml",
"datas/res_country_state.xml",
"datas/res_partner_certification_data.xml",
"datas/res_partner_company_type_data.xml",
"datas/res_partner_cooperative_form_data.xml",
......
<?xml version="1.0"?>
<odoo>
<data noupdate="1">
<record id="domtom" model="res.country.state">
<field name="name">DOM-TOM</field>
<field name="code">DT</field>
<field name="country_id" eval="75"/>
</record>
</data>
</odoo>
......@@ -657,11 +657,14 @@ class ScopPartner(models.Model):
+ company.siret[6:9] + " "
+ company.siret[9:])
@api.depends('zip')
@api.depends('zip', 'state_id')
def _compute_num_departement(self):
for company in self:
if company.zip:
company.zip_departement = company.zip[:2]
if company.state_id == self.env.ref('cgscop_partner.domtom'):
company.zip_departement = company.zip[:3]
else:
company.zip_departement = company.zip[:2]
@api.depends('zip')
def _compute_region(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment