def _check_mail(self, cr, uid, ids, context=None): caseobj = self.pool.get('crm.case') emptycase = orm.browse_null() for rule in self.browse(cr, uid, ids): if rule.act_mail_body: try: caseobj.format_mail(emptycase, rule.act_mail_body) except (ValueError, KeyError, TypeError): return False return True
def _check_mail(self, cr, uid, ids, context=None): """ Check Mail @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Action Rule’s IDs @param context: A standard dictionary for contextual values """ empty = orm.browse_null() rule_obj = self.pool.get('base.action.rule') for rule in self.browse(cr, uid, ids, context=context): if rule.act_mail_body: try: rule_obj.format_mail(empty, rule.act_mail_body) except (ValueError, KeyError, TypeError): return False return True
def _check_mail(self, cr, uid, ids, context=None): """ Check Mail @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Action Rule’s IDs @param context: A standard dictionary for contextual values """ empty = orm.browse_null() rule_obj = self.pool.get("base.action.rule") for rule in self.browse(cr, uid, ids, context=context): if rule.act_mail_body: try: rule_obj.format_mail(empty, rule.act_mail_body) except (ValueError, KeyError, TypeError): return False return True