NameError: name 'Array' is not defined

Bug #1016139 reported by Jean-Sébastien SUZANNE
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
Confirmed
Undecided
gekko tek

Bug Description

Hi

During in import from magenta to openerp. One external field, type list and not required, is empty(attachment), the value of the field in resource dict is 'Array'. during the eval the value 'Array' is used like a var.

casted_field = eval(field_value.strip(',')) # field_value = 'Array'

OpenERP Server Error
Client Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/common/http.py", line 180, in dispatch
    response["result"] = method(controller, self, **self.params)
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/controllers/main.py", line 1047, in call_button
    action = self.call_common(req, model, method, args, domain_id, context_id)
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/controllers/main.py", line 991, in call_common
    return self._call_kw(req, model, method, args, {})
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/controllers/main.py", line 1005, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/common/openerplib/main.py", line 250, in proxy
    args, kw)
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/common/http.py", line 611, in send
    raise fault

Server Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/common/http.py", line 592, in send
    result = openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/usr/lib/pymodules/python2.6/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.6/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/pymodules/python2.6/openerp/addons/magentoerpconnect/magerp_core.py", line 226, in sync_products
    res = self._sync_product_storeview(import_cr, uid, external_session, referential.id, ext_product_id, storeview, mapping=mapping, context=ctx)
  File "/usr/lib/pymodules/python2.6/openerp/addons/magentoerpconnect/magerp_core.py", line 177, in _sync_product_storeview
    context=ctx,
  File "/usr/lib/pymodules/python2.6/openerp/addons/base_external_referentials/external_osv.py", line 540, in _record_one_external_resource
    vals = self._transform_one_resource(cr, uid, external_session, 'from_external_to_openerp', resource, mapping=mapping, mapping_id=mapping_id, defaults=defaults,

context=context)
  File "/usr/lib/pymodules/python2.6/openerp/addons/base_external_referentials/external_osv.py", line 1085, in _transform_one_resource
    'ifield': self._transform_field(cr, uid, external_session, convertion_type, field_value, mapping_line, context=context),
  File "/usr/lib/pymodules/python2.6/openerp/addons/base_external_referentials/external_osv.py", line 1174, in _transform_field
    casted_field = eval(field_value.strip(','))
  File "<string>", line 1, in <module>
NameError: name 'Array' is not defined

Revision history for this message
Jean-Sébastien SUZANNE (jssuzanne) wrote :
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

Can you tell which branch of the project you are using, and which mappings you are using?

Thanks.

Changed in magentoerpconnect:
status: New → Incomplete
Revision history for this message
Jean-Sébastien SUZANNE (jssuzanne) wrote : Re: [Bug 1016139] Re: NameError: name 'Array' is not defined
Download full text (4.8 KiB)

I don't know the branch and the revno or tag, because i not make the
install and the module is copy without .bzr
I will get the file and make dif revno by revno to found the good. But i
have not the time this week.

2012/8/1 Alexandre Fayolle @ camptocamp <email address hidden>

> Can you tell which branch of the project you are using, and which
> mappings you are using?
>
> Thanks.
>
> ** Changed in: magentoerpconnect
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1016139
>
> Title:
> NameError: name 'Array' is not defined
>
> Status in Magento OpenERP Connector:
> Incomplete
>
> Bug description:
> Hi
>
> During in import from magenta to openerp. One external field, type
> list and not required, is empty(attachment), the value of the field in
> resource dict is 'Array'. during the eval the value 'Array' is used
> like a var.
>
> casted_field = eval(field_value.strip(',')) # field_value = 'Array'
>
> OpenERP Server Error
> Client Traceback (most recent call last):
> File "/usr/lib/pymodules/python2.6/openerp/addons/web/common/http.py",
> line 180, in dispatch
> response["result"] = method(controller, self, **self.params)
> File
> "/usr/lib/pymodules/python2.6/openerp/addons/web/controllers/main.py", line
> 1047, in call_button
> action = self.call_common(req, model, method, args, domain_id,
> context_id)
> File
> "/usr/lib/pymodules/python2.6/openerp/addons/web/controllers/main.py", line
> 991, in call_common
> return self._call_kw(req, model, method, args, {})
> File
> "/usr/lib/pymodules/python2.6/openerp/addons/web/controllers/main.py", line
> 1005, in _call_kw
> return getattr(req.session.model(model), method)(*args, **kwargs)
> File
> "/usr/lib/pymodules/python2.6/openerp/addons/web/common/openerplib/main.py",
> line 250, in proxy
> args, kw)
> File
> "/usr/lib/pymodules/python2.6/openerp/addons/web/common/openerplib/main.py",
> line 117, in proxy
> result = self.connector.send(self.service_name, method, *args)
> File "/usr/lib/pymodules/python2.6/openerp/addons/web/common/http.py",
> line 611, in send
> raise fault
>
>
> Server Traceback (most recent call last):
> File "/usr/lib/pymodules/python2.6/openerp/addons/web/common/http.py",
> line 592, in send
> result = openerp.netsvc.dispatch_rpc(service_name, method, args)
> File "/usr/lib/pymodules/python2.6/openerp/netsvc.py", line 360, in
> dispatch_rpc
> result = ExportService.getService(service_name).dispatch(method,
> params)
> File "/usr/lib/pymodules/python2.6/openerp/service/web_services.py",
> line 586, in dispatch
> res = fn(db, uid, *params)
> File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 167, in
> execute_kw
> return self.execute(db, uid, obj, method, *args, **kw or {})
> File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 121, in
> wrapper
> return f(self, dbname, *args, **kwargs)
> File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 176, in
> execute
> res = self.execute...

Read more...

Kyle Waid (midwest)
Changed in magentoerpconnect:
assignee: nobody → gekko tek (gekkotek)
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.