This question has been flagged
1 Reply
12847 Views

Hi,

I have an action that is called from a form button:

def action_extract(self, cr, uid, ids, context=None):
self.this = self.browse(cr, uid, ids[0])

(...)

Under OpenERP 8.0 it works fine but under Odoo 11, is gives error saying that "missing 2 required positional arguments: 'uid' and 'ids'".

What's wrong and how to solve this ?

Paulo

Avatar
Discard
Best Answer

Hi,

Odoo 8 using old api's and odoo 11 is full of New api's.

In the new API the notion of Environment is introduced. Its main objective is to provide an encapsulation around cursor, user_id, model, and context, Recordset and caches

With this adjonction you are not anymore forced to pass the infamous function signature:

Environnement should be immutable and may not be modified in place as it also stores the caches of the RecordSet etc.

Please Refer This For More Info About New API's: http://odoo-new-api-guide-line.readthedocs.io/en/latest


Thank you

Avatar
Discard