← Back to team overview

credativ team mailing list archive

[Merge] lp:~credativ/openobject-server/6.1-fix-productexport into lp:openobject-server/6.1

 

Craig Gowing (credativ) has proposed merging lp:~credativ/openobject-server/6.1-fix-productexport into lp:openobject-server/6.1.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1096172 in OpenERP Server: "export_data on product_product : too external_ids(ir.model.data) generated?"
  https://bugs.launchpad.net/openobject-server/+bug/1096172

For more details, see:
https://code.launchpad.net/~credativ/openobject-server/6.1-fix-productexport/+merge/145817

Fixes naming of new ir.model.data records on export for many2one fields.
-- 
https://code.launchpad.net/~credativ/openobject-server/6.1-fix-productexport/+merge/145817
Your team credativ is subscribed to branch lp:~credativ/openobject-server/6.1-fix-productexport.
=== modified file 'openerp/osv/orm.py'
--- openerp/osv/orm.py	2012-09-24 14:00:07 +0000
+++ openerp/osv/orm.py	2013-01-31 11:11:30 +0000
@@ -1096,13 +1096,13 @@
             else:
                 postfix = 0
                 while True:
-                    n = self._table+'_'+str(r['id']) + (postfix and ('_'+str(postfix)) or '' )
+                    n = r._table._table+'_'+str(r['id']) + (postfix and ('_'+str(postfix)) or '' )
                     if not model_data.search(cr, uid, [('name', '=', n)]):
                         break
                     postfix += 1
                 model_data.create(cr, SUPERUSER_ID, {
                     'name': n,
-                    'model': self._name,
+                    'model': r._name,
                     'res_id': r['id'],
                     'module': '__export__',
                 })