From e9e2e0cbb58ef67d1cecd9100a701649f323729d Mon Sep 17 00:00:00 2001 From: Jitendra Prajapati Date: Wed, 13 Jul 2016 11:23:25 +0530 Subject: [PATCH] [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) --- addons/account/__manifest__.py | 2 + addons/account/data/payment_receipt_data.xml | 53 ++++++++++++++++ addons/account/models/account_payment.py | 2 +- ...count_report_payment_receipt_templates.xml | 60 +++++++++++++++++++ addons/account/views/account_payment_view.xml | 4 ++ addons/account/views/account_report.xml | 10 ++++ 6 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 addons/account/data/payment_receipt_data.xml create mode 100644 addons/account/report/account_report_payment_receipt_templates.xml diff --git a/addons/account/__manifest__.py b/addons/account/__manifest__.py index 9d94457643f..04a81c13b47 100644 --- a/addons/account/__manifest__.py +++ b/addons/account/__manifest__.py @@ -63,6 +63,8 @@ You could use this simplified accounting in case you work with an (external) acc 'views/res_config_view.xml', 'views/web_planner_data.xml', 'views/account_journal_dashboard_view.xml', + 'report/account_report_payment_receipt_templates.xml', + 'data/payment_receipt_data.xml', ], 'demo': [ 'demo/account_demo.xml', 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 @@ + + + + + + + Print Receipt + client_action_multi + + action + account.payment + + + + + Payment Receipt - Send by Email + ${object.company_id.name} Payment Receipt (Ref ${object.name or 'n/a' }) + ${object.partner_id.id} + + + + ${(object.name or '').replace('/','-')} + ${object.partner_id.lang} + +

Dear ${object.partner_id.name},

+

Thank you for your payment.
Here is your payment receipt ${(object.name or '').replace('/','-')} amounting to ${object.amount} ${object.currency_id.name} from ${object.company_id.name}.

+

If you have any questions, please do not hesitate to contact us.

+

Best regards, +% if user and user.signature: +${user.signature | safe} +% endif +

+
+
+ + +
+
diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index bfeb6f727f6..36164be72f7 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -170,7 +170,7 @@ class account_register_payments(models.TransientModel): class account_payment(models.Model): _name = "account.payment" - _inherit = 'account.abstract.payment' + _inherit = ['mail.thread', 'account.abstract.payment'] _description = "Payments" _order = "payment_date desc, name desc" diff --git a/addons/account/report/account_report_payment_receipt_templates.xml b/addons/account/report/account_report_payment_receipt_templates.xml new file mode 100644 index 00000000000..1e6e44588bd --- /dev/null +++ b/addons/account/report/account_report_payment_receipt_templates.xml @@ -0,0 +1,60 @@ + + + + diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index 8602bb3727a..b51b1349cb9 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -117,6 +117,10 @@ +
+ + +
diff --git a/addons/account/views/account_report.xml b/addons/account/views/account_report.xml index 56d352ba8f5..56f2a8adaa3 100644 --- a/addons/account/views/account_report.xml +++ b/addons/account/views/account_report.xml @@ -110,5 +110,15 @@ file="account.report_partnerledger" /> + +