From f30e575df8f6baecd8f413078e6a156c2d3a79c9 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Thu, 20 May 2010 15:33:05 +0530 Subject: [PATCH] [IMP]: crm, base_action_rule, mailgateway: Minor Improvement + typo bzr revid: rpa@tinyerp.com-20100520100305-qj9u0fltesw968nv --- addons/base_action_rule/base_action_rule.py | 14 ++++++------- addons/crm/crm.py | 11 ----------- addons/crm/crm_action_rule.py | 22 ++++++++++----------- addons/mail_gateway/mail_gateway_view.xml | 4 ++-- 4 files changed, 20 insertions(+), 31 deletions(-) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index a1213dd7542..519c766fb7d 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -93,20 +93,20 @@ trigger date, like sending a reminder 15 minutes before a meeting."), 'trg_state_to': fields.selection(_state_get, 'Button Pressed', size=16), 'act_method': fields.char('Call Object Method', size=64), - 'act_user_id': fields.many2one('res.users', 'Set responsible to'), - 'act_state': fields.selection(_state_get, 'Set state to', size=16), - 'act_email_cc': fields.char('Add watchers (Cc)', size=250, help="\ + 'act_user_id': fields.many2one('res.users', 'Set Responsible to'), + 'act_state': fields.selection(_state_get, 'Set State to', size=16), + 'act_email_cc': fields.char('Add Watchers (Cc)', size=250, help="\ These people will receive a copy of the future communication between partner \ and users by email"), 'act_remind_partner': fields.boolean('Remind Partner', help="Check \ this if you want the rule to send a reminder by email to the partner."), - 'act_remind_user': fields.boolean('Remind responsible', help="Check \ + 'act_remind_user': fields.boolean('Remind Responsible', help="Check \ this if you want the rule to send a reminder by email to the user."), 'act_reply_to': fields.char('Reply-To', size=64), - 'act_remind_attach': fields.boolean('Remind with attachment', help="Check this if you want that all documents attached to the object be attached to the reminder email sent."), - 'act_mail_to_user': fields.boolean('Mail to responsible', help="Check\ + 'act_remind_attach': fields.boolean('Remind with Attachment', help="Check this if you want that all documents attached to the object be attached to the reminder email sent."), + 'act_mail_to_user': fields.boolean('Mail to Responsible', help="Check\ this if you want the rule to send an email to the responsible person."), - 'act_mail_to_watchers': fields.boolean('Mail to watchers (CC)', + 'act_mail_to_watchers': fields.boolean('Mail to Watchers (CC)', help="Check this if you want \ the rule to mark CC(mail to any other person defined in actions)."), 'act_mail_to_email': fields.char('Mail to these emails', size=128, \ diff --git a/addons/crm/crm.py b/addons/crm/crm.py index da76a0d09b3..9410d3efabd 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -207,17 +207,6 @@ class crm_case(object): mailgate_pool = self.pool.get('mailgate.thread') return mailgate_pool._history(cr, uid, cases, keyword, history=history, email=email, details=details, email_from=email_from, message_id=message_id, context=context) - def _action(self, cr, uid, cases, state_to, scrit=None, context={}): - if not context: - context = {} - context['state_to'] = state_to - rule_obj = self.pool.get('base.action.rule') - model_obj = self.pool.get('ir.model') - model_ids = model_obj.search(cr, uid, [('model','=',self._name)]) - rule_ids = rule_obj.search(cr, uid, [('name','=',model_ids[0])]) - return rule_obj._action(cr, uid, rule_ids, cases, scrit=scrit, context=context) - - def case_open(self, cr, uid, ids, *args): """Opens Case @param self: The object pointer diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index ee5e3d357c8..3a14659672a 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -40,18 +40,18 @@ class base_action_rule(osv.osv): _description = 'Action Rules' _columns = { - 'trg_section_id': fields.many2one('crm.case.section', 'Sales Team'), - 'trg_max_history': fields.integer('Maximum Communication History'), - 'trg_categ_id': fields.many2one('crm.case.categ', 'Category'), - 'regex_history' : fields.char('Regular Expression on Case History', size=128), - 'act_section_id': fields.many2one('crm.case.section', 'Set Team to'), - 'act_categ_id': fields.many2one('crm.case.categ', 'Set Category to'), - 'act_mail_to_partner': fields.boolean('Mail to partner',help="Check \ -this if you want the rule to send an email to the partner."), + 'trg_section_id': fields.many2one('crm.case.section', 'Sales Team'), + 'trg_max_history': fields.integer('Maximum Communication History'), + 'trg_categ_id': fields.many2one('crm.case.categ', 'Category'), + 'regex_history' : fields.char('Regular Expression on Case History', size=128), + 'act_section_id': fields.many2one('crm.case.section', 'Set Team to'), + 'act_categ_id': fields.many2one('crm.case.categ', 'Set Category to'), + 'act_mail_to_partner': fields.boolean('Mail to Partner', help="Check \ +this if you want the rule to send an email to the partner."), } - def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from',False), context={}): + def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from', False), context={}): body = self.format_mail(obj, body) if not emailfrom: if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.address_id and obj.user_id.address_id.email: @@ -64,7 +64,7 @@ this if you want the rule to send an email to the partner."), else: reply_to = emailfrom if not emailfrom: - raise osv.except_osv(_('Error!'), + raise osv.except_osv(_('Error!'), _("No E-Mail ID Found for your Company address!")) return tools.email_send(emailfrom, emails, name, body, reply_to=reply_to, openobject_id=str(obj.id)) @@ -139,7 +139,7 @@ this if you want the rule to send an email to the partner."), @param context: A standard dictionary for contextual values """ res = super(base_action_rule, self).state_get(cr, uid, context=context) - return res + [('escalate','Escalate')] + crm.AVAILABLE_STATES + return res + [('escalate', 'Escalate')] + crm.AVAILABLE_STATES def priority_get(self, cr, uid, context={}): diff --git a/addons/mail_gateway/mail_gateway_view.xml b/addons/mail_gateway/mail_gateway_view.xml index d73946a842c..8b26d5ee47a 100644 --- a/addons/mail_gateway/mail_gateway_view.xml +++ b/addons/mail_gateway/mail_gateway_view.xml @@ -147,12 +147,12 @@ - - + -->