summaryrefslogtreecommitdiff
path: root/addons/plugin/plugin_handler.py
diff options
context:
space:
mode:
authorTurkesh Patel (Open ERP) <tpa@tinyerp.com>2012-07-02 17:46:46 +0530
committerTurkesh Patel (Open ERP) <tpa@tinyerp.com>2012-07-02 17:46:46 +0530
commitc4476c4ad3d5953c5677127aa542f1ce61816f53 (patch)
tree4cac93254267c83a820d63ae6eabc3acf452e3d8 /addons/plugin/plugin_handler.py
parent9c9141cc65892d2fc28f0b26bbd2acd40fff69c4 (diff)
[FIX] plugin:when create the partner from the thunderbird at that time create partner two times.
bzr revid: tpa@tinyerp.com-20120702121646-bzom7r2buerwj5n7
Diffstat (limited to 'addons/plugin/plugin_handler.py')
-rw-r--r--addons/plugin/plugin_handler.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py
index 700b9648237..2de179f6744 100644
--- a/addons/plugin/plugin_handler.py
+++ b/addons/plugin/plugin_handler.py
@@ -126,9 +126,10 @@ class plugin_handler(osv.osv_memory):
partner_obj = self.pool.get('res.partner')
dictcreate = dict(data)
if partner_id == 0:
- partner_id = partner_obj.create(cr, uid, {'name':dictcreate.get('name')})
- dictcreate['partner_id'] = partner_id
- self.pool.get('res.partner').create(cr, uid, dictcreate)
+ partner_id = partner_obj.create(cr, uid, dictcreate)
+ else:
+ dictcreate['parent_id'] = partner_id
+ partner_obj.create(cr, uid, dictcreate)
url = self._make_url(cr, uid, partner_id, 'res.partner')
return ('res.partner', partner_id, url)