Error in getting lang of description_sale of the product

Bug #514251 reported by amaza
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Medium
Unassigned

Bug Description

When the lang of the Partner is default (None), the sale.order.line product_id_change brings the english translation of the text, not the text of the default lang of the system (or the user one).

       In the 926 of sale.py (product_id_change) if the partner lang is False (leave as blank lang defined) the lang var is getting False

 if partner_id:
            lang = partner_obj.browse(cr, uid, partner_id).lang

Then when the lang is false the default behaviour of the system is using en_EN (i don't know the internals of translation module)

For solving the 926 line of sale.py can be changed:
       if partner_id and partner_obj.browse(cr, uid, partner_id).lang:
            lang = partner_obj.browse(cr, uid, partner_id).lang

So only does the work if the partner has lang defined, otherwise lang is untouched (this works for me)

Revision history for this message
Numérigraphe (numerigraphe) wrote :

Just to shedding light on translations: when lang=False, you get en_EN because for the moment it's hardcoded. If I understand Fabien right, this is by design.
He commented on bug #400256 :
"I invalidate this bug. It's important for us to have a clean approach on being fully multi-languages. Everything must be in english and the server send translated versions to the client.

It's the same for dates, floats, ... Example: dates are stored in SQL format but the format is adapted at the client side depending on the user. For sentences, everything in the base module and fields are in english and the client send/receive translations according to the user."
Your solution is only good if that's what happens in other places (we need to keep thing coherent). If it's not, then please file a Blueprint, I'll support it as much as I can.
I hope this helps.
Lionel.

Revision history for this message
amaza (amaza) wrote :

Hi Lionel.

I agree with you, but isn't the problem.

The system is correct, and by default uses the lang of the user/system. But for getting the text of the product for a partner without lang, the system changes to lang=False.... and brings erroneous description (the user doesn't see where comes the description)

I think the correct thing is "If the partner has lang, use this lang, otherwise don't change anything (use the default lang).

Every openerp system not using en_EN, if user leaves undefined the partner lang produces these result, the user defines ok the description in his lang, and the system bring another lang...

Revision history for this message
Samantha (samantha-z-mathews) wrote :

i tall you, it should depend on partner lang fcourse.

Changed in openobject-addons:
status: New → Invalid
Revision history for this message
digitalsatori(Shine IT) (digitalsatori) wrote :

Hi amaza, Samantha,

What is the design purpose to make "Product Description" in order line changes according to the Partner's language setting?
Isn't the order line message only for the data entry stuff at this stage?
Isn't that more reasonable to change the language displaying accordingly on the order report form (pdf) , as it suppose to send and display to the due customer/supplier?

To make the system behave consistently, IMHO, it should always display items in login user's language setting, while change the language display in pdf report according to Partner's language setting.

Changed in openobject-addons:
status: Invalid → Confirmed
milestone: none → 6.0
importance: Undecided → Medium
Revision history for this message
Nathan (nathan-bowden-kiwi) wrote :

+1

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

@digitalsatori

The sale order line is used mainly to display the product in the partner's lang. When the partner lang is not defined on the partner form, we have two choices:
  - we use english
  - we use the lang of the user.

It's not only about the sale order line description, it's also the lang of each external report that come from the partner form. If you print several time the same sale order or the same invoice it's important that it always appears in the same format/data, and not being dependent of the user that prints the invoice/sale order.

The sale order line description (which is used for printing mainly) should be consistent with the lang used in the reports. The lang used in all reports is english if no other lang is defined. So, I invalidate this bug.

This make me think about one improvement: when we install a new database in an non english language, OpenERP should put a default value for all partners' lang to the installation language.

Changed in openobject-addons:
status: Confirmed → Invalid
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.