0
Follow
8
View

How to avoid automated action beeing executed based on condition ? - Odoo

cyflove23 注册会员
2022-12-06 22:32

Maybe it's better to include your action inside the sale-order model, instead of using automated actions. you could do it like this:

from odoo import api, models


class Order(models.Model):
    _inherit = "sale.order"

    def action_confirm(self):
        super().action_confirm()
        self._on_order_confirmed_automated_action()

    @api.onchange("state")
    def _on_order_confirmed_automation(self)
        for order in self:
            if order.state == "sale":
                # Your code here

About the Author

Question Info

Publish Time
2022-12-06 22:32
Update Time
2022-12-06 22:32