Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
13629 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer