[IMP]changed in idea for subtype

bzr revid: sgo@tinyerp.com-20120913070333-8mvke4g0h13r6e6d
This commit is contained in:
Sanjay Gohel (Open ERP) 2012-09-13 12:33:33 +05:30
parent 66e8595b01
commit 97026e96d3
2 changed files with 12 additions and 21 deletions

View File

@ -67,21 +67,21 @@ class idea_idea(osv.osv):
def idea_cancel(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, { 'state': 'cancel' })
self.message_post(cr, uid, ids, body=_('Idea cancelled.'), subtype="cancelled", context=context)
self.message_post(cr, uid, ids, body=_('Idea cancelled.'), subtype_xml_id="idea_subtype_cancelled", context=context)
return True
def idea_open(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, { 'state': 'open'})
self.message_post(cr, uid, ids, body=_('Idea accepted.'), subtype="open", context=context)
self.message_post(cr, uid, ids, body=_('Idea accepted.'), subtype_xml_id="idea_subtype_open", context=context)
return True
def idea_close(self, cr, uid, ids, context={}):
self.message_post(cr, uid, ids, body=_('Idea closed.'), subtype="closed", context=context)
self.message_post(cr, uid, ids, body=_('Idea closed.'), subtype_xml_id="idea_subtype_closed", context=context)
self.write(cr, uid, ids, { 'state': 'close' })
return True
def idea_draft(self, cr, uid, ids, context={}):
self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), subtype="new", context=context)
self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), subtype_xml_id="idea_subtype_new", context=context)
self.write(cr, uid, ids, { 'state': 'draft' })
return True
idea_idea()

View File

@ -17,32 +17,23 @@
</record>
<!-- SUBTYPE -->
<record id="mail.mail_subtype_new" model="mail.message.subtype">
<record id="mail.idea_subtype_new" model="mail.message.subtype">
<field name="name">new</field>
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
<field name="res_model">idea.idea</field>
<field name="default" eval="False"/>
</record>
<record id="mail.mail_subtype_open" model="mail.message.subtype">
<record id="mail.idea_subtype_open" model="mail.message.subtype">
<field name="name">open</field>
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
<field name="res_model">idea.idea</field>
</record>
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
<record id="mail.idea_subtype_cancelled" model="mail.message.subtype">
<field name="name">cancelled</field>
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
<field name="res_model">idea.idea</field>
<field name="default" eval="False"/>
</record>
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
<record id="mail.idea_subtype_closed" model="mail.message.subtype">
<field name="name">closed</field>
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
</record>
<record id="mail.mail_subtype_email" model="mail.message.subtype">
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
</record>
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
</record>
<record id="mail.mail_subtype_other" model="mail.message.subtype">
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
<field name="res_model">idea.idea</field>
</record>
</data>
</openerp>