Browse Source

Merge pull request #396 from leemannd/10-fix_base_partner_sequence

fix sequence increase on 'partner.write()'
pull/360/merge
Pedro M. Baeza 8 years ago
committed by GitHub
parent
commit
f97489ac07
  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