[IMP]:default work with demo data and remove readonly from subtype

bzr revid: apa@tinyerp.com-20120829064243-w0y3k6c3uxcqruzm
This commit is contained in:
Amit Patel (OpenERP)
2012-08-29 12:12:43 +05:30
parent 205c8453ea
commit 7c3569385f
4 changed files with 5 additions and 5 deletions
+3 -1
View File
@@ -278,9 +278,11 @@ class crm_lead(base_stage, osv.osv):
def create(self, cr, uid, vals, context=None):
obj_id = super(crm_lead, self).create(cr, uid, vals, context)
subtype_obj = self.pool.get('mail.message.subtype');
subtype_ids = subtype_obj.search(cr, uid, [('default', '=', 'true'),('model_ids.model', '=', 'crm.lead')])
record = self.browse(cr, uid, obj_id, context)
if record.user_id:
self.message_subscribe(cr, uid, [obj_id], [record.user_id.id], context = context)
self.message_subscribe(cr, uid, [obj_id], [record.user_id.id], subtype_ids,context = context)
self.create_send_note(cr, uid, [obj_id], context=context)
return obj_id
+1 -1
View File
@@ -1051,7 +1051,7 @@ class mail_thread(osv.Model):
write_res = self.write(cr, uid, ids, {'message_follower_ids': self.message_subscribe_get_command(cr, uid, to_subscribe_uids, context)}, context=context)
follower_ids = [follower.id for thread in self.browse(cr, uid, ids, context=context) for follower in thread.message_follower_ids]
if subtype_ids:
self.pool.get('mail.followers').write(cr, uid, follower_ids, {'subtype_ids': [(6, 0, subtype_ids)]}, context=context)
self.message_subscribe_udpate_subtypes(cr, uid, ids, user_ids, subtype_ids, context=context)
return follower_ids
def message_subscribe_get_command(self, cr, uid, follower_ids, context=None):
@@ -101,7 +101,6 @@ openerp_mail_followers = function(session, mail) {
display_subscribers: function (records) {
var self = this;
this.is_subscriber = false;
if (self.view.get("actual_mode") === "edit"){self.update_subtype();}
var user_list = this.$el.find('ul.oe_mail_followers_display').empty();
this.$el.find('div.oe_mail_recthread_followers h4').html(this.params.title + ' (' + records.length + ')');
_(records).each(function (record) {
@@ -40,8 +40,7 @@
<a t-attf-href="#model=mail.message.subtype&amp;id=#{record.id}"><t t-raw="record.name"/></a>
</td>
<td width="10%">
<t t-if ="record.default"><input type="checkbox" t-att-id="record.id" t-att-name="record.name" checked="true" class="oe_msg_subtype_check" disabled="disabled"/></t>
<t t-if ="! record.default"><input type="checkbox" t-att-id="record.id" t-att-name="record.name" class="oe_msg_subtype_check"/></t>
<input type="checkbox" t-att-id="record.id" t-att-name="record.name" class="oe_msg_subtype_check"/>
</td>
</tr>
</table>