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

Merge branch 'SOF-38-Modificacion_formulario_prestaciones' into '12.0-stage'

[MOD] health_insurance

See merge request !31
parents eda92f36 a379347f
No related branches found
No related tags found
1 merge request!31[MOD] health_insurance
......@@ -52,13 +52,11 @@ class Partner(models.Model):
@api.model
def create(self, vals):
if 'partner_type' in vals:
if vals['partner_type'] == 'insurance':
vals['ref'] = str(self.env['ir.sequence'].next_by_code('res.partner.insurance'))
if 'default_partner_type' in self.env.context and not vals['ref']:
if self.env.context['default_partner_type'] == 'insurance':
vals['ref'] = str(self.env['ir.sequence'].next_by_code('res.partner.insurance'))
return super(Partner, self).create(vals)
res = super(Partner, self).create(vals)
if not res.ref:
if res.partner_type == 'insurance':
res.ref = str(self.env['ir.sequence'].next_by_code('res.partner.insurance'))
return res
@api.multi
def name_get(self):
......
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