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

Merge branch 'minor_changes' into '12.0-stage'

Minor changes

See merge request !24
parents 9c3409fd f145aaab
No related branches found
No related tags found
1 merge request!24Minor changes
......@@ -51,8 +51,9 @@ class Partner(models.Model):
@api.model
def create(self, vals):
if not vals.get('ref') and self.env.context.get('default_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 'ref' in vals:
if not vals['ref'] and 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)
@api.multi
......
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