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


Hi,

How to create automatic actions to cancel expired quotations. because currently odoo v14 not cancel expired quotations. 

Avatar
Discard
Best Answer

You can create an automatic action in Odoo v14 to cancel expired quotations by following these steps:

  1. Go to the Odoo sales module and click on the "Automatic Actions" menu.

  2. Click the "Create" button to create a new automatic action.

  3. Give your automatic action a name, such as "Cancel Expired Quotations".

  4. Set the object type to "Quotation" and set the domain to filter for quotations that are in the "Quotation Sent" state and have an expiration date that is in the past. You can do this by setting the domain like this:

cssCopy code[('state', '=', 'sent'), ('validity_date', ', fields.Date.today())]

This will filter for quotations that are in the "Quotation Sent" state and have a validity date that is less than the current date.

  1. Set the action type to "Python Code".

  2. In the "Python Code" field, enter the following code to cancel the expired quotations:

cssCopy codefor quotation in records:
    quotation.action_cancel()

This code loops through all the records that match the domain (i.e., the expired quotations) and calls the "action_cancel" method on each one to cancel the quotation.

  1. Save the automatic action.

Now, whenever a quotation with an expiration date in the past is in the "Quotation Sent" state, the automatic action will cancel it automatically. You can also set the frequency of the automatic action to run at a specific interval, such as daily or hourly, so that expired quotations are automatically canceled without any manual intervention.


Avatar
Discard
Related Posts Replies Views Activity
2
Dec 24
489
2
Nov 24
801
0
Sep 24
299
0
Jun 24
330
0
Nov 23
300