Browse Source

fix sequence increase on 'partner.write()'

pull/531/head
Denis Leemann 8 years ago
committed by Pedro M. Baeza
parent
commit
fdef315a95
  1. 4
      base_partner_sequence/models/partner.py

4
base_partner_sequence/models/partner.py

@ -47,9 +47,11 @@ class ResPartner(models.Model):
@api.multi
def write(self, vals):
for partner in self:
if not vals.get('ref') and partner._needsRef(vals):
if not vals.get('ref') and partner._needsRef(vals) and \
not partner.ref:
vals['ref'] = self.env['ir.sequence'].\
next_by_code('res.partner')
super(ResPartner, partner).write(vals)
return True

Loading…
Cancel
Save