o2m list widget string not translated

Bug #556657 reported by Ferdinand
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Low
OpenERP's Framework R&D
5.0
Confirmed
Low
Dhruti Shastri(OpenERP)
6.0
Fix Released
Low
OpenERP's Framework R&D

Bug Description

in py file
'stock_dispo_production_sale_ids' : one2many_sale('chricar.stock_dispo_production','order_line_id','To Sell', \

in xml
<field colspan="2" name="stock_dispo_production_sale_ids" nolabel="1" widget="one2many_list">
                        <tree string="Sale" editable="bottom">

the string 'Sale' is in the translation table but not displayed in German

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Don't forget to look at Bug 661281.
Thanks.

Changed in openobject-server:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
Revision history for this message
jerzyo (jerzyo) wrote :

I have the same problem, please fix it

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hello,
This is fixed in the latest trunk, you can see an example in the Fiscal Position form view (Steuerzuordnung), where the "tax_ids" field contains a redefinition of the tree view, and its title is properly displayed in German as "Steuer Zuordnung":
      <field name="tax_ids" colspan="2" widget="one2many_list" nolabel="1">
          <tree string="Tax Mapping" editable="bottom">
              <field name="tax_src_id" domain="[('parent_id','=',False)]"/>
              <field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
          </tree>
Thanks,

Changed in openobject-server:
milestone: none → 6.0-rc2
status: Confirmed → Fix Released
Revision history for this message
Margarita Manterola (marga) wrote :

This bug is a regression.

I understand the "focus on 6.0" thing, However, regressions should be fixed in the old stable version as well. Or, at least, publish a link to the patch, so those of us with this problem can patch our own installation, instead of forcing us to migrate _now_.

Also, I think that all translation issues should have higher importance. Continually tagging translation issues as "low" is only going to drive users from other countries away.

Internationalization is important, if you fail to see that, your product will never succeed.

Revision history for this message
Margarita Manterola (marga) wrote :

Hi!

I wasted several hours looking for the correct fix for this problem in 5.0, and finally located the line that I had to change.

I know that 5.0 is not "supported" anymore, but just in case someone else is hitting this bug and doesn't want to waste a whole day looking for the fix, here's the patch.

The patch only fixes the tree strings and not the sums. I suspect fixing the sums is very similar, will submit the complete patch when I have it.

Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Hello Margarita,

Thanks a lot for the analysis!
I confirm the issue and its a real regression coming out of the fix in _get_source which never returns False now.
I confirm that, your patch fixes the issue(ofcourse, the 'not trans' condition is useless now).

However, I am working on the solution on Translating the title of window(when the same O2M is clicked for EDIT mode).

I will post patch(es) as I come to a suitable and elegant solution.
Thanks again.

Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Moreover, the sums appear as translated always.
Kindly let me know where did you face it.
Thanks.

Revision history for this message
Margarita Manterola (marga) wrote :

Some sums did not appear as translated until I applied the fix attached here. I can send screen shots and source code if you don't believe me.

The problem with the attached patch is that it also includes the code for fixing https://bugs.launchpad.net/openobject-server/+bug/663775, since they are intertwined. Let me know if you need me to create a patch from a clean source tree.

Thanks for taking care of this!

Revision history for this message
Margarita Manterola (marga) wrote :

I'm going to attach the screenshots. This is the screenshots of the sums without translation.

I'll also attach the xml of the view. It includes a lot of non-relevant stuff but it also shows the relevant non-working sums.

Revision history for this message
Margarita Manterola (marga) wrote :

This is the screenshot with the translated sums. The only change between one and the other was adding the lines that I already provided in the patch to osv/orm.py:

              if trans == node.get('sum') and ('base_model_name' in context):
                    trans = self.pool.get('ir.translation')._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('sum'))

Revision history for this message
Margarita Manterola (marga) wrote :

This is the XML that produces both screenshots I submitted. There are several sums in the XML, the two shown in the screenshots are:

                    <field colspan="4" name="line_ids" nolabel="1" widget="one2many_list">
                        <tree string="Receipt Lines" editable="bottom">
                            <field name="reference" string="Invoice Reference"/>
                            <field name="partner_id" string="Partner" select="1"/>
                            <field name="partial"/>
                            <field name="amount" string="Total" sum="Total Invoices Amount"/>
                            <field name="invoice_id" invisible="1"/>
                        </tree>
                     </field>

And:

                            <field colspan="4" name="direct_payment_ids" nolabel="1" widget="one2many_list" on_change="button_compute(context)">
                                <tree string="Direct Payment Lines">
                                    <field name="method_id" select="1" required="1" domain="[('company_id','=', parent.company_id)]"/>
                                    <field name="currency_id" select="1" />
                                    <field name="amount" string="Total" required="1" sum="Total Direct Payment Amount"/>
                                </tree>
                                <form>
                                    <field name="method_id" select="1" required="1" domain="[('company_id','=', parent.company_id)]" />
                                    <field name="amount" string="Total" required="1" sum="Total Direct Payment Amount"/>
                                    <field name="currency_id" select="1" on_change="on_change_currency(currency_id, parent.company_id)"/>
                                </form>
                            </field>

Revision history for this message
Margarita Manterola (marga) wrote :

This is the XML that produces both screenshots I submitted. There are several sums in the XML, the two shown in the screenshots are:

                    <field colspan="4" name="line_ids" nolabel="1" widget="one2many_list">
                        <tree string="Receipt Lines" editable="bottom">
                            <field name="reference" string="Invoice Reference"/>
                            <field name="partner_id" string="Partner" select="1"/>
                            <field name="partial"/>
                            <field name="amount" string="Total" sum="Total Invoices Amount"/>
                            <field name="invoice_id" invisible="1"/>
                        </tree>
                     </field>

And:

                            <field colspan="4" name="direct_payment_ids" nolabel="1" widget="one2many_list" on_change="button_compute(context)">
                                <tree string="Direct Payment Lines">
                                    <field name="method_id" select="1" required="1" domain="[('company_id','=', parent.company_id)]"/>
                                    <field name="currency_id" select="1" />
                                    <field name="amount" string="Total" required="1" sum="Total Direct Payment Amount"/>
                                </tree>
                                <form>
                                    <field name="method_id" select="1" required="1" domain="[('company_id','=', parent.company_id)]" />
                                    <field name="amount" string="Total" required="1" sum="Total Direct Payment Amount"/>
                                    <field name="currency_id" select="1" on_change="on_change_currency(currency_id, parent.company_id)"/>
                                </form>
                            </field>

Revision history for this message
Margarita Manterola (marga) wrote :

Sorry for the noise, I just realize there was a small bug in the patch I submitted earlier. The bug is in the confirm part, I made a mistake when merging the patches. Here's a fixed version.

Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Hello Margarita,

Thank you for your quick response. Currently I am working on translation in the editable view of form.(screenshot attached)
So I will work on "Comment 10" later.

Thanks for your pointing out.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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