diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 5d36f49a06e..b6032731fbd 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -60,7 +60,7 @@ class base_action_rule(osv.osv): @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ - return [('','')] + return [('', '')] def priority_get(self, cr, uid, context={}): """ Get Priority @@ -69,78 +69,75 @@ class base_action_rule(osv.osv): @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ - return [('','')] + return [('', '')] _columns = { - 'name': fields.many2one('ir.model', 'Model', required=True), - 'max_level': fields.integer('Max Level', help='Specifies maximum level.'), - 'create_date': fields.datetime('Create Date', readonly=1), + 'name': fields.many2one('ir.model', 'Model', required=True), + 'max_level': fields.integer('Max Level', help='Specifies maximum level.'), + 'create_date': fields.datetime('Create Date', readonly=1), 'active': fields.boolean('Active', help="If the active field is set to true,\ - it will allow you to hide the rule without removing it."), - 'sequence': fields.integer('Sequence', help="Gives the sequence order when\ - displaying a list of rules."), - + it will allow you to hide the rule without removing it."), + 'sequence': fields.integer('Sequence', help="Gives the sequence order \ +when displaying a list of rules."), 'trg_date_type': fields.selection([ - ('none','None'), - ('create','Creation Date'), - ('action_last','Last Action Date'), - ('date','Date'), - ('deadline', 'Deadline'), - ], 'Trigger Date', size=16), - 'trg_date_range': fields.integer('Delay after trigger date',help="Delay After Trigger Date,\ - specifies you can put a negative number " \ - "if you need a delay before the trigger date, like sending a reminder 15 minutes before a meeting."), - 'trg_date_range_type': fields.selection([('minutes', 'Minutes'),('hour','Hours'),\ - ('day','Days'),('month','Months')], 'Delay type'), + ('none', 'None'), + ('create', 'Creation Date'), + ('action_last', 'Last Action Date'), + ('date', 'Date'), + ('deadline', 'Deadline'), + ], 'Trigger Date', size=16), + 'trg_date_range': fields.integer('Delay after trigger date', \ + help="Delay After Trigger Date,\ +specifies you can put a negative number. If you need a delay before the \ +trigger date, like sending a reminder 15 minutes before a meeting."), + 'trg_date_range_type': fields.selection([('minutes', 'Minutes'), ('hour', 'Hours'), \ + ('day', 'Days'), ('month', 'Months')], 'Delay type'), - 'trg_user_id': fields.many2one('res.users', 'Responsible'), + 'trg_user_id': fields.many2one('res.users', 'Responsible'), - 'trg_partner_id': fields.many2one('res.partner', 'Partner'), - 'trg_partner_categ_id': fields.many2one('res.partner.category', 'Partner Category'), - 'trg_state_from': fields.selection(_state_get, 'State', size=16), - 'trg_state_to': fields.selection(_state_get, 'Button Pressed', size=16), - 'trg_priority_from': fields.selection(_priority_get, 'Minimum Priority'), - 'trg_priority_to': fields.selection(_priority_get, 'Maximum Priority'), + 'trg_partner_id': fields.many2one('res.partner', 'Partner'), + 'trg_partner_categ_id': fields.many2one('res.partner.category', 'Partner Category'), + 'trg_state_from': fields.selection(_state_get, 'State', size=16), + 'trg_state_to': fields.selection(_state_get, 'Button Pressed', size=16), + 'trg_priority_from': fields.selection(_priority_get, 'Minimum Priority'), + 'trg_priority_to': fields.selection(_priority_get, 'Maximum Priority'), - '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_priority': fields.selection(_priority_get, 'Set priority to'), - '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 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 this if \ - you want the rule to send an email to the responsible person."), - '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,help="Email-id \ - of the persons whom mail is to be sent"), - 'act_mail_body': fields.text('Mail body',help="Content of mail"), - 'regex_name': fields.char('Regular Expression on Model Name', size=128), - 'server_action_id': fields.many2one('ir.actions.server','Server Action', help="Describes the action name.\neg:on which object which action to be taken on basis of which condition"), - 'filter_id':fields.many2one('ir.filters', 'Filter', required=False), + '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_priority': fields.selection(_priority_get, 'Set priority to'), + '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 \ +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\ + this if you want the rule to send an email to the responsible person."), + '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, \ + help="Email-id of the persons whom mail is to be sent"), + 'act_mail_body': fields.text('Mail body', help="Content of mail"), + 'regex_name': fields.char('Regular Expression on Model Name', size=128), + 'server_action_id': fields.many2one('ir.actions.server', 'Server Action', help="Describes the action name.\neg:on which object which action to be taken on basis of which condition"), + 'filter_id':fields.many2one('ir.filters', 'Filter', required=False), } _defaults = { - 'active': lambda *a: True, - 'max_level': lambda *a: 15, - 'trg_date_type': lambda *a: 'none', - 'trg_date_range_type': lambda *a: 'day', - 'act_mail_to_user': lambda *a: 0, - 'act_remind_partner': lambda *a: 0, - 'act_remind_user': lambda *a: 0, - 'act_mail_to_watchers': lambda *a: 0, + 'active': lambda *a: True, + 'max_level': lambda *a: 15, + 'trg_date_type': lambda *a: 'none', + 'trg_date_range_type': lambda *a: 'day', + 'act_mail_to_user': lambda *a: 0, + 'act_remind_partner': lambda *a: 0, + 'act_remind_user': lambda *a: 0, + 'act_mail_to_watchers': lambda *a: 0, } def format_body(self, body): @@ -154,22 +151,22 @@ class base_action_rule(osv.osv): @param self: The object pointer """ data = { - 'object_id': obj.id, - 'object_subject': hasattr(obj, 'name') and obj.name or False, - 'object_date': hasattr(obj, 'date') and obj.date or False, - 'object_description': hasattr(obj, 'description') and obj.description or False, - 'object_user': hasattr(obj, 'user_id') and (obj.user_id and obj.user_id.name) or '/', + 'object_id': obj.id, + 'object_subject': hasattr(obj, 'name') and obj.name or False, + 'object_date': hasattr(obj, 'date') and obj.date or False, + 'object_description': hasattr(obj, 'description') and obj.description or False, + 'object_user': hasattr(obj, 'user_id') and (obj.user_id and obj.user_id.name) or '/', 'object_user_email': hasattr(obj, 'user_id') and (obj.user_id and \ - obj.user_id.address_id and obj.user_id.address_id.email) or '/', + obj.user_id.address_id and obj.user_id.address_id.email) or '/', 'object_user_phone': hasattr(obj, 'user_id') and (obj.user_id and\ - obj.user_id.address_id and obj.user_id.address_id.phone) or '/', - 'partner': hasattr(obj, 'partner_id') and (obj.partner_id and obj.partner_id.name) or '/', + obj.user_id.address_id and obj.user_id.address_id.phone) or '/', + 'partner': hasattr(obj, 'partner_id') and (obj.partner_id and obj.partner_id.name) or '/', 'partner_email': hasattr(obj, 'partner_address_id') and (obj.partner_address_id and\ - obj.partner_address_id.email) or '/', + obj.partner_address_id.email) or '/', } return self.format_body(body % data) - 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={}): """ send email @param self: The object pointer @param cr: the current row, from the database cursor, @@ -188,7 +185,7 @@ class base_action_rule(osv.osv): emailfrom = tools.ustr(emailfrom) 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)) @@ -243,7 +240,7 @@ class base_action_rule(osv.osv): @param context: A standard dictionary for contextual values """ if action.server_action_id: - context.update({'active_id':obj.id,'active_ids':[obj.id]}) + context.update({'active_id':obj.id, 'active_ids':[obj.id]}) self.pool.get('ir.actions.server').run(cr, uid, [action.server_action_id.id], context) write = {} if hasattr(obj, 'user_id') and action.act_user_id: @@ -322,10 +319,10 @@ class base_action_rule(osv.osv): base = mx.DateTime.strptime(obj.date, '%Y-%m-%d %H:%M:%S') if base: fnct = { - 'minutes': lambda interval: mx.DateTime.RelativeDateTime(minutes=interval), - 'day': lambda interval: mx.DateTime.RelativeDateTime(days=interval), - 'hour': lambda interval: mx.DateTime.RelativeDateTime(hours=interval), - 'month': lambda interval: mx.DateTime.RelativeDateTime(months=interval), + 'minutes': lambda interval: mx.DateTime.RelativeDateTime(minutes=interval), + 'day': lambda interval: mx.DateTime.RelativeDateTime(days=interval), + 'hour': lambda interval: mx.DateTime.RelativeDateTime(hours=interval), + 'month': lambda interval: mx.DateTime.RelativeDateTime(months=interval), } d = base + fnct[action.trg_date_range_type](action.trg_date_range) dt = d.strftime('%Y-%m-%d %H:%M:%S') @@ -367,7 +364,7 @@ class base_action_rule(osv.osv): return True _constraints = [ - (_check_mail, 'Error: The mail is not well formated', ['act_mail_body']), + (_check_mail, 'Error: The mail is not well formated', ['act_mail_body']), ] base_action_rule() diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 47e02b9308f..82c60e64f23 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -160,8 +160,8 @@ class base_action_rule(osv.osv): '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."), + 'act_mail_to_partner': fields.boolean('Mail to partner',help="Check \ +this if you want the rule to send an email to the partner."), } diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index a24143488ad..0b970da2bca 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -100,9 +100,9 @@ class crm_lead(osv.osv, crm_case): select=True, help='Sales team to which Case belongs to.\ Define Responsible user and Email account for mail gateway.'), 'create_date': fields.datetime('Creation Date' , readonly=True), - 'email_cc': fields.text('Watchers Emails', size=252 , help="These people\ - will receive a copy of the future" \ - " communication between partner and users by email"), + 'email_cc': fields.text('Watchers Emails', size=252 , help="These \ +people will receive a copy of the future communication between partner \ +and users by email"), 'description': fields.text('Description'), 'write_date': fields.datetime('Update Date' , readonly=True), diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index e0044d8ecaa..63e785978a9 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -69,8 +69,8 @@ class crm_claim(osv.osv, crm.crm_case): 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \ domain="[('partner_id','=',partner_id)]"), 'email_cc': fields.text('Watchers Emails', size=252 , help="These people\ - will receive a copy of the future" \ - " communication between partner and users by email"), + will receive a copy of the future" \ +" communication between partner and users by email"), 'email_from': fields.char('Email', size=128, help="These people will receive email."), 'partner_name': fields.char("Employee's Name", size=64), 'partner_mobile': fields.char('Mobile', size=32), diff --git a/addons/crm_fundraising/crm_fundraising.py b/addons/crm_fundraising/crm_fundraising.py index adc34900a89..98bd7446068 100644 --- a/addons/crm_fundraising/crm_fundraising.py +++ b/addons/crm_fundraising/crm_fundraising.py @@ -46,8 +46,8 @@ class crm_fundraising(osv.osv, crm.crm_case): 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \ domain="[('partner_id','=',partner_id)]"), 'email_cc': fields.text('Watchers Emails', size=252 , help="These people\ - will receive a copy of the future" \ - " communication between partner and users by email"), + will receive a copy of the future" \ +" communication between partner and users by email"), 'email_from': fields.char('Email', size=128, help="These people will receive email."), 'date_closed': fields.datetime('Closed', readonly=True), 'date': fields.datetime('Date'), diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py index f304cd860a0..ad2c6cbe858 100644 --- a/addons/crm_helpdesk/crm_helpdesk.py +++ b/addons/crm_helpdesk/crm_helpdesk.py @@ -47,17 +47,15 @@ class crm_helpdesk(osv.osv, crm.crm_case): 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \ domain="[('partner_id','=',partner_id)]"), 'email_cc': fields.text('Watchers Emails', size=252 , help="These people\ - will receive a copy of the future" \ - " communication between partner and users by email"), + will receive a copy of the future" \ +" communication between partner and users by email"), 'email_from': fields.char('Email', size=128, help="These people will receive email."), 'date': fields.datetime('Date'), 'ref' : fields.reference('Reference', selection=crm._links_get, size=128), 'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128), 'canal_id': fields.many2one('res.partner.canal', 'Channel', \ help="The channels represent the different communication \ - modes available with the customer." \ - " With each commercial opportunity, you can indicate\ - the canall which is this opportunity source."), + modes available with the customer."), 'planned_revenue': fields.float('Planned Revenue'), 'planned_cost': fields.float('Planned Costs'), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml index b37ea9597bf..7bfb2d0a89c 100644 --- a/addons/crm_helpdesk/crm_helpdesk_view.xml +++ b/addons/crm_helpdesk/crm_helpdesk_view.xml @@ -90,6 +90,7 @@ +