Skip to content
Advertisement

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 ?

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement