[OERP6.1-STABLE] MappingError: the mapping line: name for the object res.partner has this error: "Field 'firstname' does not exist in object

Bug #1125670 reported by Maxime Chambreuil (http://www.savoirfairelinux.com) on 2013-02-14
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
New
Undecided
Unassigned

Bug Description

Using oerp6.1-stable branches, I try to export an invoice from OpenERP to Magento and I get :

Traceback (most recent call last):
  File "/home/max/openerp/server/6.1/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/max/openerp/server/6.1/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/max/openerp/server/6.1/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/max/openerp/ecommerce/oerp6.1-stable/base_sale_multichannels/sale.py", line 482, in export_invoices
    self.pool.get('account.invoice')._export_one_resource(cr, uid, external_session, invoice_id, context=context)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1133, in _export_one_resource
    False, mapping, mapping_id, defaults=defaults, context=context)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/decorator.py", line 49, in wrapped
    return func(self, cr, uid, argument, *args, **kwargs)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/decorator.py", line 110, in wrapper
    return func(self, cr, uid, external_session, resource, *args, **kwargs)
  File "/home/max/openerp/magento/oerp6.1-stable/magentoerpconnect/magerp_osv.py", line 47, in _transform_and_send_one_resource
    return self.mag_transform_and_send_one_resource(cr, uid, external_session, *args, **kwargs)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1113, in _transform_and_send_one_resource
    defaults=defaults, context=context)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1394, in _transform_one_resource
    context=context)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1490, in _transform_field
    return related_obj.get_or_create_extid(cr, uid,external_session, field_value[0], context=context)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 275, in get_or_create_extid
    return self._export_one_resource(cr, uid, external_session, openerp_id, context=context)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1133, in _export_one_resource
    False, mapping, mapping_id, defaults=defaults, context=context)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/decorator.py", line 49, in wrapped
    return func(self, cr, uid, argument, *args, **kwargs)
  File "/home/max/openerp/magento/oerp6.1-stable/magentoerpconnect/partner.py", line 140, in _transform_and_send_one_resource
    resource, resource_id, update_date, mapping, mapping_id, defaults=defaults, context=context)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/decorator.py", line 49, in wrapped
    return func(self, cr, uid, argument, *args, **kwargs)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/decorator.py", line 110, in wrapper
    return func(self, cr, uid, external_session, resource, *args, **kwargs)
  File "/home/max/openerp/magento/oerp6.1-stable/magentoerpconnect/magerp_osv.py", line 47, in _transform_and_send_one_resource
    return self.mag_transform_and_send_one_resource(cr, uid, external_session, *args, **kwargs)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1113, in _transform_and_send_one_resource
    defaults=defaults, context=context)
  File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1426, in _transform_one_resource
    raise MappingError(e, mapping_line['name'], self._name)
MappingError: the mapping line: name for the object res.partner has this error: "Field 'firstname' does not exist in object 'browse_record(res.partner.address, 3)'"

Download full text (4.5 KiB)

looks like a missing dependency on the addon which adds the
firstname/lastname attributes on res.partner

On ven. 15 févr. 2013 00:32:34 CET, Maxime Chambreuil
(http://www.savoirfairelinux.com) wrote:
> Public bug reported:
>
> Using oerp6.1-stable branches, I try to export an invoice from OpenERP
> to Magento and I get :
>
> Traceback (most recent call last):
> File "/home/max/openerp/server/6.1/openerp/osv/osv.py", line 121, in wrapper
> return f(self, dbname, *args, **kwargs)
> File "/home/max/openerp/server/6.1/openerp/osv/osv.py", line 176, in execute
> res = self.execute_cr(cr, uid, obj, method, *args, **kw)
> File "/home/max/openerp/server/6.1/openerp/osv/osv.py", line 164, in execute_cr
> return getattr(object, method)(cr, uid, *args, **kw)
> File "/home/max/openerp/ecommerce/oerp6.1-stable/base_sale_multichannels/sale.py", line 482, in export_invoices
> self.pool.get('account.invoice')._export_one_resource(cr, uid, external_session, invoice_id, context=context)
> File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1133, in _export_one_resource
> False, mapping, mapping_id, defaults=defaults, context=context)
> File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/decorator.py", line 49, in wrapped
> return func(self, cr, uid, argument, *args, **kwargs)
> File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/decorator.py", line 110, in wrapper
> return func(self, cr, uid, external_session, resource, *args, **kwargs)
> File "/home/max/openerp/magento/oerp6.1-stable/magentoerpconnect/magerp_osv.py", line 47, in _transform_and_send_one_resource
> return self.mag_transform_and_send_one_resource(cr, uid, external_session, *args, **kwargs)
> File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1113, in _transform_and_send_one_resource
> defaults=defaults, context=context)
> File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1394, in _transform_one_resource
> context=context)
> File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1490, in _transform_field
> return related_obj.get_or_create_extid(cr, uid,external_session, field_value[0], context=context)
> File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 275, in get_or_create_extid
> return self._export_one_resource(cr, uid, external_session, openerp_id, context=context)
> File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/external_osv.py", line 1133, in _export_one_resource
> False, mapping, mapping_id, defaults=defaults, context=context)
> File "/home/max/openerp/extension/oerp6.1-stable/base_external_referentials/decorator.py", line 49, in wrapped
> return func(self, cr, uid, argument, *args, **kwargs)
> File "/home/max/openerp/magento/oerp6.1-stable/magentoerpconnect/partner.py", line 140, in _transform_and_send_one_resource
> resource, resource_id, update_date, mapping, mapping_id, defaults=defaul...

Read more...

Do you have the name of this missing addon ?

base_contact add a firstname field to res.partner.contact, not res.partner.address

In previous version of the connector, the field was provided by magentoerpconnect module.

Seems like an attempt was made to make the firstname field optional, depending on the installation of magentoerpconnect_partner_surname. Apparently it does not work without the installation of this module yet, or there has been an upgrade glitch. I think if you have an existing installation you are encouraged to install this module.

http://bazaar.launchpad.net/~magentoerpconnect-core-editors/magentoerpconnect/oerp6.1-stable/view/684/magentoerpconnect_partner_surname/__openerp__.py

From the bzr log in revision 678:

NAME REFACTOR : by default use only name if you need to use the lastname and firstname please first update magentoerpconnect and them install magentoerpconnect_partner_surname. DO IT ON A DATABASE TEST BEFORE. If you have any trouble please open a bug on lp

I did install magentoerpconnect_partner_surname and its dependency base_partner_surname.

I now have a first_name field, but still the same error.

Quick fix from Sébastien Beau: In the mapping of invoice, delete the line Partner.

On mer. 20 févr. 2013 20:32:04 CET, Maxime Chambreuil
(http://www.savoirfairelinux.com) wrote:
> Quick fix from Sébastien Beau: In the mapping of invoice, delete the
> line Partner.
>

Sébastien, it would be nice to have this as an official MP.

--
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 79 26 57 94

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers