[IMP] crm, emails,crm_partner_assign:- change model name crm_send_new_email_attachment with crm_add_note_email_attachment in crm module, and bug fix of web-client wizard not close must return thy type:ir.action.act_window.close' in button click

bzr revid: ysa@tinyerp.com-20110225065403-expnty80rkb9m2jr
This commit is contained in:
Yogesh (OpenERP) 2011-02-25 12:24:03 +05:30
parent df503eaf0d
commit 204ecec4f2
4 changed files with 10 additions and 10 deletions

View File

@ -5,8 +5,8 @@ import base64
AVAILABLE_STATES = crm.AVAILABLE_STATES + [('unchanged', 'Unchanged')]
class crm_send_new_email_attachment(osv.osv_memory):
_name = 'crm.send.mail.attachment'
class crm_add_note_email_attachment(osv.osv_memory):
_name = 'crm.add.note.email.attachment'
_columns = {
'binary' : fields.binary('Attachment', required=True),
@ -14,7 +14,7 @@ class crm_send_new_email_attachment(osv.osv_memory):
'wizard_id' : fields.many2one('crm.add.note', 'Wizard', required=True),
}
crm_send_new_email_attachment()
crm_add_note_email_attachment()
class crm_add_note(osv.osv_memory):
"""Adds a new note to the case."""
@ -25,7 +25,7 @@ class crm_add_note(osv.osv_memory):
'body': fields.text('Note Body', required=True),
'state': fields.selection(AVAILABLE_STATES, string='Set New State To',
required=True),
'attachment_ids' : fields.one2many('crm.send.mail.attachment', 'wizard_id'),
'attachment_ids' : fields.one2many('crm.add.note.email.attachment', 'wizard_id'),
}
def action_add(self, cr, uid, ids, context=None):

View File

@ -170,14 +170,14 @@ class crm_lead_forward_to_partner(osv.osv_memory):
context = {}
super(crm_lead_forward_to_partner, self).save_to_drafts(cr, uid, ids, context=context)
self.action_forward(cr, uid, ids, context)
return {}
return {'type': 'ir.actions.act_window_close'}
def send_mail(self, cr, uid, ids, context=None):
if context is None:
context = {}
super(crm_lead_forward_to_partner, self).send_mail(cr, uid, ids, context=context)
self.action_forward(cr, uid, ids, context)
return {}
return {'type': 'ir.actions.act_window_close'}
def action_forward(self, cr, uid, ids, context=None):
"""

View File

@ -133,13 +133,13 @@ class email_template_send_wizard(osv.osv_memory):
context = {}
mailid = self.save_to_mailbox(cr, uid, ids, context=context)
self.pool.get('email.message').write(cr, uid, mailid, {'folder':'drafts', 'state': 'draft'}, context)
return {}
return {'type': 'ir.actions.act_window_close'}
def send_mail(self, cr, uid, ids, context=None):
if context is None:
context = {}
mailid = self.save_to_mailbox(cr, uid, ids, context)
return {}
return {'type': 'ir.actions.act_window_close'}
def get_generated(self, cr, uid, ids=None, context=None):
if ids is None:

View File

@ -141,13 +141,13 @@ class email_compose_message(osv.osv_memory):
context = {}
email_id = self.save_to_mailbox(cr, uid, ids, context=context)
self.pool.get('email.message').write(cr, uid, email_id, {'folder':'drafts', 'state': 'draft'}, context)
return {}
return {'type': 'ir.actions.act_window_close'}
def send_mail(self, cr, uid, ids, context=None):
if context is None:
context = {}
email_id = self.save_to_mailbox(cr, uid, ids, context)
return {}
return {'type': 'ir.actions.act_window_close'}
def save_to_mailbox(self, cr, uid, ids, context=None):
email_ids = []