diff --git a/account_payment_order_vendor_email/__manifest__.py b/account_payment_order_vendor_email/__manifest__.py index 34cc0eae9..5380cd3e1 100644 --- a/account_payment_order_vendor_email/__manifest__.py +++ b/account_payment_order_vendor_email/__manifest__.py @@ -3,10 +3,10 @@ { "name": "Account Payment Order Email", - "version": "14.0.2.0.0", + "version": "16.0.1.0.0", "license": "AGPL-3", "author": "Open Source Integrators, Odoo Community Association (OCA)", - "maintainers": [], + "maintainers": ["ursais"], "website": "https://github.com/OCA/bank-payment", "category": "Accounting", "depends": ["account_payment_order", "account_payment_mode"], diff --git a/account_payment_order_vendor_email/data/mail_template.xml b/account_payment_order_vendor_email/data/mail_template.xml index 1bff0e5fb..e679e9aa3 100644 --- a/account_payment_order_vendor_email/data/mail_template.xml +++ b/account_payment_order_vendor_email/data/mail_template.xml @@ -7,245 +7,343 @@ name="model_id" ref="account_payment_order.model_account_payment_order" /> - ${object.company_id.name | safe} <${(object.company_id.email or user.email) | safe}> + {{ object.company_id.email or user.email }} Remittance Advice - ${object.generated_user_id.lang} - {{ object.generated_user_id.lang }} + - - - - - - - + + - +
- -
-
- - + + + + + + - - - + + + + +
+ border="0" + cellpadding="0" + cellspacing="0" + style="padding-top: 16px; background-color: white; font-family:Verdana, Arial,sans-serif; color: #454748; min-width:800px; border-collapse:separate;" + > +
+ +
+
+ + + + - + + + -
Remittance - Advice
- - ${object.name} + Advice -
+
+ + + +
${object.company_id.name} -
+

-
-
- - + +
+
+
+ + + - - + + -
- Dear ${object.name},

- A payment was processed on ${ctx['date']} - for ${ctx['partner_name']} in the amount of - ${ctx['total_amount']} with reference - ${ctx['payment_ref']}.

- % set line_dict = ctx.get('line_data',False) - % for line in line_dict: - - - - - - - - - - - - -
- % if line == line_dict[0]: - - ${line.get("inv_date") or ''} - - % else: - ${line.get("inv_date") or ''} - % endif - - % if line == line_dict[0]: - - ${line.get("inv_no") or ''} - - % else: - ${line.get("inv_no") or ''} - % endif - - % if line == line_dict[0]: - - ${line.get("credit_ref") or ''} - - % else: - ${line.get("credit_ref") or ''} - % endif - - % if line == line_dict[0]: - - ${line.get("supp_inv") or ''} - - % else: - ${line.get("supp_inv") or ''} - % endif - - % if line == line_dict[0]: - - ${line.get("payment_amount") or ''} - - % else: - ${'%.2f' % line.get("payment_amount") or ''} - % endif - - % if line == line_dict[0]: - - ${line.get("inv_amount") or ''} - - % else: - ${'%.2f' %line.get("inv_amount") or ''} - % endif - - % if line == line_dict[0]: - - ${line.get("credit_amount") or ''} - - % else: - ${'%.2f' % line.get("credit_amount") or ''} - % endif - - % if line == line_dict[0]: - - ${line.get("discount") or ''} - - % else: - ${line.get("discount") or ''} - % endif - - % if line == line_dict[0]: - - ${line.get("due_amount") or ''} - - % else: - ${'%.2f' % line.get("due_amount") or ''} - % endif -
- % endfor + Dear , +

+ A payment was processed on + for in the amount of + with reference + .

+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Thanks, - % if user.signature: -
- ${user.signature | safe} - % endif + +
+ +
+

-
+
- - - + - - + + + | + + + + | + + + + +
- ${object.company_id.name} -
+
+ + + + + + -
+ +
- ${object.company_id.phone} - % if object.company_id.email - | - ${object.company_id.email} - % endif - % if object.company_id.website - | - ${object.company_id.website} - - % endif -
-
+
- + + > + + + +
+ - -
- Powered by Odoo -
-
+ Powered by + Odoo +
+
- ]]>
diff --git a/account_payment_order_vendor_email/models/account_payment_mode.py b/account_payment_order_vendor_email/models/account_payment_mode.py index eaaaf3a21..7a65856aa 100644 --- a/account_payment_order_vendor_email/models/account_payment_mode.py +++ b/account_payment_order_vendor_email/models/account_payment_mode.py @@ -23,6 +23,7 @@ class PaymentOrder(models.Model): _inherit = "account.payment.order" def send_vendor_email(self): + context = dict(self._context) for rec in self: if rec.payment_mode_id.send_email_to_partner: date_generated = rec.date_generated @@ -73,7 +74,7 @@ class PaymentOrder(models.Model): partner_email_id = payment.partner_id.email if partner_email_id: template.write({"email_to": partner_email_id}) - template.with_context( + context.update( { "date": date_generated, "partner_name": partner_name, @@ -81,19 +82,18 @@ class PaymentOrder(models.Model): "payment_ref": payment_ref, "line_data": line_data, } - ).send_mail(rec.id, force_send=True) + ) + template.with_context(**context).send_mail( + rec.id, force_send=True + ) rec.message_post( - body=_( - "An email is sent successfully to %s vendor." - % partner_name - ) + body=_("An email is not able to send to %s vendor.") + % partner_name ) else: rec.message_post( - body=_( - "An email is not able to send to %s vendor." - % partner_name - ) + body=_("An email is not able to send to %s vendor.") + % partner_name ) def generated2uploaded(self): diff --git a/account_payment_order_vendor_email/readme/CONTRIBUTORS.rst b/account_payment_order_vendor_email/readme/CONTRIBUTORS.rst index a230e9130..3741acc6c 100644 --- a/account_payment_order_vendor_email/readme/CONTRIBUTORS.rst +++ b/account_payment_order_vendor_email/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * Maxime Chambreuil * Serpent Consulting Services Pvt. Ltd. * Daniel Reis +* Nikul Chaudhary diff --git a/setup/account_payment_order_vendor_email/odoo/addons/account_payment_order_vendor_email b/setup/account_payment_order_vendor_email/odoo/addons/account_payment_order_vendor_email new file mode 120000 index 000000000..2b15336c2 --- /dev/null +++ b/setup/account_payment_order_vendor_email/odoo/addons/account_payment_order_vendor_email @@ -0,0 +1 @@ +../../../../account_payment_order_vendor_email \ No newline at end of file diff --git a/setup/account_payment_order_vendor_email/setup.py b/setup/account_payment_order_vendor_email/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/account_payment_order_vendor_email/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)