我想在odoo中继承模型,我升级我的模块,错误显示如下:
File "/usr/lib/python2.7/dist-packages/openerp/tools/misc.py", line 199, in file_open
return _fileopen(name, mode=mode, basedir=rtp, pathinfo=pathinfo, basename=basename)File "/usr/lib/python2.7/dist-packages/openerp/tools/misc.py", line 246, in _fileopen
raise IOError('File not found: %s' % basename)IOError: File not found: estate_vehicle/views/inherit_transfertomn_spb_view
这是我的python代码:
class InheritSPB(models.Model):
_inherit ='estate.nursery.seeddo'
timesheet_ids = fields.One2many('estate.timesheet.activity.transport','owner_id','Timesheet ids')
这是我的观看代码:
record model="ir.ui.view" id="inherit_view_field_view_timesheet_transfermn_activity">
<field name="name">Inherit timesheet SPB</field>
<field name="model">estate.nursery.seeddo</field>
<field name="inherit_id" ref="estate_nursery.view_form_seeddo"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='detail_transportir'']" position="after">
<page string="Vehicle Information">
<tree>
<field name="vehicle_timesheet_ids" track_visibility="onchange" attrs="{'required': [('state','=','draft')],
'readonly': [('state','=','done')]}"
context="{'tree_view_ref' : 'estate_nursery.view_tree_timesheet_activity_transport',
'default_dc_type' : 2}"/>
</tree>
</page>
</xpath>
</field>
</record>
答案 0 :(得分:0)
在您的情况下,文件应为inherit_transfertomn_spb_view.xml
您需要使用 inherit_transfertomn_spb_view.xml 文件名检查模块 estate_vehicle views 文件夹中的文件。
现在检查您的__openerp__.py
例如:
"data" : [
#new of file with proper destination
views/inherit_transfertomn_spb_view.xml
]