← Back to team overview

openerp-india team mailing list archive

[Bug 1227052] [NEW] timesheet inherit view

 

Public bug reported:

Version 7

I have created a custom module to add some functionality to the timesheet.
i use the following code to hinerit end inject a button

        <record model="ir.ui.view" id="omnia_hr_timesheet_sheet_form">
            <field name="name">omnia.hr.timesheet.sheet.form</field>
            <field name="model">hr_timesheet_sheet.sheet</field>
            <field name="priority" eval="18"/>
            <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
            <field name="arch" type="xml">
				<xpath expr="//page[@string='Summary']" position="inside">
                    <button type="action" name="%(act_hr_timesheet_action)d" string="Timesheet Registration" />
                </xpath>
            </field>
        </record>

the first time i install the module works perfect, but if i upgrade the module this error occures:
2013-09-18 12:07:49,811 7084 ERROR ek-01 openerp.addons.base.ir.ir_ui_view: Can't render view  for model: hr_timesheet_sheet.sheet
Traceback (most recent call last):
  File "d:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\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)
AttributeError: 'NoneType' object has no attribute 'fields_view_get'
2013-09-18 12:07:49,842 7084 ERROR ek-01 openerp.tools.convert: Parse error in file:///d:/d/OmniaSolutions/Programming/EclipseWorkSpace/eureka/customAddons/omnia_hr_timesheet/wizard/hr_timesheet_view.xml:55: 
<record model="ir.ui.view" id="omnia_hr_timesheet_sheet_form">
            <field name="name">hr.timesheet.sheet.form.tree</field>
            <field name="model">hr_timesheet_sheet.sheet</field>
            <field name="priority" eval="18"/>
            <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
            <field name="arch" type="xml">
				<xpath expr="//page[@string='Summary']" position="inside">
                    <button type="action" name="%(act_hr_timesheet_action)d" string="Timesheet Registration"/>
                </xpath>
            </field>
        </record>
Traceback (most recent call last):
  File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\tools\convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\tools\convert.py", line 814, in _tag_record
    id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "d:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\addons\base\ir\ir_model.py", line 963, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "d:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\addons\base\ir\ir_ui_view.py", line 103, in create
    return super(view, self).create(cr, uid, values, context)
  File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\osv\orm.py", line 4470, in create
    self._validate(cr, user, [id_new], context)
  File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\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!')
errore ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
2013-09-18 12:07:53,990 7084 ERROR ek-01 openerp.netsvc: ValidateError
Error occurred while validating the field(s) arch: Invalid XML for View Architecture!
Traceback (most recent call last):
  File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\service\web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\osv\osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\osv\osv.py", line 144, in wrapper
    raise except_osv(inst.name, inst.value)
except_osv: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

any hint is appreciated

regards,
Matteo

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1227052

Title:
  timesheet inherit view

Status in OpenERP Addons (modules):
  New

Bug description:
  Version 7

  I have created a custom module to add some functionality to the timesheet.
  i use the following code to hinerit end inject a button

          <record model="ir.ui.view" id="omnia_hr_timesheet_sheet_form">
              <field name="name">omnia.hr.timesheet.sheet.form</field>
              <field name="model">hr_timesheet_sheet.sheet</field>
              <field name="priority" eval="18"/>
              <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
              <field name="arch" type="xml">
  				<xpath expr="//page[@string='Summary']" position="inside">
                      <button type="action" name="%(act_hr_timesheet_action)d" string="Timesheet Registration" />
                  </xpath>
              </field>
          </record>

  the first time i install the module works perfect, but if i upgrade the module this error occures:
  2013-09-18 12:07:49,811 7084 ERROR ek-01 openerp.addons.base.ir.ir_ui_view: Can't render view  for model: hr_timesheet_sheet.sheet
  Traceback (most recent call last):
    File "d:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\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)
  AttributeError: 'NoneType' object has no attribute 'fields_view_get'
  2013-09-18 12:07:49,842 7084 ERROR ek-01 openerp.tools.convert: Parse error in file:///d:/d/OmniaSolutions/Programming/EclipseWorkSpace/eureka/customAddons/omnia_hr_timesheet/wizard/hr_timesheet_view.xml:55: 
  <record model="ir.ui.view" id="omnia_hr_timesheet_sheet_form">
              <field name="name">hr.timesheet.sheet.form.tree</field>
              <field name="model">hr_timesheet_sheet.sheet</field>
              <field name="priority" eval="18"/>
              <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
              <field name="arch" type="xml">
  				<xpath expr="//page[@string='Summary']" position="inside">
                      <button type="action" name="%(act_hr_timesheet_action)d" string="Timesheet Registration"/>
                  </xpath>
              </field>
          </record>
  Traceback (most recent call last):
    File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\tools\convert.py", line 847, in parse
      self._tags[rec.tag](self.cr, rec, n)
    File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\tools\convert.py", line 814, in _tag_record
      id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
    File "d:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\addons\base\ir\ir_model.py", line 963, in _update
      res_id = model_obj.create(cr, uid, values, context=context)
    File "d:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\addons\base\ir\ir_ui_view.py", line 103, in create
      return super(view, self).create(cr, uid, values, context)
    File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\osv\orm.py", line 4470, in create
      self._validate(cr, user, [id_new], context)
    File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\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!')
  errore ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
  2013-09-18 12:07:53,990 7084 ERROR ek-01 openerp.netsvc: ValidateError
  Error occurred while validating the field(s) arch: Invalid XML for View Architecture!
  Traceback (most recent call last):
    File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\netsvc.py", line 292, in dispatch_rpc
      result = ExportService.getService(service_name).dispatch(method, params)
    File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\service\web_services.py", line 626, in dispatch
      res = fn(db, uid, *params)
    File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\osv\osv.py", line 188, in execute_kw
      return self.execute(db, uid, obj, method, *args, **kw or {})
    File "D:\d\OmniaSolutions\Programming\EclipseWorkSpace\OpenERP-v7\openerp\osv\osv.py", line 144, in wrapper
      raise except_osv(inst.name, inst.value)
  except_osv: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

  any hint is appreciated

  regards,
  Matteo

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1227052/+subscriptions


Follow ups

References