Skip to content
Snippets Groups Projects
Commit 8b72a43d authored by Marco Folco's avatar Marco Folco
Browse files

Merge branch 'SOF-46-Remodelar_OS_prestaciones' into '12.0-stage'

[MOD] health insurance and plan

See merge request !37
parents 58e0cbc6 bb8d5e86
No related branches found
No related tags found
1 merge request!37[MOD] health insurance and plan
......@@ -65,6 +65,12 @@ class Partner(models.Model):
def _get_default_partner_type(self):
return 'sofsa_user'
@api.constrains('vat', 'document_type_id')
def check_vat_duplicated(self):
for partner in self:
if partner.partner_type != 'plan':
super(Partner, partner).check_vat_duplicated()
@api.model
def create(self, vals):
res = super(Partner, self).create(vals)
......
......@@ -48,6 +48,8 @@ class HealthInsurancePlan(models.Model):
'ref': self.code,
'insurance_plan_id': self.id,
'partner_type': 'plan',
'document_type_id': self.insurance_id.document_type_id.id if self.insurance_id.document_type_id else False,
'vat': self.insurance_id.vat,
}
return vals
......
......@@ -21,6 +21,8 @@
</div>
<group>
<group>
<field name="document_type_id"/>
<field name="vat"/>
<field name="can_import_roll"/>
<field name="requires_plan"/>
</group>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment