Skip to Content
Menu
This question has been flagged

Hi, I'm trying to add a custom view.

It works well with:

<act_window id="mattermost_settings_action" name="Mattermost config"
    res_model="mattermost.settings" view_type="form" view_mode="form"/>


Then I added the custom form id to display:

<record id="mattermost_settings_action"model="ir.actions.act_window">
  <field name="name">Mattermost config</field>
  <field name="res_model">mattermost.settings</field>
  <field name="view_id" ref="res_config_settings_mm"/>
  <field name="view_type">form</field>
  <field name="target">inline</field>
</record>


But now, when I click on the menu I have this error:

Uncaught TypeError: Cannot read property 'settingView' of undefined
http://127.0.0.1:8069/web/content/514-0b4bd55/web.assets_backend.js:5
Traceback:
TypeError: Cannot read property 'settingView' of undefined
    at Class._moveToTab (http://127.0.0.1:8069/web/content/514-0b4bd55/web.assets_backend.js:5:42)
    at Class._renderLeftPanel (http://127.0.0.1:8069/web/content/514-0b4bd55/web.assets_backend.js:8:315)
    at Class._render (http://127.0.0.1:8069/web/content/514-0b4bd55/web.assets_backend.js:7:716)
    at Class.prototype.(anonymous function) [as _render] (http://127.0.0.1:8069/web/content/383-805b1f7/web.assets_common.js:3538:488)
    at Class.start (http://127.0.0.1:8069/web/content/514-0b4bd55/web.assets_backend.js:1275:335)
    at Class.prototype.(anonymous function) [as start] (http://127.0.0.1:8069/web/content/383-805b1f7/web.assets_common.js:3538:488)
    at Class.start (http://127.0.0.1:8069/web/content/514-0b4bd55/web.assets_backend.js:1609:20)
    at Class.prototype.(anonymous function) [as start] (http://127.0.0.1:8069/web/content/383-805b1f7/web.assets_common.js:3538:488)
    at Class.start (http://127.0.0.1:8069/web/content/514-0b4bd55/web.assets_backend.js:3:654)
    at Class.prototype.(anonymous function) [as start] (http://127.0.0.1:8069/web/content/383-805b1f7/web.assets_common.js:3538:488)


Here is the complete file:

<record id="res_config_settings_mm"model="ir.ui.view">
  <field name="name">res.config.settings.mm</field>
  <field name="model">mattermost.settings</field>
  <field name="arch"type="xml">
  <form string="Mattermost config"class="oe_form_configuration">
  <header>
  <button string="Save"type="object" name="execute"class="oe_highlight"/>
  or
  <button string="Cancel"type="object" name="cancel"class="oe_link"/>
  </header>
  <group string="Mattermost">
  <div name="mattermost">
  <h2>Mattermost Integration</h2>
  <div class="row mt16 o_settings_container"name="integration_mm">
  <div class="col-12 col-lg-6 o_setting_box">
  <div class="o_setting_right_pane">
  <label string="Mattermost"for="mattermost_integration"/>
  <div class="text-muted">
  Add access tokens to enable mattermost command interactions
  </div>
  <field name="mm_access_token"/>
  <field name="mm_token_ids"widget="many2many_tags"/>
  </div>
  </div>
  </div>
  </div>
  </group>
  </form>
  </field>
</record>

<record id="mattermost_settings_action" model="ir.actions.act_window">
  <field name="name">Mattermost config</field>
  <field name="res_model">mattermost.settings</field>
  <field name="view_id" ref="res_config_settings_mm"/>
  <field name="view_type">form</field>
  <field name="target">inline</field>
</record>

<!-- <act_window id="mattermost_settings_action" name="Mattermost config" res_model="mattermost.settings" view_type="form" view_mode="form"/> -->

<menuitem id="mattermost_settings_menu"name="Mattermost settings"
    action="mattermost_settings_action"parent="base.menu_administration" />


Do you know how to resolve this ?

Avatar
Discard

Hm... did you extend the view with a custom module? If you did try adding the custom module name in <field name="view_id" ref="custom_module_name.res_config_settings_mm"/>.

Related Posts Replies Views Activity
3
Sep 21
10606
1
Jan 21
3039
2
Oct 24
4727
0
Apr 24
455
2
Jan 24
13790