Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2412 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
čvn 25
940
1
zář 25
1682
2
čvc 24
2016
1
čvn 24
1850
0
pro 23
1462