Browse Source

fix sequence increase on 'partner.write()'

14.0
Denis Leemann 8 years ago
committed by mostafaala2
parent
commit
9f5bb90908
  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 @api.multi
def write(self, vals): def write(self, vals):
for partner in self: 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'].\ vals['ref'] = self.env['ir.sequence'].\
next_by_code('res.partner') next_by_code('res.partner')
super(ResPartner, partner).write(vals) super(ResPartner, partner).write(vals)
return True return True

Loading…
Cancel
Save