reput rpa changes from rev:2423

bzr revid: hmo@tinyerp.com-20091029061657-ov79u9gl28e8t465
This commit is contained in:
Harry (Open ERP) 2009-10-29 11:46:57 +05:30
parent b092ca1846
commit 6f74f18802
5 changed files with 35 additions and 5 deletions

View File

@ -42,8 +42,8 @@ MAX_LEVEL = 15
AVAILABLE_STATES = [
('draft','Draft'),
('open','Open'),
('cancel', 'Cancel'),
('done', 'Close'),
('cancel', 'Cancelled'),
('done', 'Closed'),
('pending','Pending')
]

View File

@ -383,10 +383,14 @@
</group>
<field name="history_line" colspan="4" nolabel="1" mode="form,tree">
<form string="Communication history">
<group col="6" colspan="4">
<group col="7" colspan="4">
<field name="date"/>
<field name="email"/>
<field name="canal_id"/>
<button
string="Add a CC"
name="%(wizard_crm_case_email_add_cc)d"
icon="gtk-add" type="action"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>

View File

@ -10,5 +10,11 @@
<menuitem action="wizard_case_section_menu" id="menu_wizard_case_section_menu" parent="crm.menu_crm_configuration" type="wizard"/>
<wizard string="Add a CC"
model="crm.case"
menu = "False"
name="crm.case.email.add_cc"
id="wizard_crm_case_email_add_cc"/>
</data>
</openerp>

View File

@ -23,6 +23,7 @@ import crm_wizard
import wizard_crm_send_email
import wizard_crm_new_send_email
import wizard_fetch_mail
import wizard_add_cc
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -27,6 +27,7 @@ import netsvc
import ir
import pooler
import tools
import base64
from tools.translate import _
@ -39,17 +40,29 @@ email_send_form = '''<?xml version="1.0"?>
<field name="subject"/>
<newline/>
<field name="text" />
<newline/>
<field name="doc1" />
<newline/>
<field name="doc2" />
<newline/>
<field name="doc3" />
</form>'''
email_send_fields = {
'to': {'string':"To", 'type':'char', 'size':64, 'required':True},
'cc': {'string':"CC", 'type':'char', 'size':128,},
'subject': {'string':'Subject', 'type':'char', 'size':128, 'required':True},
'text': {'string':'Message', 'type':'text_tag', 'required':True}
'text': {'string':'Message', 'type':'text_tag', 'required':True},
'doc1' : {'string':"Attachment1", 'type':'binary'},
'doc2' : {'string':"Attachment2", 'type':'binary'},
'doc3' : {'string':"Attachment3", 'type':'binary'},
}
# this sends an email to ALL the addresses of the selected partners.
def _mass_mail_send(self, cr, uid, data, context):
attach = filter(lambda x: x, [data['form']['doc1'], data['form']['doc2'], data['form']['doc3']])
attach = map(lambda x: x and ('Attachment'+str(attach.index(x)+1), base64.decodestring(x)), attach)
pool = pooler.get_pool(cr.dbname)
case_pool=pool.get('crm.case')
@ -64,14 +77,20 @@ def _mass_mail_send(self, cr, uid, data, context):
body = data['form']['text']
if case.user_id.signature:
body += '\n\n%s' % (case.user_id.signature)
tools.email_send(
flag = tools.email_send(
case.user_id.address_id.email,
emails,
data['form']['subject'],
body,
attach=attach
case_pool.format_body(body),
reply_to=case.section_id.reply_to,
tinycrm=str(case.id)
)
if flag:
raise wizard.except_wizard(_('Message!'),("Email Successfully Sent..!!"))
else:
raise wizard.except_wizard(_('Warning!'),("Email is not sent Successfully"))
return {}
def _get_info(self, cr, uid, data, context):