Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

transforme a number to lettres in a PDF?

By
feriel bendimerad
on 2/1/14, 6:20 PM 897 views

hey guys , i need some help , i'm novice in using RML ...i want to transform my total ( number ) which appear in module sale/report to letters in french , i get the methode , it's in Server\addons\account\report\account_invoice_report.py" i do the import in sale_report but....i don't know where do the call of the methods... any help are welcomed :) ps:working on openerp 7

0

In order to access your function in the rml report, You have to define the method in the rml report parser class and so that you can call that function from rml by defining with in [[ ]] and passing the required arguments.

0

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 2/1/14, 8:06 PM
0
feriel bendimerad
On 2/2/14, 7:22 AM

hi Borni , i have used Amount to text as following :

from tools.amount_to_text import amount_to_text  #   in sale/sale_order.py

class order(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context=None):
        super(order, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({
            'time': time, 
            'show_discount':self._show_discount,
            'amount_to_text':amount_to_text,
        })

in RML :<para>[[amount_to_text(o.amount_total,'fr','dinars']]</para> and nothing is displaying in the pdf

i have used amount_to_text_fr the result is there but the translation is bad :/

add a ')' in expression rml : <para>[[amount_to_text(o.amount_total,'fr','dinars')]]</para>

Borni DHIFI
on 2/2/14, 7:39 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 2/1/14, 6:20 PM
Seen: 897 times
Last updated: 3/16/15, 8:10 AM