Reviewers: ,
Please review this at http://codereview.tryton.org/425001/
Affected files:
M doc/topics/reports/index.rst
Index: doc/topics/reports/index.rst
===================================================================
--- a/doc/topics/reports/index.rst
+++ b/doc/topics/reports/index.rst
@@ -191,31 +191,54 @@
To replace an existing report you must deactivate the old report and
activate
the new report.
-For example to deactivate the invoice report:
+For example to deactivate the sale report:
.. highlight:: xml
::
- <record model="ir.action.report" id="account_invoice.report_invoice">
+ <record model="ir.action.report" id="sale.report_sale">
<field name="active" eval="False"/>
</record>
-Then you must activate the new invoice report that exists in your new
module:
+Then you must activate the new sale report that exists in your new module:
.. highlight:: xml
::
- <record model="ir.action.report" id="report_invoice_new">
- <field name="name">Invoice</field>
- <field name="report_name">account.invoice</field>
- <field name="model">account.invoice</field>
- <field name="report">my_module/invoice.odt</field>
+ <record model="ir.action.report" id="report_sale_new">
+ <field name="name">Sale</field>
+ <field name="report_name">sale.sale</field>
+ <field name="model">sale.sale</field>
+ <field name="report">my_module/sale.odt</field>
<field name="style">module_name/header_A4.odt</field>
<field name="template_extension">odt</field>
</record>
+Replacing existing Invoice report
+---------------------------------
+
+Indeed the invoice report is not directly a report but a wizard that will
call
+the report. So if you want to change it, you must also override the wizard
to
+have the StateAction using the new xml id.
+
+For example to change the invoice report:
+
+.. highlight:: xml
+
+::
+
+ from trytond.wizard import Wizard, StateAction
+
+ class PrintInvoice(Wizard):
+ 'Print Invoice Report'
+ _name = 'account.invoice.print'
+
+ print_ = StateAction('module_name.report_invoice_new')
+
+ PrintInvoice()
+
Passing custom data to a report
-------------------------------
--
[email protected] mailing list