저는 우리가 사용하고있는 API 호출에 따라 일부 기능을 새로운 API로 어떻게 변환 할 수 있는지, 완전히 번역 할 필요가 있는지 알고 싶습니다. 예를 들어 Odoo v10 API와 Odoo v8 API
, Odoo의 V8에@api.model
the method is exposed as not using ids, its recordset will generally be empty. Its "old API" signature is cr, uid, *arguments, context:
@api.model
def some_method(self, a_value):
pass
# can be called as
old_style_model.some_method(cr, uid, a_value, context=context)
, 나는 기능의이 종류가 있다고 가정 :이 기능에 @api.model
장식을 추가하는 경우
def update_info(self, cr, uid, ids, context=None):
""" OpenERP osv memory wizard : update_info_partner
"""
context = context or {}
seniat_url_obj = self.env('seniat.url')
self.cr.execute('''SELECT id FROM res_partner WHERE vat ilike 'VE%';''')
record = self.cr.fetchall()
pids = [item[0] for item in record]
seniat_url_obj.connect_seniat(cr, uid, pids, context=context,
all_rif=True)
return{}
을, 나는 또한을 업데이트해야 할 것 같아요 그것의 속성, 즉 : , 맞죠?
이 경우 데코레이터 @api.model
을 추가하고 기능 속성을 self
으로 변경하면됩니다.
저는 이제 v8에서 v10으로 일부 모듈을 옮겨 놓을 것이기 때문에 지금부터 어떻게해야하는지 배우려하고 있습니다.