This commit is contained in:
gsinghpal
2026-03-20 11:46:41 -04:00
parent 595dccc17d
commit 92369be6e0
71 changed files with 6588 additions and 8 deletions

View File

@@ -68,6 +68,12 @@ class SaleOrder(models.Model):
copy=False,
help="Stored card used for automatic renewal payment collection.",
)
rental_apply_cc_fee = fields.Boolean(
string="Apply CC Processing Fee",
default=True,
help="When enabled, a credit card processing fee is added to "
"invoices charged via stored card during auto-renewal.",
)
rental_original_duration = fields.Integer(
string="Original Duration (Days)",
compute='_compute_rental_original_duration',
@@ -574,13 +580,17 @@ class SaleOrder(models.Model):
def _get_rental_only_lines(self):
"""Return order lines that should be invoiced on renewal.
Excludes security deposits, delivery/installation, and any other
one-time charges. Only lines flagged as rental by Odoo core
(is_rental=True) are included.
Excludes security deposits, delivery/installation, fully returned
items, and any other one-time charges. Only lines flagged as
rental by Odoo core (is_rental=True) are included.
"""
self.ensure_one()
return self.order_line.filtered(
lambda l: l.is_rental and not l.is_security_deposit
lambda l: (
l.is_rental
and not l.is_security_deposit
and l.qty_returned < l.product_uom_qty
)
)
def _get_renewal_amount(self):

View File

@@ -122,6 +122,8 @@
</group>
<group string="Payment">
<field name="rental_payment_token_id"/>
<field name="rental_apply_cc_fee"
invisible="not rental_payment_token_id"/>
<field name="rental_charges_invoice_id"
invisible="not rental_charges_invoice_id" readonly="1"/>
<field name="rental_deposit_invoice_id"