[MERGE] merged rha work
bzr revid: hmo@tinyerp.com-20110405122851-lcl20234q2v5upt1
This commit is contained in:
commit
6c068b748d
|
@ -1,43 +1,43 @@
|
|||
-
|
||||
In order to test Forward Partner functionality, I create an opportunity and forward it to partner.
|
||||
-
|
||||
-
|
||||
I assign an email address to Administrator.
|
||||
-
|
||||
-
|
||||
!record {model: res.users, id: base.user_root}:
|
||||
user_email: admin@openerp.com
|
||||
-
|
||||
-
|
||||
I create some partner grades.
|
||||
-
|
||||
I create a grade 'First'.
|
||||
-
|
||||
-
|
||||
!record {model: res.partner.grade, id: res_partner_grade_first0}:
|
||||
name: First
|
||||
sequence: 1
|
||||
-
|
||||
-
|
||||
I create another grade 'Second'.
|
||||
-
|
||||
-
|
||||
!record {model: res.partner.grade, id: res_partner_grade_second0}:
|
||||
name: Second
|
||||
sequence: 2
|
||||
-
|
||||
-
|
||||
I create one more grade 'Third'.
|
||||
-
|
||||
-
|
||||
!record {model: res.partner.grade, id: res_partner_grade_third0}:
|
||||
name: Third
|
||||
sequence: 3
|
||||
-
|
||||
-
|
||||
I assign grade 'First' to the partner 'Axelor'.
|
||||
-
|
||||
-
|
||||
!record {model: res.partner, id: base.res_partner_desertic_hispafuentes}:
|
||||
grade_id: res_partner_grade_first0
|
||||
-
|
||||
I assgin a reply-to email address to Sales Team.
|
||||
-
|
||||
-
|
||||
!record {model: crm.case.section, id: crm.section_sales_department}:
|
||||
reply_to: sales_openerp@openerp.com
|
||||
-
|
||||
-
|
||||
I create an opportunity 'Questionnaire on OpenERP'.
|
||||
-
|
||||
-
|
||||
!record {model: crm.lead, id: crm_lead_questionnaireonopenerp0}:
|
||||
categ_id: crm.categ_oppor7
|
||||
section_id: crm.section_sales_department
|
||||
|
@ -62,7 +62,7 @@
|
|||
!python {model: crm.lead.forward.to.partner}: |
|
||||
import tools
|
||||
vals = {
|
||||
'name': 'email',
|
||||
'subject': 'email',
|
||||
'email_to': 'info@axelor.com',
|
||||
'email_from': 'Administrator <admin@openerp.com>',
|
||||
'reply_to': 'sales_openerp@openerp.com'
|
||||
|
@ -70,4 +70,4 @@
|
|||
ids = self.create(cr, uid, vals, context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
|
||||
assert tools.config.get('smtp_user', False), 'SMTP not configured !'
|
||||
self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
|
||||
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
|||
addr = partner_obj.address_get(cr, uid, [partner_id], ['contact'])
|
||||
data = {'address_id': addr['contact']}
|
||||
data.update(self.on_change_address(cr, uid, ids, addr['contact'])['value'])
|
||||
|
||||
|
||||
partner = partner_obj.browse(cr, uid, [partner_id])
|
||||
user_id = partner and partner[0].user_id or False
|
||||
email = user_id and user_id.user_email or ''
|
||||
|
@ -285,8 +285,8 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
|||
|
||||
body = self._get_case_history(cr, uid, defaults.get('history', 'latest'), lead.id, context=context)
|
||||
defaults.update({
|
||||
'name' : '%s: %s' % (_('Fwd'), lead.name),
|
||||
'description' : body,
|
||||
'subject' : '%s: %s' % (_('Fwd'), lead.name),
|
||||
'body' : body,
|
||||
'email_cc' : ''
|
||||
})
|
||||
return defaults
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
|
||||
<act_window
|
||||
context="{'search_default_server_id': [active_id], 'default_server_id': active_id}"
|
||||
id="act_server_history" name="Emails"
|
||||
id="act_server_history" name="Messages" domain="[('history', '=', True), ('server_id', '=', active_id)]"
|
||||
res_model="email.message" src_model="email.server"/>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -188,6 +188,7 @@ class email_message(osv.osv):
|
|||
('sent', 'Sent'),
|
||||
('received', 'Received'),
|
||||
('exception', 'Exception'),
|
||||
('cancel', 'Cancelled'),
|
||||
], 'State', readonly=True),
|
||||
'auto_delete': fields.boolean('Auto Delete', help="Permanently delete emails after sending"),
|
||||
}
|
||||
|
@ -454,6 +455,13 @@ class email_message(osv.osv):
|
|||
self.write(cr, uid, [message.id], {'state':'exception'}, context)
|
||||
return False
|
||||
return True
|
||||
|
||||
def do_cancel(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
Cancel the email to be send
|
||||
'''
|
||||
self.write(cr, uid, ids, {'state':'cancel'}, context)
|
||||
return True
|
||||
# OLD Code.
|
||||
# def send_all_mail(self, cr, uid, ids=None, context=None):
|
||||
# if ids is None:
|
||||
|
|
|
@ -40,12 +40,16 @@
|
|||
</group>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="body" nolabel="1" colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
<separator string="" colspan="4"/>
|
||||
<field name="state" attrs="{'invisible': [('state', '==', False)]}"/>
|
||||
<button name="%(action_email_compose_message_wizard)d" string="Reply" type="action" icon="terp-mail-replied"
|
||||
context="{'mail':'reply', 'message_id':active_id}" colspan="2"/>
|
||||
<button name="process_email_queue" string="Force send" type="object" icon="gtk-execute" states='exception' colspan="2"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="state" colspan="2"/>
|
||||
<group col="4" colspan="2">
|
||||
<button name="%(action_email_compose_message_wizard)d" string="Reply" type="action" icon="terp-mail-replied"
|
||||
context="{'mail':'reply', 'message_id':active_id}" states='received,outgoing,sent,exception,cancel'/>
|
||||
<button name="send_email" string="Force Send" type="object" icon="gtk-execute" states='outgoing'/>
|
||||
<button name="process_retry" string="Send Again" type="object" icon="gtk-execute" states='exception,cancel'/>
|
||||
<button name="do_cancel" string="Cancel" type="object" icon="terp-gtk-stop" states='outgoing'/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
|
@ -73,7 +77,7 @@
|
|||
<field name="model">email.message</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Emails">
|
||||
<tree string="Emails" colors="grey:state in ('sent', 'cancel');blue:state=='outgoing';red:state=='exception';black:state=='received'">
|
||||
<field name="date"/>
|
||||
<field name="subject"/>
|
||||
<field name="email_from"/>
|
||||
|
@ -94,7 +98,8 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Email Search">
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-call-start" string="Waiting" domain="[('state','=','waiting')]"/>
|
||||
<filter icon="terp-camera_test" string="Received" domain="[('state','=','received')]"/>
|
||||
<filter icon="terp-call-start" name="outgoing" string="Outgoing" domain="[('state','=','outgoing')]"/>
|
||||
<filter icon="terp-gtk-stop" string="Exception" domain="[('state','=','exception')]"/>
|
||||
<field name="email_from"/>
|
||||
<field name="subject"/>
|
||||
|
@ -121,6 +126,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('history', '=', True)]</field>
|
||||
<field name="context">{'search_default_outgoing':1}</field>
|
||||
<field name="search_view_id" ref="view_email_message_search"/>
|
||||
</record>
|
||||
|
||||
|
|
Loading…
Reference in New Issue