thaond / magento-openerp-smile-synchro

Automatically exported from code.google.com/p/magento-openerp-smile-synchro
0 stars 0 forks source link

import sales orders #38

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi

I am on latest trunk revisions.
I use  Open ERP 5.0.3  (stable 5:  
http://sisalp.net/pages/documentation.html#menu ) and  magento 1.2.1.

I have this error when I try to synchronize openerp and magento for only import
sales orders...

Traceback (most recent call last):
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/netsvc.py",
line 231, in dispatch
   result = LocalService(service_name)(method, *params)
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/netsvc.py",
line 74, in __call__
   return getattr(self, method)(*params)
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/service/web_service
s.py",
line 552, in execute
   return self._execute(db, uid, wiz_id, datas, action, context)
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/service/web_service
s.py",
line 532, in _execute
   return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/wizard/__init__.py"
,
line 178, in execute
   res = self.execute_cr(cr, uid, data, state, context)
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/wizard/__init__.py"
,
line 74, in execute_cr
   action_res = action(self, cr, uid, data, context)
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/addons/magento_open
erp_synchro.zip/magento_openerp_synchro/wizard/magento_so_import.py",
line 129, in _do_import
   'magento_id': so['customer']['customer_id'],
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/osv/orm.py",
line 2446, in create
   cr.execute('insert into "'+self._table+'" (id'+upd0+") values
("+str(id_new)+upd1+')', tuple(upd2))
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/sql_db.py",
line 76, in wrapper
   return f(self, *args, **kwargs)
 File
"/home/sisalpuser/openerp/stable5/openerp-server-5.0.0-3/bin/sql_db.py",
line 118, in execute
   res = self._obj.execute(query, params)
IntegrityError: duplicate key value violates unique constraint
"res_partner_name_uniq"

Original issue reported on code.google.com by broly...@gmail.com on 21 Mar 2009 at 11:12

GoogleCodeExporter commented 8 years ago
I think it's the same problem for  oscommerce...
But I don't know what is the attribute that I must change for magento...
Please help. 

Changed file
/tinyerp/bin/addons/oscommerce_interface/wizard/wizard_esale_oscom_import_sos.py
 on
line 28:
ORIG : search_country = 
country_pooler.search(cr,uid,[('code','=',data['code'])])
NEW : search_country = country_pooler.search(cr,uid,[('name','=',data['name'])])
REASON : Without this change I could not import orders as I got an error that 
the
country already existed (ERROR: duplicate key violates unique constraint
"res_country_name_uniq") 
http://openerp.com/forum/topic5714.html?highlight=server%20addons%20terp

Original comment by broly...@gmail.com on 22 Mar 2009 at 4:45

GoogleCodeExporter commented 8 years ago
I think it's a problem with the constraint but I don't know how to delete the
constraint...
Please help.

When you will install this module, Open ERP will automatically import the 
partners
and then the address and recreate efficiently the link between the two records. 
When
installing a module, Open ERP will test and apply the constraints for 
consistency of
the data. So, when you install this module, it may crash, for example, because 
you
may have different partners with the same name in the system. (due to the uniq
constraint on the name of a partner). So, you have to clean your data before
importing them.

If you plan to upload thousands of records through this technique, you should
consider using the argument ‘-P’ when running the server.

    openerp_server.py -P status.pickle –init=data_yourcompany

This method provides a faster importation of the data and, if it crashes in the
middle of the import, it will continue at the same line after rerunning the 
server.
This may preserves hours of testing when importing big files.

http://doc.openerp.com/developer/12_DataMigration/index.html

Original comment by broly...@gmail.com on 23 Mar 2009 at 3:11

GoogleCodeExporter commented 8 years ago
ok it's good!
import sales orders works!
I have deleted the constraint res_country_name_uniq in pgadmin3.

Original comment by broly...@gmail.com on 3 Apr 2009 at 8:05