This commit is contained in:
gsinghpal
2026-04-30 18:08:36 -04:00
parent 4213c44e51
commit bdcbd86db2
4 changed files with 19 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
{
'name': 'Fusion Rental',
'version': '19.0.2.0.0',
'version': '19.0.2.0.1',
'category': 'Sales/Rental',
'sequence': 200,
'summary': "Rental lifecycle: agreements, deposits, auto-renewal, marketing, inspections.",

View File

@@ -7,7 +7,7 @@
<record id="mail_template_rental_reminder" model="mail.template">
<field name="name">Rental: Renewal Reminder</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="subject">{{ object.company_id.name }} - Rental {{ object.name }} Renews Soon</field>
<field name="subject">{{ object.company_id.name }} - Your rental {{ object.name }} continues soon</field>
<field name="email_from">{{ (object.company_id.email_formatted or object.user_id.email_formatted or user.email_formatted) }}</field>
<field name="use_default_to" eval="False"/>
<field name="partner_to">{{ object.partner_id.id }}</field>
@@ -18,22 +18,28 @@
<p style="color:#D69E2E;font-size:13px;font-weight:600;letter-spacing:0.5px;text-transform:uppercase;margin:0 0 24px 0;">
<t t-out="object.company_id.name"/>
</p>
<h2 style="color:#1a202c;font-size:22px;font-weight:700;margin:0 0 6px 0;line-height:1.3;">Rental Renewal Notice</h2>
<h2 style="color:#1a202c;font-size:22px;font-weight:700;margin:0 0 6px 0;line-height:1.3;">Your rental continues soon</h2>
<p style="color:#718096;font-size:15px;line-height:1.5;margin:0 0 24px 0;">
Your rental order <strong style="color:#2d3748;"><t t-out="object.name"/></strong> is scheduled for automatic renewal on <strong style="color:#2d3748;"><t t-out="object.rental_return_date and format_datetime(object.rental_return_date, tz=object.company_id.partner_id.tz or 'America/Toronto', dt_format='MMMM dd, yyyy \'at\' hh:mm a') or ''"/></strong>.
Hi <t t-out="object.partner_id.name or ''"/>, this is a friendly heads-up that your rental <strong style="color:#2d3748;"><t t-out="object.name"/></strong> will continue automatically on <strong style="color:#2d3748;"><t t-out="object.rental_return_date and format_datetime(object.rental_return_date, tz=object.company_id.partner_id.tz or 'America/Toronto', dt_format='MMMM dd, yyyy') or ''"/></strong>. <strong>You don't need to do anything</strong> — we'll just bill the recurring rental charge below.
</p>
<table style="width:100%;border-collapse:collapse;margin:0 0 24px 0;">
<tr><td colspan="2" style="padding:10px 14px;font-size:12px;font-weight:600;color:#718096;text-transform:uppercase;letter-spacing:0.5px;border-bottom:2px solid #e2e8f0;">Renewal Details</td></tr>
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;border-bottom:1px solid #f0f0f0;width:35%;">Order</td><td style="padding:10px 14px;color:#2d3748;font-size:14px;border-bottom:1px solid #f0f0f0;"><t t-out="object.name"/></td></tr>
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;border-bottom:1px solid #f0f0f0;">Renewal Date</td><td style="padding:10px 14px;color:#2d3748;font-size:14px;border-bottom:1px solid #f0f0f0;"><t t-out="object.rental_return_date and format_datetime(object.rental_return_date, tz=object.company_id.partner_id.tz or 'America/Toronto', dt_format='MMMM dd, yyyy \'at\' hh:mm a') or ''"/></td></tr>
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;font-weight:600;border-top:2px solid #e2e8f0;">Renewal Amount</td><td style="padding:10px 14px;color:#D69E2E;font-size:14px;font-weight:700;border-top:2px solid #e2e8f0;"><t t-out="object.amount_total" t-options="{'widget': 'monetary', 'display_currency': object.currency_id}"/></td></tr>
<table style="width:100%;border-collapse:collapse;margin:0 0 12px 0;">
<tr><td colspan="2" style="padding:10px 14px;font-size:12px;font-weight:600;color:#718096;text-transform:uppercase;letter-spacing:0.5px;border-bottom:2px solid #e2e8f0;">Next Rental Period</td></tr>
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;border-bottom:1px solid #f0f0f0;width:40%;">Order</td><td style="padding:10px 14px;color:#2d3748;font-size:14px;border-bottom:1px solid #f0f0f0;"><t t-out="object.name"/></td></tr>
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;border-bottom:1px solid #f0f0f0;">Continues on</td><td style="padding:10px 14px;color:#2d3748;font-size:14px;border-bottom:1px solid #f0f0f0;"><t t-out="object.rental_return_date and format_datetime(object.rental_return_date, tz=object.company_id.partner_id.tz or 'America/Toronto', dt_format='MMMM dd, yyyy') or ''"/></td></tr>
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;font-weight:600;border-top:2px solid #e2e8f0;">Recurring Rental Charge</td><td style="padding:10px 14px;color:#2d3748;font-size:14px;font-weight:700;border-top:2px solid #e2e8f0;"><t t-out="ctx.get('renewal_amount') or object._get_renewal_amount()" t-options="{'widget': 'monetary', 'display_currency': object.currency_id}"/></td></tr>
</table>
<div style="border-left:3px solid #D69E2E;padding:12px 16px;margin:0 0 24px 0;background:#f7fafc;">
<p style="margin:0;font-size:14px;line-height:1.5;color:#2d3748;">If you would like to continue your rental, no action is needed. If you wish to cancel and schedule a pickup, click the button below.</p>
<p style="color:#a0aec0;font-size:12px;line-height:1.5;margin:0 0 24px 0;font-style:italic;">
This is the recurring rental charge only. Your security deposit stays on file and is not re-billed, and any one-time delivery or installation fees from your original order are not charged again.
</p>
<div style="border-left:3px solid #38a169;padding:12px 16px;margin:0 0 24px 0;background:#f7fafc;">
<p style="margin:0;font-size:14px;line-height:1.5;color:#2d3748;">Happy with your rental? <strong>No action needed</strong> — it will simply continue. If you'd like us to come pick the item up instead, use the link below.</p>
</div>
<div style="text-align:center;margin:0 0 24px 0;">
<a t-attf-href="{{ (object.get_base_url() or '') }}/rental/cancel/{{ ctx.get('cancel_token', '') }}" style="background-color:#E53E3E;color:#fff;padding:12px 30px;text-decoration:none;border-radius:4px;font-size:14px;font-weight:600;display:inline-block;">Request Cancellation &amp; Pickup</a>
<a t-attf-href="{{ (object.get_base_url() or '') }}/rental/cancel/{{ ctx.get('cancel_token', '') }}" style="background-color:#ffffff;color:#4A5568;padding:10px 24px;text-decoration:none;border-radius:4px;font-size:13px;font-weight:600;display:inline-block;border:1px solid #cbd5e0;">Schedule a pickup instead</a>
</div>
<p style="color:#a0aec0;font-size:12px;line-height:1.5;margin:0 0 0 0;text-align:center;">
Questions? Just reply to this email and we'll be happy to help.
</p>
<t t-if="not is_html_empty(object.user_id.signature)" data-o-mail-quote-container="1">
<div data-o-mail-quote="1">--<br data-o-mail-quote="1"/><t t-out="object.user_id.signature or ''" data-o-mail-quote="1"/></div>
</t>

View File

@@ -842,6 +842,7 @@ class SaleOrder(models.Model):
if template:
template.with_context(
cancel_token=cancel_token,
renewal_amount=self._get_renewal_amount(),
).send_mail(self.id, force_send=True)
def _send_renewal_reminder_sms(self, cancel_token):