I'm new to editing/programming OpenERP modules so I'm following this tutorial to simply add a field to the projects module. I've run into a few errors and I've fixed them all, but now my XML simply won't validate. I've read multiple forum posts, read every similar post here on stackoverflow and I can't figure out my problem. So, here's the server's error log output and my files:
openerp-server.log:
2014-05-28 17:56:13,120 29680 ERROR mct openerp.osv.orm: Can't find field 'mct_projects_machine' in the following view parts composing the view of object model 'project.project':
* project.project.form
Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model
2014-05-28 17:56:13,122 29680 ERROR mct openerp.addons.base.ir.ir_ui_view: Can't render view for model: project.project
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_ui_view.py", line 126, in _check_render_view
fvg = self.pool.get(view.model).fields_view_get(cr, uid, view_id=view.id, view_type=view.type, context=context)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2278, in fields_view_get
xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 1955, in __view_look_dom_arch
raise except_orm('View error', msg)
except_orm: ('View error', u"Can't find field 'mct_projects_machine' in the following view parts composing the view of object model 'project.project':\n * project.project.form\n\nEither you wrongly customized this view, or some modules bringing those views are not compatible with your current data model")
2014-05-28 17:56:13,128 29680 ERROR mct openerp.tools.convert: Parse error in /usr/lib/pymodules/python2.7/openerp/addons/mct_projects/mct_projects.xml:4:
<record model="ir.ui.view" id="mct_projects_project">
<field name="name">project.project.form</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="mct_projects_machine"/>
</xpath>
</field>
</record>
__init__.py:
from openerp.modules import get_module_resource, get_module_path
import mct_projects
mct_projects.py:
from openerp.osv import fields, osv
class mct_projects(osv.osv):
_inherit = 'project.project'
_columnns = {
'mct_projects_machine': fields.integer('Mct projects Machine', size=11),
}
_defaults ={
}
mct_projects()
mct_projects.xml:
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="mct_projects_project">
<field name="name">project.project.form</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project" />
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="mct_projects_machine" />
</xpath>
</field>
</record>
</data>
</openerp>
__openerp__.py
{
'name': "MCT project integration",
'version': "1.0",
'author': "XYZ",
'category': "Tools",
'depends': ['project'],
'data': ['mct_projects.xml'],
'demo': [],
'installable': True,
}
As far as my diagnoses goes it's something wrong with the "arch" field. It seems to be saying that mct_projects_machine isn't a field that was ever created, but I declared it in mct_projects.py so I'm at a loss. I followed the tutorial exactly, and a different post here on stackoverflow was fixed by changing the xpath expression, so I tried that. That is the only difference between how my code is now and the tutorial-and I get the same error either way. Any help would be greatly appreciated.