improve, fix few bugs related to the address
bzr revid: mga@mga-laptop-20081022112513-qal40qf1jzctvji7
This commit is contained in:
parent
1cfd596d72
commit
fcaeacb07a
|
@ -501,9 +501,11 @@ class actions_server(osv.osv):
|
|||
if action.state == 'email':
|
||||
user = config['email_from']
|
||||
subject = action.name
|
||||
|
||||
address = self.get_field_value(cr, uid, str(action.message), action, context)
|
||||
body = self.merge_message(cr, uid, action, context)
|
||||
address = self.get_field_value(cr, uid, action, context)
|
||||
if not address:
|
||||
raise osv.except_osv(_('Error'), _("Please specify the Partner Email address !"))
|
||||
|
||||
body = self.merge_message(cr, uid, str(action.message), action, context)
|
||||
|
||||
if tools.email_send_attach(user, address, subject, body, debug=False) == True:
|
||||
logger.notifyChannel('email', netsvc.LOG_INFO, 'Email successfully send to : %s' % (address))
|
||||
|
@ -522,7 +524,7 @@ class actions_server(osv.osv):
|
|||
# for the sms gateway user / password
|
||||
api_id = ''
|
||||
text = action.sms
|
||||
to = self.get_field_value(cr, uid, str(action.message), action, context)
|
||||
to = self.get_field_value(cr, uid, action, context)
|
||||
#TODO: Apply message mearge with the field
|
||||
if tools.sms_send(user, password, api_id, text, to) == True:
|
||||
logger.notifyChannel('sms', netsvc.LOG_INFO, 'SMS successfully send to : %s' % (action.address))
|
||||
|
|
|
@ -38,7 +38,7 @@ action_type = '''<?xml version="1.0"?>
|
|||
</form>'''
|
||||
|
||||
action_type_fields = {
|
||||
'type': {'string':"Start date",'type':'selection','required':True ,'selection':[('ir.actions.report.xml','Open Report')]},
|
||||
'type': {'string':"Select Action Type",'type':'selection','required':True ,'selection':[('ir.actions.report.xml','Open Report')]},
|
||||
}
|
||||
|
||||
report_action = '''<?xml version="1.0"?>
|
||||
|
@ -60,13 +60,7 @@ class create_action(wizard.interface):
|
|||
|
||||
rpt = reports.browse(cr, uid, form['report'])
|
||||
|
||||
action = """
|
||||
action = {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'model':'%s',
|
||||
'report_name': '%s',
|
||||
'ids': context['active_ids'],
|
||||
}""" % (rpt.model, rpt.report_name)
|
||||
action = """action = {"type": "ir.actions.report.xml","model":"%s","report_name": "%s","ids": context["active_ids"]}""" % (rpt.model, rpt.report_name)
|
||||
|
||||
obj = pool.get('ir.actions.server')
|
||||
obj.write(cr, uid, data['ids'], {'code':action})
|
||||
|
|
Loading…
Reference in New Issue