Wrong param order in extid_to_existing_oeid() calls in product.py and sale.py

Bug #1167964 reported by Robert Rübner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
Confirmed
High
Sébastien BEAU - http://www.akretion.com
OpenObject Extension
New
Undecided
Unassigned

Bug Description

Hi all,

- magentoerpconnect: revision 685 from oerp6.1-stable branch
- Magento: 1.6.0.0 using only simple products
- this bug is related with https://bugs.launchpad.net/openobject-extension/+bug/1163362.

There are several calls of extid_to_existing_oeid() function in magentoerpconnector. Function extid_to_existing_oeid() is located in base_external_referentials/external_osv.py. The problem of the extid_to_existing_oeid() calls: there are different param orders in these calls, sometimes external_id comes first than referential_id and sometimes referential_id comes first than external_id.

I updated 3 calls of extid_to_existing_oeid() in magentoerpconnector, 2 in product.py and 1 in sale.py.

product.py (class product_mag_osv in function redefine_prod_view() line 843 and line 853):

In line 843 change:
"oerp_group_id = attr_group_obj.extid_to_existing_oeid(cr, uid, attr_set.referential_id.id, mag_group_id)" to

"oerp_group_id = attr_group_obj.extid_to_existing_oeid(cr, uid, mag_group_id, attr_set.referential_id.id)"

In line 853 change:
"oerp_group_id = attr_group_obj.extid_to_existing_oeid(cr, uid, ref_id, mag_group_id)" to

"oerp_group_id = attr_group_obj.extid_to_existing_oeid(cr, uid, mag_group_id, ref_id)"

Without these changes I had problems to open the Magento fields for one product.

saly.py (in class sale_shop in function _get_rootcategory() line 126):
In line 126 change:
"rid = self.pool.get('product.category').extid_to_existing_oeid(cr, uid, shop.shop_group_id.referential_id.id, shop.root_category_id)" to

"rid = self.pool.get('product.category').extid_to_existing_oeid(cr, uid, shop.root_category_id, shop.shop_group_id.referential_id.id)"

Without these changes I had problems with exports (products or stock) because the shop root category wasn't set correctly.

Regards
Robert

description: updated
description: updated
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi,

Thanks for your good analysis.
I don't even know how it can work now?

Anyway, I think this deserves a merge as soon as possible. Can I ask you to create a merge proposal for that or at least to attach a diff file? Thanks

Guewen

Changed in magentoerpconnect:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Sébastien BEAU - http://www.akretion.com (sebastien.beau)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Guewen,

my branch from december takes the other approach: it adapts the calls in magentoerpconnect to what seemed to be an API change in openobject-extension

https://code.launchpad.net/~therp-nl/magentoerpconnect/61stable-lp1089266-api_change

Maybe Seb Beau can comment on this change, that he made in http://bazaar.launchpad.net/~extra-addons-commiter/openobject-extension/oerp6.1-stable/revision/215

Cheers,
Stefan.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi Stefan,
thanks for your input, I marked this bug as duplicate.

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.