Skip to Content
Menu
This question has been flagged
1 Reply
2392 Views

Hello,

I want to use the Rental with Sign so that I can have the customer sign before confirming a Rental Order. From my testing, the only time the "sign documents" appears is AFTER the Rental Quotation is confirmed. To my mind, it would make more sense to have the agreement signed BEFORE the RO is confimed - or even prevent an quotation from being confirmed if a signed rental agreement is required. 

Additionally, I would like to email the customer a link to Sign. It seems that currently the customer needs to be physically with the sales person to Sign.

Am I mis-understanding something here? or does anyone know how I can make the workflow work correctly?

I'm testing in Odoo 17 Enterprise.

Thank you very much for reading,

Avatar
Discard
Best Answer

Hi,

Option 1: Python constraint

from odoo import models, fields, api

from odoo.exceptions import ValidationError


class RentalOrder(models.Model):

    _inherit = 'rentals.order'


    @api.constrains('state', 'signed_document_ids')

    def _check_signed_before_confirm(self):

        for order in self:

            if order.state == 'draft' and order.requires_signature and not order.signed_document_ids:

                raise ValidationError("You must have the customer sign the rental agreement before confirming.")


This prevents confirmation until a signature is attached.


Option 2: Automated Action

Trigger on write or confirm of rental orders.

Check if the signature exists; if not, prevent confirmation.



Hope it helps



Avatar
Discard
Related Posts Replies Views Activity
1
Jun 25
914
1
Sep 25
1644
2
Jul 24
1994
1
Jun 24
1834
0
Dec 23
1451