feat: hide authorizer for rental orders, auto-set sale type

Rental orders no longer show the "Authorizer Required?" question or
the Authorizer field. The sale type is automatically set to 'Rentals'
when creating or confirming a rental order. Validation logic also
skips authorizer checks for rental sale type.

Made-with: Cursor
This commit is contained in:
gsinghpal
2026-02-25 23:33:23 -05:00
parent 3c8f83b8e6
commit 14fe9ab716
51 changed files with 4192 additions and 822 deletions

View File

@@ -67,7 +67,10 @@ class RentalCancellationRequest(models.Model):
def action_confirm(self):
"""Confirm the cancellation and stop auto-renewal."""
self.ensure_one()
self.order_id.write({'rental_auto_renew': False})
self.order_id.write({
'rental_auto_renew': False,
'rental_auto_renew_off_reason': f"Customer requested cancellation ({self.reason or 'No reason provided'})",
})
self.write({'state': 'confirmed'})
self._schedule_pickup_activity()
self._send_cancellation_confirmation()

View File

@@ -1,4 +1,4 @@
from odoo import fields, models
from odoo import api, fields, models
class RentalRenewalLog(models.Model):
@@ -67,6 +67,7 @@ class RentalRenewalLog(models.Model):
)
notes = fields.Text(string="Notes")
@api.depends('order_id', 'renewal_number')
def _compute_display_name(self):
for rec in self:
rec.display_name = (

View File

@@ -17,3 +17,43 @@ class ResConfigSettings(models.TransientModel):
help="Number of days to hold the security deposit after pickup before "
"processing the refund. Default is 3 days.",
)
rental_google_maps_api_key = fields.Char(
string="Google Maps API Key",
config_parameter='fusion_rental.google_maps_api_key',
help="API key for Google Places address autocomplete on the rental "
"agreement form. If Fusion Claims is installed, its API key is "
"used automatically and this field can be left blank.",
)
rental_marketing_email_pct = fields.Integer(
string="Marketing Email Timing (%)",
config_parameter='fusion_rental.marketing_email_pct',
default=23,
help="Percentage of rental period after which the purchase marketing "
"email is sent. Default 23% (7 days on a 30-day rental). "
"Minimum effective offset is 1 day.",
)
rental_renewal_reminder_pct = fields.Integer(
string="Renewal Reminder Timing (%)",
config_parameter='fusion_rental.renewal_reminder_pct',
default=10,
help="Percentage of rental period before renewal date at which the "
"reminder is sent. Default 10% (3 days on a 30-day rental). "
"Minimum effective offset is 1 day.",
)
rental_short_term_threshold_days = fields.Integer(
string="Short-Term Threshold (Days)",
config_parameter='fusion_rental.short_term_threshold_days',
default=3,
help="Rentals shorter than this duration (in days) are treated as "
"short-term. Auto-renewal is delayed until the return window "
"plus grace period has passed.",
)
rental_short_term_grace_hours = fields.Integer(
string="Short-Term Grace Period (Hours)",
config_parameter='fusion_rental.short_term_grace_hours',
default=1,
help="Hours after the scheduled return time before auto-renewal "
"kicks in for short-term rentals. Gives the customer time to "
"return without being charged.",
)

File diff suppressed because it is too large Load Diff