diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 737bb55b25e..9bbac9428fa 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -211,13 +211,13 @@ - + - + + - diff --git a/addons/crm/wizard/__init__.py b/addons/crm/wizard/__init__.py index 9c14905076f..9e2ccdb0cc3 100644 --- a/addons/crm/wizard/__init__.py +++ b/addons/crm/wizard/__init__.py @@ -19,9 +19,9 @@ # ############################################################################## -import crm_add_note import crm_send_email import crm_forward_to_partner +import crm_add_note import crm_lead_to_partner import crm_lead_to_opportunity diff --git a/addons/crm/wizard/crm_add_note.py b/addons/crm/wizard/crm_add_note.py index 05ae3abc13d..9a8d4f2d4f3 100644 --- a/addons/crm/wizard/crm_add_note.py +++ b/addons/crm/wizard/crm_add_note.py @@ -1,7 +1,7 @@ from crm import crm from osv import fields, osv from tools.translate import _ - +import base64 AVAILABLE_STATES = crm.AVAILABLE_STATES + [('unchanged', 'Unchanged')] @@ -14,7 +14,8 @@ class crm_add_note(osv.osv_memory): _columns = { 'body': fields.text('Note Body', required=True), 'state': fields.selection(AVAILABLE_STATES, string='Set New State To', - required=True), + required=True), + 'attachment_ids' : fields.one2many('crm.send.mail.attachment', 'wizard_id'), } def action_add(self, cr, uid, ids, context=None): @@ -33,8 +34,11 @@ class crm_add_note(osv.osv_memory): case = case_list[0] user_obj = self.pool.get('res.users') user_name = user_obj.browse(cr, uid, [uid], context=context)[0].name - case_pool.history(cr, uid, [case], _("Note"), history=True, - details=obj.body, email_from=user_name) + attach = [ + (x.name, base64.decodestring(x.binary)) for x in obj.attachment_ids + ] + case_pool.history(cr, uid, [case], _("Note"), history=False, + details=obj.body, email_from=user_name, attach=attach) if obj.state == 'unchanged': pass diff --git a/addons/crm/wizard/crm_add_note_view.xml b/addons/crm/wizard/crm_add_note_view.xml index 1e122c19760..f218a4252c1 100644 --- a/addons/crm/wizard/crm_add_note_view.xml +++ b/addons/crm/wizard/crm_add_note_view.xml @@ -10,12 +10,28 @@ form - + + + + + + + + + + + + + + + + + - + diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml index 1938b6bf056..44b1eb34fd8 100644 --- a/addons/crm_claim/crm_claim_view.xml +++ b/addons/crm_claim/crm_claim_view.xml @@ -205,10 +205,14 @@ - + + diff --git a/addons/crm_fundraising/crm_fundraising_view.xml b/addons/crm_fundraising/crm_fundraising_view.xml index 326c4f755a0..84af1b141c9 100644 --- a/addons/crm_fundraising/crm_fundraising_view.xml +++ b/addons/crm_fundraising/crm_fundraising_view.xml @@ -197,7 +197,11 @@ - + diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml index b537c1af38c..375b758f9c7 100644 --- a/addons/crm_helpdesk/crm_helpdesk_view.xml +++ b/addons/crm_helpdesk/crm_helpdesk_view.xml @@ -134,7 +134,11 @@ - + diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 532d26e58b7..deb11c14575 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -409,7 +409,11 @@ - + diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 67d9056c799..6138bf42b99 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -186,11 +186,15 @@ - + - diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index 1a1b48e75ee..b0bc9b3cf2a 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -122,19 +122,22 @@ class mailgate_thread(osv.osv): obj = self.pool.get('mailgate.message') for case in cases: + attachments = [] + for att in attach: + attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])})) + data = { 'name': keyword, 'user_id': uid, 'model' : case._name, 'res_id': case.id, 'date': time.strftime('%Y-%m-%d %H:%M:%S'), - 'message_id': message_id, + 'message_id': message_id, + 'description': details or (hasattr(case, 'description') and case.description or False), + 'attachment_ids': [(6, 0, attachments)] } - attachments = [] - if history: - for att in attach: - attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])})) + if history: for param in (email, email_cc, email_bcc): if isinstance(param, list): param = ", ".join(param) @@ -187,6 +190,8 @@ class mailgate_message(osv.osv): msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t' if message.name == _('Opportunity'): msg_txt += _("Converted to Opportunity") + elif message.name == _('Note'): + msg_txt += _("Added Note: ") + (message.description or '') else: msg_txt += _("Changed Status to: ") + message.name result[message.id] = msg_txt diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index ce3e1312d4a..f3dcca16edc 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -117,7 +117,11 @@ - +