Skip to Content
Menu
This question has been flagged
1265 Views

I want to add a new invoice template for rental module,  in order to offer to the users the ability of choosing wich template to use ....

Problem is that the code below modify my new menu entry for this template, AS WELL AS the standart invoice one !

I don't uderstand why and what to do in order to avoid this !

Here is my XML code for that :

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<template
id="invoice_start_end_date_template" inherit_id="account.report_invoice_document">
<!--Add column Start date / End date in the table (header and rows -->
<xpath expr="//table[@class='table table-condensed']//thead//tr//th['Description']" position="after">
<th>
Start/End Dates</th> </xpath>
<xpath
expr="//table[@class='table table-condensed']//tbody//tr//td//span[@t-field='l.name']" position="after">
<t
t-set="str_dates" t-value="l.start_date+'=>'+l.end_date"/>
<td><span
t-esc="str_dates"/></td> </xpath>
</template>

<template
id="rental_report_sales_invoice_template">
<t
t-call="report.html_container">
<t
t-foreach="docs" t-as="o">
<t
r-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale_rental.rental_report_sales_invoice_template')"/>
<t
t-call="sale_rental.invoice_start_end_date_template"/>
</t>
</t>
</template>

<report
id="rental_report_sales_invoices"
model="account.invoice"
string="Invoice with start/end dates"
report_type="qweb-pdf"
name="sale_rental.rental_report_sales_invoice_template"
file="sale_rental.rental_report_sales_invoice_template"
attachment_use="True"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
menu="True"
/>

</data>
</openerp>
Avatar
Discard