Browse Source

fix a bug in copying an object with a ref

pull/2/head
Thomas Rehn 11 years ago
parent
commit
587cad2e99
  1. 3
      base_partner_sequence/partner.py

3
base_partner_sequence/partner.py

@ -39,8 +39,7 @@ class ResPartner(orm.Model):
def copy(self, cr, uid, id, default=None, context=None): def copy(self, cr, uid, id, default=None, context=None):
default = default or {} default = default or {}
if not default.get('ref') and self._needsRef(cr, uid, id=id,
context=context):
if self._needsRef(cr, uid, id=id, context=context):
default['ref'] = self.pool.get('ir.sequence')\ default['ref'] = self.pool.get('ir.sequence')\
.next_by_code(cr, uid, 'res.partner', .next_by_code(cr, uid, 'res.partner',
context=context) context=context)

Loading…
Cancel
Save