title: Amount to words Odoo qweb report for Purchase Requisition
body: <p>I am trying to achieve amount to words in odoo 10. I am overriding the purchase requisition template. I will share my .py and .xml files please check what am I doing wrong. Thanks in advance!</p>
  
  <p>Step1: Created module with scaffold command.</p>
  
  <p>Step2: model.py</p>
  
  <pre><code># -*- coding: utf-8 -*-
  from odoo import models, fields, api
  from openerp import models, api _
  from openerp.tools import amount_to_text_en
  from openerp import tools
  from openerp.tools.amount_to_text import amount_to_text
  
   class purchase_agreement_updates(models.Model):
       _name = 'purchase_agreement_updates.purchase_agreement_updates'
       _inherit = 'self.header'
  
       @api.multi
       def amount_to_text(self, amount, currency='Euro'):
           return amount_to_text(amount, currency)
  purchase_agreement_updates()
  class purchase_requisition(models.Model):
      _inherit = 'purchase.requisition'
  
       @api.multi
       def amount_to_text(self, amount, currency='Euro'):
           return amount_to_text(amount, currency)
  </code></pre>
  
  <p>templates.xml:</p>
  
  <pre><code>        &lt;t t-name="purchase_requisition.report_purchaserequisitions"&gt;
              &lt;t t-call="report.html_container"&gt;
                  &lt;t t-foreach="docs" t-as="o"&gt;
                      &lt;!--&lt;t t-call="report.external_layout"&gt;--&gt;
                          &lt;div class="header"&gt;
  
  
                                &lt;div style="float:left;width:100px;"&gt;&lt;/div&gt;
                                &lt;div style="margin:0 auto;width:100%;"&gt;
                                    &lt;h3 style="text-align:center;text-decoration: underline;margin-top:50px;"&gt;PURCHASE REQUISITION&lt;/h3&gt;&lt;/div&gt;
                                &lt;div style="float:right;width:100px;"&gt;
                                    &lt;img t-if="res_company.logo" t-att-src="'data:image/png;base64,%s' %res_company.logo" height="120px" width="100px"/&gt;&lt;/div&gt;
  
                              &lt;!--&lt;t t-esc="o.name"/&gt;--&gt;
                          &lt;/div&gt;
  .
  .
  .
  .
  .
  .
                 &lt;tr t-foreach="o.line_ids" t-as="line_ids"&gt;
                                      &lt;t t-set="total_value" t-value="total_value+line_ids.product_qty * line_ids.price_unit"/&gt;
                                      &lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt;&lt;span t-esc="line_ids_index+1"/&gt; &lt;/td&gt;
                                      &lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt;&lt;span t-field="line_ids.product_id.name"/&gt;&lt;/td&gt;
                                      &lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt;&lt;span t-field="line_ids.product_qty"/&gt; &lt;/td&gt;
                                      &lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt;&lt;span t-field="line_ids.price_unit"/&gt; &lt;/td&gt;
                                      &lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt;&lt;span t-esc="line_ids.product_qty * line_ids.price_unit"/&gt; &lt;/td&gt;&lt;/tr&gt;
  
                                  &lt;tr&gt;&lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt; &lt;/td&gt;
                                      &lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt; &lt;/td&gt;
                                      &lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt; &lt;/td&gt;
                                      &lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt;Total &lt;/td&gt;
                                      &lt;td style="border:1px solid #000;padding-left:5px;height:25px;"&gt; &lt;t t-esc="total_value"/&gt;&lt;/td&gt;&lt;/tr&gt;
  
  
                                  &lt;tr&gt;&lt;td style="border:1px solid #000;padding-left:5px;height:25px;" colspan="5"&gt;&lt;span style="font-weight:bold;"&gt;TOTAL PURCHASE:&lt;/span&gt; &lt;t t-esc="total_value"/&gt; &lt;/td&gt;&lt;/tr&gt;
                                  &lt;tr&gt;&lt;td style="border:1px solid #000;padding-left:5px;height:25px;" colspan="5"&gt;&lt;span style="font-weight:bold;"&gt;TOTAL PURCHASE IN WORDS:&lt;/span&gt; &lt;span t-esc="o.amount_to_text(total_value, 'Aed')"/&gt;
                                          &lt;!--&lt;span t-esc="o.amount_to_text('2000', o.currency_id)"/&gt;--&gt;  &lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>Error:
  Error to render compiling AST
  AttributeError: 'purchase.requisition' object has no attribute 'amount_to_text'
  Template: 844
  Path: /templates/t/t/t/t/div[2]/table[2]/tr[5]/td/span[2]
  Node: </p>