Search code examples
pythonpython-3.xodoo

What is the alternative of @api.one in Odoo 13?


Right now when I started coding on Odoo v13 I found that Odoo has been removed @api.one.

What is the alternative of the @api.one in Odoo v13 ?


Solution

  • In odoo13 by default instance method will accept self as multi instance (multi-recordset).

    So for instance method, you should remove the @api.one and @api.multi decorator from your methods.

    For a single instance(single recordset), you still can check with self.ensure_one() or you can apply your own logic.