[IMP] Added EDIT button in message_followers template for editing the subtypes of the users.

bzr revid: psa@tinyerp.com-20130305125442-z8h470slga4d77ll
This commit is contained in:
Paramjit Singh Sahota
2013-03-05 18:24:42 +05:30
parent 9809dd5a43
commit 73cf8d29f9
4 changed files with 40 additions and 1 deletions
+14 -1
View File
@@ -5,7 +5,6 @@
<record model="ir.ui.view" id="view_message_subtype_tree">
<field name="name">mail.message.subtype.tree</field>
<field name="model">mail.message.subtype</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<tree string="Subtype">
<field name="name"/>
@@ -34,11 +33,25 @@
</field>
</record>
<record model="ir.ui.view" id="view_edit_message_subtype_tree">
<field name="name">edit.message.subtype.tree</field>
<field name="model">mail.message.subtype</field>
<field name="priority">9</field>
<field name="arch" type="xml">
<tree string="Edit Subtype" editable="top">
<field name="name"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_message_subtype">
<field name="name">Subtypes</field>
<field name="res_model">mail.message.subtype</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_message_subtype_tree"/>
</record>
<menuitem name="Subtypes" id="menu_message_subtype" parent="base.menu_email" action="action_view_message_subtype"/>
+6
View File
@@ -617,6 +617,12 @@
right: 0px;
line-height: 20px;
}
.openerp .oe_followers .oe_edit_subtype{
cursor: pointer;
line-height: 26px;
position: absolute;
right: 12px;
}
.openerp .oe_followers .oe_show_more{
cursor: pointer;
@@ -74,10 +74,29 @@ openerp_mail_followers = function(session, mail) {
this.$el.on('click', '.oe_subtype_list input', self.do_update_subscription);
// event: click on 'invite' button, that opens the invite wizard
this.$('.oe_invite').on('click', self.on_invite_follower);
this.$el.on('click', '.oe_edit_subtype', self.on_edit_subtype);
this.$el.on('click', '.oe_remove_follower', self.on_remove_follower);
this.$el.on('click', '.oe_show_more', self.on_show_more_followers)
},
on_edit_subtype: function() {
var self = this;
var action = {
type: 'ir.actions.act_window',
res_model: 'mail.message.subtype',
domain: [['res_model','=', self.view.model]],
view_mode: 'list',
view_type: 'list',
views: [[false, 'list']],
target: 'new',
}
this.do_action(action, {
on_close: function() {
self.read_value();
},
});
},
on_invite_follower: function (event) {
var self = this;
var action = {
@@ -32,6 +32,7 @@
<div t-name="mail.followers.partner" class='oe_partner'>
<img class="oe_mail_thumbnail oe_mail_frame" t-attf-src="{record.avatar_url}"/>
<a t-attf-href="#model=res.partner&amp;id=#{record.id}"><t t-raw="record.name"/></a>
<a t-if="widget.view_is_editable" class="oe_edit_subtype" title="Edit Subtype" t-att-data-id="record.id">Edit</a>
<span t-if="widget.view_is_editable" class="oe_remove_follower oe_e" title="Remove this follower" t-att-data-id="record.id">X</span>
</div>