← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 662493] [NEW] [TRUNK and 5.0]report engine is not taking correctly string pýthon functions

 

Public bug reported:

Hello.

We detected this error some time ago.

As we know yo can put on line python functions between [[  ]] and on rml
reports this was evaluated, at least until V5.0.12, right, we used this
to take o the 2 first letters to the VAT number, for example in a
report, the Vat number is in this way, VEJ123456789, for european
countrie it is BEXXXXXXXXX, the 2 first letters are not necesary on some
reports for this reason we use this on reports.

[[ o.partner_id.vat[2:] ]]

Last time it works was in 5.0.12, right now this kind of simply python
functions on string are not working, and no error and no traceback...


Thanks.


How do i can try it?.

Use the report "Overdue Payment" on partner.

For trunk_
account/report/account_print_overdue.rml

In line 102:
          <para style="terp_default_9">[[ addr['street'] ]]</para>
replace by
          <para style="terp_default_9">[[ addr['street'][:4] ]]</para>

Go to customers> select China Export> Overdue Payments on Reports.

Originaly it return:
52 Chop Suey street (PDF1)

With change it should return only the first 4 elements on string, I
mean: "52 C" against this It is returning the function as if it have an
error on sintax.(PDF2)

You can try in V5 too, i dont think we need to develop a "parser" for a
than simply function...

If you try other like "upper()" this are working fne, speccially i don't
know why it is happening.

regards.

** Affects: openobject-addons
     Importance: Low
         Status: New

** Affects: openobject-addons/5.0
     Importance: Low
         Status: New

** Affects: openobject-addons/trunk
     Importance: Low
         Status: New

-- 
[TRUNK and 5.0]report engine is not taking correctly string pýthon functions
https://bugs.launchpad.net/bugs/662493
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.

Status in OpenObject Addons Modules: New
Status in OpenObject Addons 5.0 series: New
Status in OpenObject Addons trunk series: New

Bug description:
Hello.

We detected this error some time ago.

As we know yo can put on line python functions between [[  ]] and on rml reports this was evaluated, at least until V5.0.12, right, we used this to take o the 2 first letters to the VAT number, for example in a report, the Vat number is in this way, VEJ123456789, for european countrie it is BEXXXXXXXXX, the 2 first letters are not necesary on some reports for this reason we use this on reports.

[[ o.partner_id.vat[2:] ]]

Last time it works was in 5.0.12, right now this kind of simply python functions on string are not working, and no error and no traceback...


Thanks.


How do i can try it?.

Use the report "Overdue Payment" on partner.

For trunk_
account/report/account_print_overdue.rml

In line 102:
          <para style="terp_default_9">[[ addr['street'] ]]</para>
replace by
          <para style="terp_default_9">[[ addr['street'][:4] ]]</para>

Go to customers> select China Export> Overdue Payments on Reports.

Originaly it return:
52 Chop Suey street (PDF1)

With change it should return only the first 4 elements on string, I mean: "52 C" against this It is returning the function as if it have an error on sintax.(PDF2)

You can try in V5 too, i dont think we need to develop a "parser" for a than simply function...

If you try other like "upper()" this are working fne, speccially i don't know why it is happening.

regards.





Follow ups

References