Skip to Content
Menu
This question has been flagged

Please could someone tell me what I'm doing wrong....

Trying to change reports properly by using modules.

  • Have created module

  • Have edited the __manifest__.py

'category': 'Accounting & Finance',
    'version': '0.1',
    # any module necessary for this one to work correctly
    'depends': ['base', 'account',],
    # always loaded
    'data': [ 'views/templates.xml',],
  • Have created my templates.xml

  • <?xml version="1.0" encoding="utf-8"?>
        <odoo>
           <data> 
    <template id="report_invoice_document_multzer_inherit" inherit_id="account.report_invoice_document">         
                <xpath expr="(//table[@class='table table-condensed'])[1]//thead/tr" position="replace">
                    <tr>
                        <th>Description</th>
                        <th class="hidden">Source Document</th>
                        <th class="text-right">Quantity</th>
                        <th class="text-right">Unit Price</th>
                        <th t-if="display_discount" class="text-right">Disc.(%)</th>
                        <th class="text-right">VAT</th>
                        <th class="text-right">VAT Excluded Price</th>
                    </tr>
                </xpath>
           </template>
        </data>
    </odoo>
  • Have added the module

  • Have changed ?debug>Settings>Technical>Reports>Invocies>Advanced Properties - to NOT reload from attachement

  • and.....

  • Nothing :(

Any guidance please

EDIT

It appears is is already overwritten by "report_invoice_layouted"which is part of sale - will have to investigate further?:)

Avatar
Discard
Author Best Answer

The answer appears to be in "priority" - let all the other apps do there thing then do yours.

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <template id="report_invoice_document_multzer_inherit" inherit_id="account.report_invoice_document" priority="17">
          <xpath expr="(//div[@class='col-xs-5 col-xs-offset-7'])[1]" position="replace">
            <div class="oe_structure"/>
            <div class="col-xs-4 col-xs-offset-1" groups="sale.group_delivery_invoice_address">
              <strong t-if="o.partner_shipping_id == o.partner_id">Invoicing and shipping address:</strong>
              <strong t-if="o.partner_shipping_id != o.partner_id">Invoicing address:</strong>
              <div t-field="o.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>
              <span t-if="o.partner_id.vat">
                VAT: <span t-field="o.partner_id.vat"/>
              </span>
            </div>
            <div class="col-xs-4 col-xs-offset-1">
              <div t-if="o.partner_shipping_id != o.partner_id" class="mt8">
                <strong>Shipping address:</strong>
                <div t-field="o.partner_shipping_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>
                <span t-if="o.partner_shipping_id.vat">
                  VAT: <span t-field="o.partner_shipping_id.vat"/>
                </span>
              </div>
            </div>
          </xpath>
        </template>
    </data>
</odoo>
Avatar
Discard
Related Posts Replies Views Activity
3
Oct 17
29655
1
Sep 15
3681
2
Mar 24
531
9
Aug 23
18237
18
Dec 22
34554