Browse Source

[FIX] partner_firstname: Change _id by id in the method copy_data to avoid problem with the new API

[FIX] partner_firstname : Remove the value checks in tests. With Odoo v8, the value checks in tests raise a Warning "2015-02-05 08:59:44,867 4590 WARNING 00846-develop-v8-9743ea-all openerp.modules.module: Found deprecated fast_suite or checks attribute in test module openerp.addons.partner_firstname.tests. These have no effect in or after version 8.0."
With Runbot, we cannot have any Warning.
14.0
Sylvain Van Hoof 10 years ago
committed by Luis Torres
parent
commit
85f20b7e78
  1. 6
      partner_firstname/partner.py
  2. 4
      partner_firstname/tests/__init__.py

6
partner_firstname/partner.py

@ -91,7 +91,7 @@ class ResPartner(orm.Model):
return self.write(cursor, uid, partner_id, vals, context=context) return self.write(cursor, uid, partner_id, vals, context=context)
def copy_data(self, cr, uid, _id, default=None, context=None):
def copy_data(self, cr, uid, id, default=None, context=None):
""" """
Avoid to replicate the firstname into the name when duplicating a Avoid to replicate the firstname into the name when duplicating a
partner partner
@ -101,13 +101,13 @@ class ResPartner(orm.Model):
default = default.copy() default = default.copy()
default['lastname'] = ( default['lastname'] = (
_('%s (copy)') % self.read( _('%s (copy)') % self.read(
cr, uid, [_id], ['lastname'], context=context
cr, uid, [id], ['lastname'], context=context
)[0]['lastname'] )[0]['lastname']
) )
if default.get('name'): if default.get('name'):
del(default['name']) del(default['name'])
return super(ResPartner, self).copy_data( return super(ResPartner, self).copy_data(
cr, uid, _id, default, context=context)
cr, uid, id, default, context=context)
def create(self, cursor, uid, vals, context=None): def create(self, cursor, uid, vals, context=None):
""" """

4
partner_firstname/tests/__init__.py

@ -29,7 +29,3 @@
############################################################################## ##############################################################################
from . import test_partner_firstname from . import test_partner_firstname
checks = [
test_partner_firstname
]
Loading…
Cancel
Save