我有这个型号:
class SearchInfoPartnerSeniat(models.TransientModel):
_name = "search.info.partner.seniat"
vat = fields.Char(
'ID Number (Cedula, Passport, VAT Number)', size=64,
help='The VAT number must be in this format J1234567890, if you'
' are looking for a cedula 12345678 and passport D123456789',
required=True)
name = fields.Char('Partner', size=256, help='Partner name')
wh_iva_agent = fields.Boolean(
'Withholding Agent', help='It is withholding agent')
wh_iva_rate = fields.Float(
'Percent of withholding',
help='What is the percentil of withholding that you must to apply'
' to this supplier if you are withholding agent')
vat_subjected = fields.Boolean(
'Pay VAY',
help='Pay VAT, in spanish known as : Contribuyente formal')
我的观点:
<record model="ir.ui.view" id="view_vat_search">
<field name="name">search.info.partner.seniat.form</field>
<field name="model">search.info.partner.seniat</field>
<field name="arch" type="xml">
<form string="Wizard to search partner on SENIAT" version="7.0">
<group colspan="4">
<field name="vat"/>
<button name="search_partner_seniat" string="Search RIF" type="object" icon="terp-check"/>
</group>
<separator string="VAT number consulted"/>
<group colspan="4">
<field name="name" readonly="True"/>
<field name="wh_iva_agent" readonly="True"/>
<field name="wh_iva_rate" readonly="True"/>
<field name="vat_subjected" readonly="True"/>
</group>
</form>
</field>
</record>
每当我尝试访问此向导时,虽然我重新启动了Odoo服务器并更新了模块,但它会抛出一个错误,说这些字段不存在。
我不明白,有没有人在Odoo v10社区遇到这种错误?
修改
这是追溯:
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 862, in call_kw
return self._call_kw(model, method, args, kwargs)
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 679, in call_kw
return call_kw_model(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 664, in call_kw_model
result = method(recs, *args, **kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/models.py", line 1317, in load_views
for [v_id, v_type] in views
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/models.py", line 1317, in <dictcomp>
for [v_id, v_type] in views
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/models.py", line 1396, in fields_view_get
xarch, xfields = View.postprocess_and_fields(self._name, etree.fromstring(result['arch']), view_id)
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/base/ir/ir_ui_view.py", line 887, in postprocess_and_fields
self.raise_view_error(message, view_id)
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/base/ir/ir_ui_view.py", line 445, in raise_view_error
raise ValueError(message)
ValueError: El campo `wh_iva_agent` no existe
Error de contexto:
Vista `search.info.partner.seniat.form`
[view_id: 536, xml_id: l10n_ve_fiscal_requirements.view_vat_search, model: search.info.partner.seniat, parent_id: n/a]
答案 0 :(得分:0)
没关系,我修好了这个:
class SearchInfoPartnerSeniat(models.TransientModel):
_name = "search.info.partner.seniat"
vat = fields.Char(
string='ID Number (Cedula, Passport, VAT Number)', size=64,
help='The VAT number must be in this format J1234567890, if you'
' are looking for a cedula 12345678 and passport D123456789',
required=True)
name = fields.Char(string='Partner', size=256, help='Partner name')
wh_iva_agent = fields.Boolean(
string='Withholding Agent', help='It is withholding agent')
wh_iva_rate = fields.Float(
string='Percent of withholding',
help='What is the percentil of withholding that you must to apply'
' to this supplier if you are withholding agent')
vat_subjected = fields.Boolean(
string='Pay VAY',
help='Pay VAT, in spanish known as : Contribuyente formal')
string
标志现在是强制性的