This question has been flagged
1 Reply
8777 Views

I'm converting module (v.12) to (v.14). To replace @api.one and @api.multi, i put self.ensure_one() , which is not worked. 

It shows key error and value error "expected singleton" with too many values.

How could i solve it?

Avatar
Discard
Best Answer

Hi,
You can just remove @api.multi from the code, the function will work properly.
From Odoo 13 onward @api.multi and @api.one are not used.
To remove the singleton error , you can loop inside the function using: for rec in self:

Regards

Avatar
Discard
Author

Thanks it worked