2017-02-27 9 views
0

v7コミュニティをいくつかのv7モジュールに移行しているので、まだいくつかのエラーに直面しています。桶を探しウィザード:TypeError:update_info()は少なくとも4つの引数をとります(2件あり) - Odoo v10コミュニティ

from odoo import api, fields, models 

class UpdateInfoPartner(models.TransientModel): 
_name = 'update.info.partner' 

def update_info(self, cr, uid, ids, context=None): 

    context = context or {} #dict(self._context or {}) 
    seniat_url_obj = self.pool.get('seniat.url') 
    self.env.cr.execute('''SELECT id FROM res_partner WHERE vat ilike 'VE%';''') 
    record = self.env.cr.fetchall() 
    pids = [item[0] for item in record] 
    seniat_url_obj.connect_seniat(self.env.cr, uid, pids, context=context, 
            all_rif=True) 
    return{} 

しかし、私はこの方法を実行しようとするたびに、それはこの私をスロー:

Traceback (most recent call last): 
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 638, in _handle_exception 
return super(JsonRequest, self)._handle_exception(exception) 
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 675, in dispatch 
result = self._call_function(**self.params) 
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 331, in _call_function 
return checked_call(self.db, *args, **kwargs) 
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/service/model.py", line 119, in wrapper 
return f(dbname, *args, **kwargs) 
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 324, in checked_call 
result = self.endpoint(*a, **kw) 
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 933, in __call__ 
return self.method(*args, **kw) 
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 504, in response_wrap 
response = f(*args, **kw) 
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/web/controllers/main.py", line 866, in call_button 
action = self._call_kw(model, method, args, {}) 
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/web/controllers/main.py", line 854, in _call_kw 
return call_kw(request.env[model], method, args, kwargs) 
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/api.py", line 681, in call_kw 
return call_kw_multi(method, model, args, kwargs) 
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/api.py", line 672, in call_kw_multi 
result = method(recs, *args, **kwargs) 
TypeError: update_info() takes at least 4 arguments (2 given) 

この種のエラー前のpythonに持っていたが、私は上だけでなく、それを見ることができませんこの方法。

アイデア?

アイデア?

答えて

1

が、これはあなたを助けることができるかもしれませ:

from odoo import api, fields, models 

class UpdateInfoPartner(models.TransientModel): 
_name = 'update.info.partner' 

def update_info(self): 

    context = dict(self.env.context or {}) 
    seniat_url_obj = self.env['seniat.url'] 
    self.env.cr.execute('''SELECT id FROM res_partner WHERE vat ilike 'VE%';''') 
    record = self.env.cr.fetchall() 
    pids = [item[0] for item in record] 
    seniat_url_obj.connect_seniat(self.env.cr, self.env.uid, pids,context=self.env.context, all_rif=True) 
    return{} 
関連する問題