[MERGE]:idea data

bzr revid: apa@tinyerp.com-20120831112701-p9371y8j8u9ujuip
This commit is contained in:
Amit Patel (OpenERP) 2012-08-31 16:57:01 +05:30
commit 54affefe52
2 changed files with 33 additions and 4 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 canceled.'), context=context)
self.message_post(cr, uid, ids, body=_('Idea cancelled.'), 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.'), context=context)
self.message_post(cr, uid, ids, body=_('Idea accepted.'), subtype="open", context=context)
return True
def idea_close(self, cr, uid, ids, context={}):
self.message_post(cr, uid, ids, body=_('Idea done.'), context=context)
self.message_post(cr, uid, ids, body=_('Idea closed.'), 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.'), context=context)
self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), subtype="new", context=context)
self.write(cr, uid, ids, { 'state': 'draft' })
return True
idea_idea()

View File

@ -15,6 +15,35 @@
<record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4,ref('base.group_tool_user'))]"/>
</record>
<!-- SUBTYPE -->
<record id="mail.mail_subtype_new" model="mail.message.subtype">
<field name="name">new</field>
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
<field name="default" eval="False"/>
</record>
<record id="mail.mail_subtype_open" model="mail.message.subtype">
<field name="name">open</field>
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
</record>
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
<field name="name">cancelled</field>
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
<field name="default" eval="False"/>
</record>
<record id="mail.mail_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'))]"/>
</record>
</data>
</openerp>