summaryrefslogtreecommitdiff
path: root/addons/purchase/data/mail_template_data.xml
diff options
context:
space:
mode:
authoryhu-odoo <yhu@odoo.com>2020-04-21 15:22:46 +0000
committeryhu-odoo <yhu@odoo.com>2020-05-27 08:20:17 +0000
commit181c7d82e30d0848bbac7f7d0188e81aced0af07 (patch)
treed5868d318629c09ebb4da9d70ac2316d66fde338 /addons/purchase/data/mail_template_data.xml
parentd83334ef8ee566e56ad8b25264d66704120ba598 (diff)
[IMP] purchase: send reminder mail to vendor
1. automatically send a reminder mail to vendor to confirm the receipt date. If confirmed, (confirmed by vendor) will be added next to the receipt date. If not, vendor can update the date on the portal website. An warning activity will be set for the purchase representative for this update. 2. Vendor can also comfirm recieption of the PO when we 'send PO by mail'. If confirm, (confirmed by vendor) will be added next to the confirmation date. An filter is added in the PO search view to show all unconfirmed PO. Task 2230811 PR #49921 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/purchase/data/mail_template_data.xml')
-rw-r--r--addons/purchase/data/mail_template_data.xml79
1 files changed, 75 insertions, 4 deletions
diff --git a/addons/purchase/data/mail_template_data.xml b/addons/purchase/data/mail_template_data.xml
index dff26e49227..35bd59cf12c 100644
--- a/addons/purchase/data/mail_template_data.xml
+++ b/addons/purchase/data/mail_template_data.xml
@@ -49,11 +49,46 @@
with reference: ${object.partner_ref}
% endif
amounting in <strong>${format_amount(object.amount_total, object.currency_id)}</strong>
- from ${object.company_id.name}.
- <br/><br/>
- If you have any questions, please do not hesitate to contact us.
+ from ${object.company_id.name}.
+ % if object.date_planned or object.expected_date:
+ The receipt is planned for
+ % if object.date_planned:
+ <strong>${object.date_planned.date()}</strong>.
+ % elif object.expected_date:
+ <strong>${object.expected_date.date()}</strong>.
+ % endif
+ <br/><br/>
+ Could you please acknowledge the receipt of this order?
+ % endif
+ </p>
+</div></field>
+ <field name="report_template" ref="action_report_purchase_order"/>
+ <field name="report_name">PO_${(object.name or '').replace('/','_')}</field>
+ <field name="lang">${object.partner_id.lang}</field>
+ <field name="auto_delete" eval="True"/>
+ </record>
+
+ <record id="email_template_edi_purchase_reminder" model="mail.template">
+ <field name="name">Purchase Order: Vendor Reminder</field>
+ <field name="model_id" ref="purchase.model_purchase_order"/>
+ <field name="email_from">${(object.user_id.email_formatted or user.email_formatted) |safe}</field>
+ <field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
+ <field name="partner_to">${object.partner_id.id}</field>
+ <field name="body_html" type="html">
+<div style="margin: 0px; padding: 0px;">
+ <p style="margin: 0px; padding: 0px; font-size: 13px;">
+ Dear ${object.partner_id.name}
+ % if object.partner_id.parent_id:
+ (${object.partner_id.parent_id.name})
+ % endif
<br/><br/>
- Best regards,
+ Here is a reminder that the delivery of the purchase order <strong>${object.name}</strong> is planned for
+ % if object.date_planned:
+ <strong>${object.date_planned.date()}</strong>.
+ % else:
+ <strong>${object.expected_date.date()}</strong>.
+ % endif
+ Could you please confirm it will be on time?
</p>
</div></field>
<field name="report_template" ref="action_report_purchase_order"/>
@@ -61,5 +96,41 @@
<field name="lang">${object.partner_id.lang}</field>
<field name="auto_delete" eval="True"/>
</record>
+
+ <template id="mail_notification_confirm" inherit_id="mail.mail_notification_paynow" name="Purchase: Confirmation mail notification template">
+ <xpath expr="//t[@t-set='access_name']" position="after">
+ <t t-if="record._name == 'purchase.order'">
+ <t t-if="record.state == 'purchase' and not record.env.context.get('is_reminder')">
+ <t t-set="access_name">Confirm</t>
+ <t t-set="access_url" t-value="record.get_confirm_url(confirm_type='reception')"/>
+ </t>
+ </t>
+ </xpath>
+ <xpath expr="//a[@t-att-href='access_url']" position="replace">
+ <t t-if="record._name == 'purchase.order' and record.env.context.get('is_reminder')">
+ <a t-att-href="record.get_confirm_url(confirm_type='reminder')"
+ style="margin-right: 10px; background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
+ Yes
+ </a>
+ <a t-att-href="record.get_update_url()"
+ style="margin-left: 10px; background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
+ No, Update Dates
+ </a>
+ <div>&amp;nbsp;</div>
+ <div style="margin: 0px; padding: 0px; font-size:13px; text-align: left;">
+ If you have any questions, please do not hesitate to contact us.
+ <div>&amp;nbsp;</div>
+ Best regards,
+ </div>
+ </t>
+ <t t-else="">
+ <a t-att-href="access_url"
+ style="margin-left: 10px; background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
+ <t t-esc="access_name"/>
+ </a>
+ </t>
+ </xpath>
+ </template>
+
</data>
</odoo>