Skip to Content
Menu
This question has been flagged
6344 Views

Hello,

I am trying to add some field for filtering the tree view exactly like journal items view. I have tried it before and it worked but i have no clue why it is not working this time. I am getting error on the front end "Uncaught TypeError: Cannot read property 'view_id' of undefined". Following are my files

mail_message.js --->

openerp.complaint_system = function (instance) {

var _t = instance.web._t,

_lt = instance.web._lt;

var QWeb = instance.web.qweb;

instance.web.complaint_system=instance.web.complaint_system || {};

instance.web.views.add('tree_mail_message_quickadds', 'instance.web.complaint_system.QuickAddListView');

instance.web.complaint_system.QuickAddListView = instance.web.ListView.extend({

init: function() {

this._super.apply(this, arguments);

},

load_list:function(){

var tmp = this._super.apply(this, arguments);

},

start:function(){

var self = this;

this._super.apply(this, arguments);

this.$el.parent().prepend(QWeb.render("MailMessageQuickAdd", {widget: this}));

},

});

};

xml file ---->

<record id="mail_message_tree_views" model="ir.ui.view">

<field name="name">Complaints</field>

<field name="model">mail.message</field>

<field name = "priority">100</field>

<field name="arch" type="xml">

<tree string="Logs" create="False" on_write="on_create_write" editable="top">

<field name = "date" />

<field name = "employee_id" />

<field name = "complaint" />

</tree>

</field>

</record>

<record id="action_mail_message_all_a" model="ir.actions.act_window">

<field name="name">Complaints</field>

<field name="res_model">mail.message</field>

<field name= "view_type">form</field>

<field name= "view_mode">tree_mail_message_quickadds</field>

<field name = "view_id" ref = "mail_message_tree_views" />

<field name="search_view_id" ref="mail.view_message_search"/>

</record>

Avatar
Discard