[6.1] [7.0] product_custom_attributes, production_lot_custom_attributes: open by attribute set crashes on launguages other than English and French

Bug #1294745 reported by Leonardo Pistone
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Product Attributes
Status tracked in 7.0
6.1
Fix Released
High
Leonardo Pistone
7.0
Fix Released
High
Leonardo Pistone

Bug Description

To reproduce on v7:

- install product_custom_attributes
- choose a language where "information" does not translate to "information". In my case, Italian
- open product by attribute set, select any set
- open or create a product

It crashes with message:

info_page = eview.xpath("//page[@string='%s']" % (_('Information'),))[0]
IndexError: list index out of range

Same problem happens with production_lot_custom_attributes on 6.1 (and probably 7.0), but that crashes in French too, because there is not the coincidence that "Information" translates to "Information"

I pushed a workaround branch to better understand the problem: (I am not linking it to this bug because it is a nasty workaround)

https://code.launchpad.net/~camptocamp/openerp-product-attributes/6.1-workaround-lot-french-DONTMERGE-lep

Analysis: the problem is probably due to the fact that the function "_" doesn't look in the right module.

Related branches

Changed in openerp-product-attributes:
assignee: nobody → Leonardo Pistone - camptocamp (lpistone)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Leonardo, isn't enough to remove translate method _() on eview.xpath call?, that is to say:

info_page = eview.xpath("//page[@string='%s']" % ('Stock Moves'))[0]

Regards.

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Thanks Pedro.

It is the opposite: here _() returns the string in English, whereas the view has it translated. That's why it works in French (_("Information") == "Information").

I am debugging it now, unfortunately "_" does a lot of black magic. I'll let you know as soon as I find the catch.

Changed in openerp-product-attributes:
status: New → Fix Committed
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.