[FIX] bug 705439

lp bug: https://launchpad.net/bugs/705439 fixed

bzr revid: tfr@openerp.com-20110131110918-4z3kxi5wagvx8f8u
This commit is contained in:
Thibault Francois
2011-01-31 12:09:18 +01:00
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -37,7 +37,7 @@
<separator string="" colspan="6"/>
<group colspan="6" col="4" >
<field name="state" />
<button string="_Cancel" icon="gtk-cancel" special="cancel" />
<button string="_Cancel" icon="gtk-close" special="cancel" />
<button name="action_send" type="object" string="_Send" icon="gtk-go-forward" />
</group>
</form>
@@ -82,7 +82,7 @@
<separator string=" " colspan="4"/>
<group colspan="4" col="3" >
<label string=" " />
<button string="_Cancel" icon="gtk-cancel" special="cancel" />
<button string="_Cancel" icon="gtk-close" special="cancel" />
<button name="action_send" type="object" string="_Send Reply" icon="gtk-go-forward" />
</group>
</form>
+3 -2
View File
@@ -128,7 +128,7 @@ class mailgate_thread(osv.osv):
for case in cases:
attachments = []
for att in attach:
attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])}))
attachments.append(att_obj.create(cr, uid, {'res_model':case._name,'res_id':case.id, 'name': att[0], 'datas': base64.encodestring(att[1])}))
partner_id = hasattr(case, 'partner_id') and (case.partner_id and case.partner_id.id or False) or False
if not partner_id and case._name == 'res.partner':
@@ -220,11 +220,12 @@ class mailgate_message(osv.osv):
action_data = False
action_pool = self.pool.get('ir.actions.act_window')
message_pool = self.browse(cr ,uid, ids, context=context)[0]
att_ids = [x.id for x in message_pool.attachment_ids]
action_ids = action_pool.search(cr, uid, [('res_model', '=', 'ir.attachment')])
if action_ids:
action_data = action_pool.read(cr, uid, action_ids[0], context=context)
action_data.update({
'domain': [('res_id','=',message_pool.res_id),('res_model','=',message_pool.model)],
'domain': [('id','in',att_ids)],
'nodestroy': True
})
return action_data