Comment 3 for bug 1111340

Revision history for this message
Nikola Stojanoski (nstojanoski) wrote :

Hello,

I'm having the same issue. I'm adding one more field to project module and i have to remove the view, update module, add back the view, update module again.

My code:
----------------------------------------------------------------------------------------
        <record model="ir.ui.view" id="view_project_form_bom">
            <field name="name">project.task.form</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_form2" />
            <field name="arch" type="xml">
                <field name="user_id" position="after">
                    <field name="bom_id"/>
                </field>
            </field>
        </record>

----------------------------------------------------------------------------------------
class project_task(osv.Model):
    _inherit = 'project.task'
    _columns = {
            'sub_products':fields.one2many('mrp.subproduct', 'bom_id', 'Byproducts'),
            'bom_id': fields.many2one('mrp.bom', 'BOM', ondelete='set null', domain=[('in_project', '=', True)]),
            'daily_journal':fields.one2many('construction.journal', 'task_id', 'Journals'),
            'tasks_id': fields.many2one('construction.task', 'Task', ondelete='set null'),

    }

project_task()

-------------------------------------------------------------------------------------
the error:

2013-04-23 16:11:15,118 6683 ERROR construction openerp.addons.base.ir.ir_ui_view: Can't render view construction.view_project_form_bom for model: project.task

---------------------------------

    xarch, xfields = relation.__view_look_dom_arch(cr, user, f, view_id, ctx)
AttributeError: 'NoneType' object has no attribute '_BaseModel__view_look_dom_arch'
2013-04-23 16:11:15,120 6683 ERROR construction openerp.tools.convert: Parse error in /home/mrks/openerp7/vion_addons/construction/project_bom_view.xml:17:
<record model="ir.ui.view" id="view_project_form_bom">
            <field name="name">project.task.form</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_form2"/>
            <field name="arch" type="xml">
                <field name="user_id" position="after">
                    <field name="bom_id"/>
                </field>
            </field>
        </record>

--------
  File "/home/mrks/openerp7/server/openerp/osv/orm.py", line 1544, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

-------------------

The error is exactly the same, the fix is the same and annoying during development.

Regards,
Nikola