This question has been flagged
1777 Views

hi everyone,

i have problem in conversion amount total to words  in the invoice , 'amount_text' is the field that contain the value of conversion but it didn't get the amount total taxed , i will show u the code :

.py

amount_text=fields.Char('Total')
    @api.multi    def convert_to_text(self, amount,currency='Dirhams'):
           amount_fr = convertion.trad(amount,currency).upper()       

            return {'value': {'amount_text': amount_fr  }}

.xml

<xpath expr="//field[@name='amount_total']" position="replace">                         

<field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"  on_change="convert_to_text(amount_total)"/>
         </xpath>           

<field name="comment" position="before">               

<field name="amount_text"/>          

  </field>


Avatar
Discard