[TRUNK and 5.0] SLICE opcodes missing in safe_eval() (string[:])
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) | Status tracked in Trunk | |||||
5.0 |
Fix Released
|
Medium
|
Anup(SerpentCS) | |||
Trunk |
Fix Released
|
Medium
|
Anup(SerpentCS) |
Bug Description
Slice opcodes are missing in safe_eval, that means that you cannot use the string slice operator [:] in reports.
For example [[ o.partner_
The missing opcodes are:
SLICE+0 Implements TOS = TOS[:].
SLICE+1 Implements TOS = TOS1[TOS:].
SLICE+2 Implements TOS = TOS1[:TOS].
SLICE+3 Implements TOS = TOS2[TOS1:TOS].
--- Original report: ---
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_
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/
In line 102:
<para style="
replace by
<para style="
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.
Related branches
summary: |
- [TRUNK and 5.0] report engine not taking correctly string python - functions [safe_eval()] + [TRUNK and 5.0] SLICE opcodes missing in safe_eval() (string[:]) |
description: | updated |
Sorry where i said: terp_default_ 9">[[ addr['street'] ]]</para>
In line 102:
<para style="
It must should say: terp_default_ 9">[[ addr['street'] ]]</para>
In line 101:
<para style="
Thanks a lot