콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
13672 화면

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

아바타
취소
베스트 답변

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

아바타
취소