summaryrefslogtreecommitdiff
path: root/addons/account/data/payment_receipt_data.xml
diff options
context:
space:
mode:
authorJitendra Prajapati <jpr@openerp.com>2016-07-13 11:23:25 +0530
committerYannick Tivisse <yti@odoo.com>2017-01-10 10:38:50 +0100
commite9e2e0cbb58ef67d1cecd9100a701649f323729d (patch)
tree0bb07f3957fe39a3ce6af903383ac4b53db645f0 /addons/account/data/payment_receipt_data.xml
parentd7bca63e360a8ee15ae95e04272899c8fda78ce5 (diff)
[IMP] account: Add a payment receipt report that can be sent by mail
- create a report for payment to print a receipt. Simple report with the amount received and name of the partner header of the company - add a new action in action menu for print receipt - add a new button action menu to send the receipt by email : STRING of the button = Send Receipt - default template of payment receipt like sales - add chatter history same as sales object - this report use for both ('customer payment' & 'vendor payment)
Diffstat (limited to 'addons/account/data/payment_receipt_data.xml')
-rw-r--r--addons/account/data/payment_receipt_data.xml53
1 files changed, 53 insertions, 0 deletions
diff --git a/addons/account/data/payment_receipt_data.xml b/addons/account/data/payment_receipt_data.xml
new file mode 100644
index 00000000000..2b15ae5427a
--- /dev/null
+++ b/addons/account/data/payment_receipt_data.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <data noupdate="1">
+
+ <record id="account_payment_action" model="ir.values">
+ <field name="model_id" ref="account.model_account_payment" />
+ <field name="name">Print Receipt</field>
+ <field name="key2">client_action_multi</field>
+ <field name="value" eval="'ir.actions.report.xml,' +str(ref('action_report_payment_receipt'))" />
+ <field name="key">action</field>
+ <field name="model">account.payment</field>
+ </record>
+
+ <!--Email template -->
+ <record id="mail_template_data_payment_receipt" model="mail.template">
+ <field name="name">Payment Receipt - Send by Email</field>
+ <field name="subject">${object.company_id.name} Payment Receipt (Ref ${object.name or 'n/a' })</field>
+ <field name="partner_to">${object.partner_id.id}</field>
+ <field name="model_id" ref="account.model_account_payment"/>
+ <field name="auto_delete" eval="True"/>
+ <field name="report_template" ref="account.action_report_payment_receipt"/>
+ <field name="report_name">${(object.name or '').replace('/','-')}</field>
+ <field name="lang">${object.partner_id.lang}</field>
+ <field name="body_html" type="xml">
+<p>Dear ${object.partner_id.name},</p>
+<p>Thank you for your payment.<br />Here is your payment receipt <strong>${(object.name or '').replace('/','-')}</strong> amounting to <strong>${object.amount} ${object.currency_id.name}</strong> from ${object.company_id.name}.</p>
+<p>If you have any questions, please do not hesitate to contact us.</p>
+<p>Best regards,
+% if user and user.signature:
+${user.signature | safe}
+% endif
+</p>
+</field>
+ </record>
+
+ <act_window name="Send Receipt By Email"
+ res_model="mail.compose.message"
+ src_model="account.payment"
+ view_mode="form"
+ target="new"
+ key2="client_action_relate"
+ id="account_send_payment_receipt_by_email_action"
+ context="{
+ 'default_model': 'account.payment',
+ 'mail_post_autofollow': True,
+ 'default_composition_mode': 'comment',
+ 'default_use_template': True,
+ 'default_res_id': active_id,
+ 'default_template_id': ref('account.mail_template_data_payment_receipt'),
+ }"
+ />
+ </data>
+</odoo>