Skip to content

Commit

Permalink
fix sequence increase on 'partner.write()'
Browse files Browse the repository at this point in the history
  • Loading branch information
leemannd authored and jesusVMayor committed Dec 13, 2017
1 parent 0d0c58e commit d7410bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base_partner_sequence/models/partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ def copy(self, default=None):
@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

Expand Down

0 comments on commit d7410bf

Please sign in to comment.