From 44284e33ff674738f9c01f43a330578e4648eca0 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 23 Apr 2010 17:44:35 +0530 Subject: [PATCH 01/11] [IMP]: crm: Improvement in demo of meeting: Changed wrong date deadlines according to duration bzr revid: rpa@tinyerp.com-20100423121435-1bqs3bn38bwqr9j0 --- addons/crm/crm_meeting_demo.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/crm/crm_meeting_demo.xml b/addons/crm/crm_meeting_demo.xml index a43f3e0d571..87d49d2f635 100644 --- a/addons/crm/crm_meeting_demo.xml +++ b/addons/crm/crm_meeting_demo.xml @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -48,9 +48,9 @@ - + - + @@ -62,9 +62,9 @@ - + - + @@ -76,7 +76,7 @@ - + @@ -91,7 +91,7 @@ - + From be5e13ab5ac582448491aa1b3f5a255017be938a Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 23 Apr 2010 18:10:21 +0530 Subject: [PATCH 02/11] [IMP]: base_calendar: [573]: Improvment for changing duration when dates changed from sunbird bzr revid: rpa@tinyerp.com-20100423124021-0z23njkojxxrd1xk --- addons/base_calendar/base_calendar.py | 48 ++++++++++++++++++++- addons/base_calendar/base_calendar_view.xml | 2 +- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index f4f1e68a269..372218b8088 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -29,6 +29,7 @@ import pytz import re import time import tools +from caldav import caldav months = { 1: "January", 2: "February", 3: "March", 4: "April", \ @@ -1213,7 +1214,52 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\ if isinstance(select, (str, int, long)): return ids and ids[0] or False return ids - + + def check_import(self, cr, uid, vals, context={}): + """ + @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 vals: Get Values + @param context: A standard dictionary for contextual values + """ + ids = [] + model_obj = self.pool.get(context.get('model')) + recur_pool = {} + try: + for val in vals: + exists, r_id = caldav.uid2openobjectid(cr, val['id'], context.get('model'), \ + val.get('recurrent_id')) + if val.has_key('create_date'): val.pop('create_date') + u_id = val.get('id', None) + val.pop('id') + if exists and r_id: + val.update({'recurrent_uid': exists}) + model_obj.write(cr, uid, [r_id], val) + ids.append(r_id) + elif exists: + # Compute value of duration + if 'date_deadline' in val and 'duration' not in val: + start = datetime.strptime(val['date'], '%Y-%m-%d %H:%M:%S') + end = datetime.strptime(val['date_deadline'], '%Y-%m-%d %H:%M:%S') + diff = end - start + val['duration'] = (diff.seconds/float(86400) + diff.days) * 24 + model_obj.write(cr, uid, [exists], val) + ids.append(exists) + else: + if u_id in recur_pool and val.get('recurrent_id'): + val.update({'recurrent_uid': recur_pool[u_id]}) + revent_id = model_obj.create(cr, uid, val) + ids.append(revent_id) + else: + event_id = model_obj.create(cr, uid, val) + recur_pool[u_id] = event_id + ids.append(event_id) + except Exception, e: + raise osv.except_osv(('Error !'), (str(e))) + return ids + + def compute_rule_string(self, cr, uid, datas, context=None, *args): """ Compute rule string. diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml index 2a48c0be32f..d9acae67a9e 100755 --- a/addons/base_calendar/base_calendar_view.xml +++ b/addons/base_calendar/base_calendar_view.xml @@ -190,7 +190,7 @@ + on_change="onchange_dates(date,duration,False,allday)" attrs="{'invisible': [('allday', '=', True)]}"/> From a056b92602dbe59daee8e439c8dfb645581f0316 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 23 Apr 2010 19:15:33 +0530 Subject: [PATCH 03/11] [FIX]: document_ftp: Fixed problem of importing ics file bzr revid: rpa@tinyerp.com-20100423134533-t8c53tctk7zy6191 --- addons/document_ftp/ftpserver/abstracted_fs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/document_ftp/ftpserver/abstracted_fs.py b/addons/document_ftp/ftpserver/abstracted_fs.py index 0ffa8eb80f2..1957b2db84c 100644 --- a/addons/document_ftp/ftpserver/abstracted_fs.py +++ b/addons/document_ftp/ftpserver/abstracted_fs.py @@ -97,7 +97,7 @@ class content_wrapper(StringIO.StringIO): cr = db.cursor() cr.commit() try: - getattr(self.pool.get('document.directory.content'), 'process_write_'+self.node.content.extension[1:])(cr, self.uid, self.node, self.getvalue()) + getattr(self.pool.get('document.directory.content'), 'process_write')(cr, self.uid, self.node, self.getvalue()) finally: cr.commit() cr.close() From c2fbbe586585cb2b0a7392182621e341844a40b3 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Mon, 26 Apr 2010 19:05:10 +0530 Subject: [PATCH 04/11] [IMP]: smtpclient: typo bzr revid: rpa@tinyerp.com-20100426133510-thuye8gps8wjgwix --- addons/smtpclient/smtpclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/smtpclient/smtpclient.py b/addons/smtpclient/smtpclient.py index eff5e240dff..643af432d4f 100644 --- a/addons/smtpclient/smtpclient.py +++ b/addons/smtpclient/smtpclient.py @@ -531,8 +531,8 @@ class smtpclient(osv.osv): sids = queue.search(cr, uid, [('state','not in',['send','sending']), ('server_id','in',ids)], order="priority", limit=30) message = "" - if len(ids) > 0: - message = "sending %s emails from message queuq !" % (len(ids)) + if len(sids) > 0: + message = "sending %s emails from message queue !" % (len(sids)) logger.notifyChannel('smtp', netsvc.LOG_INFO, message) result = self. _send_emails(cr, uid, sids, {}) From 78c9835966fceddd3a9ef42924131d79195d575d Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Mon, 26 Apr 2010 19:11:52 +0530 Subject: [PATCH 05/11] [FIX]: crm: Fixed problem of sending a new mail bzr revid: rpa@tinyerp.com-20100426134152-e961yh0s7vuxkfox --- addons/crm/wizard/crm_send_email.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py index 7054c77cb90..02a432331b5 100644 --- a/addons/crm/wizard/crm_send_email.py +++ b/addons/crm/wizard/crm_send_email.py @@ -76,7 +76,7 @@ class crm_send_new_email(osv.osv_memory): case = case_pool.browse(cr, uid, res_id) if context.get('mail', 'new') == 'new': - message_id = case.history_line[0].message_id + message_id = res_id else: hist = hist_obj.browse(cr, uid, res_id) message_id = hist.message_id From 6b404a6b4c8244e63b9faa7a569a7fcd251d5537 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Mon, 26 Apr 2010 19:13:57 +0530 Subject: [PATCH 06/11] [IMP]: crm(Meeting): Improvement for all day meeting bzr revid: rpa@tinyerp.com-20100426134357-qc1lrza962m0il7z --- addons/crm/crm_meeting_view.xml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index 35415a9d028..4c4856f46b0 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -25,12 +25,15 @@
- - + + + + + From 031d2f14929c907ad159058054dbfc206c7ec60d Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Mon, 26 Apr 2010 19:15:17 +0530 Subject: [PATCH 07/11] [IMP]: base_action_rule: Removed rule lines object and made changes accroding to it bzr revid: rpa@tinyerp.com-20100426134517-jtqsvu18vh7j3hql --- addons/base_action_rule/base_action_rule.py | 306 ++++++++---------- .../base_action_rule_view.xml | 81 ++--- .../security/ir.model.access.csv | 1 - addons/crm/crm_action_rule.py | 37 +-- addons/crm/crm_action_rule_view.xml | 18 +- 5 files changed, 188 insertions(+), 255 deletions(-) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index df2d43d3a53..6eb45172dbc 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -33,18 +33,115 @@ class base_action_rule(osv.osv): _name = 'base.action.rule' _description = 'Action Rules' + + def _state_get(self, cr, uid, context={}): + """ Get State + @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 context: A standard dictionary for contextual values """ + + return self.state_get(cr, uid, context=context) + + + def _priority_get(self, cr, uid, context={}): + """ Get Priority + @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 context: A standard dictionary for contextual values """ + + return self.priority_get(cr, uid, context=context) + + def state_get(self, cr, uid, context={}): + """ Get State + @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 context: A standard dictionary for contextual values """ + + return [('','')] + + def priority_get(self, cr, uid, context={}): + """ Get Priority + @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 context: A standard dictionary for contextual values """ + + return [('','')] _columns = { 'name': fields.many2one('ir.model', 'Model', required=True), 'max_level': fields.integer('Max Level', help='Specifies maximum level.'), - 'rule_lines': fields.one2many('base.action.rule.line','rule_id','Rule Lines'), 'create_date': fields.datetime('Create Date', readonly=1), - 'active': fields.boolean('Active') + '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."), + + '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'), + + + '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'), + + '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." \ + "eg:on which object which action to be taken on basis of which condition"), } _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, } def format_body(self, body): @@ -201,175 +298,56 @@ class base_action_rule(osv.osv): if not scrit: scrit = [] - rule_line_obj = self.pool.get('base.action.rule.line') - for rule in self.browse(cr, uid, ids): - level = rule.max_level + for action in self.browse(cr, uid, ids): + level = action.max_level if not level: break - newactions = [] - scrit += [('rule_id','=',rule.id)] - line_ids = rule_line_obj.search(cr, uid, scrit) - actions = rule_line_obj.browse(cr, uid, line_ids, context=context) - model_obj = self.pool.get(rule.name.model) + model_obj = self.pool.get(action.name.model) for obj in objects: - for action in actions: - ok = self.do_check(cr, uid, action, obj, context=context) - if not ok: - continue + ok = self.do_check(cr, uid, action, obj, context=context) + if not ok: + continue - base = False - if hasattr(obj, 'create_date') and action.trg_date_type=='create': - base = mx.DateTime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S') - elif hasattr(obj, 'create_date') and action.trg_date_type=='action_last': - if hasattr(obj, 'date_action_last') and obj.date_action_last: - base = mx.DateTime.strptime(obj.date_action_last, '%Y-%m-%d %H:%M:%S') - else: - base = mx.DateTime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S') - elif hasattr(obj, 'date_deadline') and action.trg_date_type=='deadline' \ - and obj.date_deadline: - base = mx.DateTime.strptime(obj.date_deadline, '%Y-%m-%d %H:%M:%S') - elif hasattr(obj, 'date') and action.trg_date_type=='date' and obj.date: - 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), - } - d = base + fnct[action.trg_date_range_type](action.trg_date_range) - dt = d.strftime('%Y-%m-%d %H:%M:%S') - ok = False - if hasattr(obj, 'date_action_last') and hasattr(obj, 'date_action_next'): - ok = (dt <= time.strftime('%Y-%m-%d %H:%M:%S')) and \ - ((not obj.date_action_next) or \ - (dt >= obj.date_action_next and \ - obj.date_action_last < obj.date_action_next)) - if not ok: - if not obj.date_action_next or dt < obj.date_action_next: - obj.date_action_next = dt - model_obj.write(cr, uid, [obj.id], {'date_action_next': dt}, context) + base = False + if hasattr(obj, 'create_date') and action.trg_date_type=='create': + base = mx.DateTime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S') + elif hasattr(obj, 'create_date') and action.trg_date_type=='action_last': + if hasattr(obj, 'date_action_last') and obj.date_action_last: + base = mx.DateTime.strptime(obj.date_action_last, '%Y-%m-%d %H:%M:%S') else: - ok = action.trg_date_type=='none' + base = mx.DateTime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S') + elif hasattr(obj, 'date_deadline') and action.trg_date_type=='deadline' \ + and obj.date_deadline: + base = mx.DateTime.strptime(obj.date_deadline, '%Y-%m-%d %H:%M:%S') + elif hasattr(obj, 'date') and action.trg_date_type=='date' and obj.date: + 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), + } + d = base + fnct[action.trg_date_range_type](action.trg_date_range) + dt = d.strftime('%Y-%m-%d %H:%M:%S') + ok = False + if hasattr(obj, 'date_action_last') and hasattr(obj, 'date_action_next'): + ok = (dt <= time.strftime('%Y-%m-%d %H:%M:%S')) and \ + ((not obj.date_action_next) or \ + (dt >= obj.date_action_next and \ + obj.date_action_last < obj.date_action_next)) + if not ok: + if not obj.date_action_next or dt < obj.date_action_next: + obj.date_action_next = dt + model_obj.write(cr, uid, [obj.id], {'date_action_next': dt}, context) + else: + ok = action.trg_date_type=='none' - if ok: - self.do_action(cr, uid, action, model_obj, obj, context) - break + if ok: + self.do_action(cr, uid, action, model_obj, obj, context) + break level -= 1 return True -base_action_rule() - -class base_action_rule_line(osv.osv): - _name = 'base.action.rule.line' - _description = 'Action Rule Lines' - - def _state_get(self, cr, uid, context={}): - """ Get State - @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 context: A standard dictionary for contextual values """ - - return self.state_get(cr, uid, context=context) - def _priority_get(self, cr, uid, context={}): - """ Get Priority - @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 context: A standard dictionary for contextual values """ - - return self.priority_get(cr, uid, context=context) - - def state_get(self, cr, uid, context={}): - """ Get State - @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 context: A standard dictionary for contextual values """ - - return [('','')] - def priority_get(self, cr, uid, context={}): - """ Get Priority - @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 context: A standard dictionary for contextual values """ - - return [('','')] - - _columns = { - 'name': fields.char('Rule Name',size=64, required=True), - 'rule_id': fields.many2one('base.action.rule','Rule'), - '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."), - - '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'), - - - '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'), - - '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." \ - "eg:on which object which action to be taken on basis of which condition"), - } - - _defaults = { - 'active': lambda *a: 1, - '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, - } - - _order = 'sequence' - def _check_mail(self, cr, uid, ids, context=None): """ Check Mail @@ -393,6 +371,6 @@ class base_action_rule_line(osv.osv): (_check_mail, 'Error: The mail is not well formated', ['act_mail_body']), ] -base_action_rule_line() +base_action_rule() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml index 09bbb2e2f5f..72cf3e5a9fb 100644 --- a/addons/base_action_rule/base_action_rule_view.xml +++ b/addons/base_action_rule/base_action_rule_view.xml @@ -17,51 +17,6 @@ - - - - - - - - - - base.action.rule.tree - base.action.rule - tree - - - - - - - - - - - - - Action Rules - base.action.rule - form - tree,form - - - - - - - - base.action.rule.line.form - base.action.rule.line - form - -
- - @@ -133,29 +88,35 @@ -
+ - + - - base.action.rule.line.tree - base.action.rule.line + + base.action.rule.tree + base.action.rule tree - - - + + + + + + + + + Action Rules + base.action.rule + form + tree,form + - + + diff --git a/addons/base_action_rule/security/ir.model.access.csv b/addons/base_action_rule/security/ir.model.access.csv index 982dfdebfb5..99e4fc07c4b 100644 --- a/addons/base_action_rule/security/ir.model.access.csv +++ b/addons/base_action_rule/security/ir.model.access.csv @@ -1,3 +1,2 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_base_action_rule","base.action.rule","model_base_action_rule",,1,1,1,1 -"access_base_action_rule_line","base.action.rule.line","model_base_action_rule_line",,1,1,1,1 diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 718b12bb9c3..dd2372a3bf8 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -152,6 +152,18 @@ class base_action_rule(osv.osv): """ Base Action Rule """ _inherit = 'base.action.rule' _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."), + } + def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from',False), context={}): body = self.format_mail(obj, body) @@ -207,7 +219,7 @@ class base_action_rule(osv.osv): res = super(base_action_rule, self).do_action(cr, uid, action, model_obj, obj, context=context) write = {} - if hasattr(action, act_section_id) and action.act_section_id: + if hasattr(action, 'act_section_id') and action.act_section_id: obj.section_id = action.act_section_id write['section_id'] = action.act_section_id.id @@ -231,13 +243,6 @@ class base_action_rule(osv.osv): return True -base_action_rule() - -class base_action_rule_line(osv.osv): - """ Base Action Rule Line """ - _inherit = 'base.action.rule.line' - _description = 'Base Action Rule Line' - def state_get(self, cr, uid, context={}): """@param self: The object pointer @@ -245,7 +250,7 @@ class base_action_rule_line(osv.osv): @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ - res = super(base_action_rule_line, self).state_get(cr, uid, context=context) + res = super(base_action_rule, self).state_get(cr, uid, context=context) return res + [('escalate','Escalate')] + crm.AVAILABLE_STATES def priority_get(self, cr, uid, context={}): @@ -255,18 +260,8 @@ class base_action_rule_line(osv.osv): @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ - res = super(base_action_rule_line, self).priority_get(cr, uid, context=context) + res = super(base_action_rule, self).priority_get(cr, uid, context=context) return res + crm.AVAILABLE_PRIORITIES - _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."), - } -base_action_rule_line() +base_action_rule() diff --git a/addons/crm/crm_action_rule_view.xml b/addons/crm/crm_action_rule_view.xml index 78767a2f795..6211714232c 100644 --- a/addons/crm/crm_action_rule_view.xml +++ b/addons/crm/crm_action_rule_view.xml @@ -3,9 +3,9 @@ - base.action.rule.line.form.inherit - base.action.rule.line - + base.action.rule.form.inherit + base.action.rule + form @@ -19,9 +19,9 @@ - base.action.rule.line.form2.inherit - base.action.rule.line - + base.action.rule.form2.inherit + base.action.rule + form @@ -35,9 +35,9 @@ - base.action.rule.line.form3.inherit - base.action.rule.line - + base.action.rule.form3.inherit + base.action.rule + form From 6f33cfb8b5bf500c7413a73df0771ae91ad6c996 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Wed, 28 Apr 2010 16:40:14 +0530 Subject: [PATCH 08/11] [REM]: crm: Removed fundraising from crm [ADD]: crm_fundraising: Added new module for fundraising bzr revid: rpa@tinyerp.com-20100428111014-v9ruvr62t3pjr7gs --- addons/crm/__init__.py | 3 -- addons/crm/__openerp__.py | 35 ++++---------- addons/crm/report/__init__.py | 3 -- addons/crm/security/ir.model.access.csv | 6 --- addons/crm_fundraising/__init__.py | 26 ++++++++++ addons/crm_fundraising/__openerp__.py | 48 +++++++++++++++++++ .../crm_fundraising.py | 4 +- .../crm_fundraising_data.xml} | 16 +++---- .../crm_fundraising_demo.xml} | 16 +++---- .../crm_fundraising_menu.xml} | 16 +++---- .../crm_fundraising_view.xml} | 4 +- addons/crm_fundraising/report/__init__.py | 25 ++++++++++ .../report/crm_fundraising_report.py | 0 .../report/crm_fundraising_report_view.xml | 4 +- .../security/ir.model.access.csv | 3 ++ .../test/test_crm_fund.yml | 0 16 files changed, 141 insertions(+), 68 deletions(-) create mode 100644 addons/crm_fundraising/__init__.py create mode 100644 addons/crm_fundraising/__openerp__.py rename addons/{crm => crm_fundraising}/crm_fundraising.py (98%) rename addons/{crm/crm_fund_data.xml => crm_fundraising/crm_fundraising_data.xml} (78%) rename addons/{crm/crm_fund_demo.xml => crm_fundraising/crm_fundraising_demo.xml} (92%) rename addons/{crm/crm_fund_menu.xml => crm_fundraising/crm_fundraising_menu.xml} (64%) rename addons/{crm/crm_fund_view.xml => crm_fundraising/crm_fundraising_view.xml} (99%) create mode 100644 addons/crm_fundraising/report/__init__.py rename addons/{crm => crm_fundraising}/report/crm_fundraising_report.py (100%) rename addons/{crm => crm_fundraising}/report/crm_fundraising_report_view.xml (97%) create mode 100644 addons/crm_fundraising/security/ir.model.access.csv rename addons/{crm => crm_fundraising}/test/test_crm_fund.yml (100%) diff --git a/addons/crm/__init__.py b/addons/crm/__init__.py index 1c0cc81dd38..48d1193129e 100644 --- a/addons/crm/__init__.py +++ b/addons/crm/__init__.py @@ -27,9 +27,6 @@ import crm_meeting import crm_opportunity import crm_lead import crm_phonecall -import crm_claim -import crm_fundraising -import crm_helpdesk import report import wizard diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index e4dea534b65..37ffc80bd29 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -26,7 +26,7 @@ 'category': 'Generic Modules/CRM & SRM', 'description': """The generic Open ERP Customer Relationship Management system enables a group of people to intelligently and efficiently manage -leads, opportunities, claims, meeting, phonecall etc. +leads, opportunities, meeting, phonecall etc. It manages key tasks such as communication, identification, prioritization, assignment, resolution and notification. @@ -55,13 +55,10 @@ between mails and Open ERP.""", 'init_xml': [ 'crm_data.xml', 'crm_meeting_data.xml', - 'crm_claims_data.xml', - 'crm_fund_data.xml', - 'crm_helpdesk_data.xml', - 'crm_lead_data.xml', - 'crm_meeting_data.xml', - 'crm_opportunity_data.xml', - 'crm_phonecall_data.xml', + 'crm_lead_data.xml', + 'crm_meeting_data.xml', + 'crm_opportunity_data.xml', + 'crm_phonecall_data.xml', ], 'update_xml': [ @@ -82,49 +79,37 @@ between mails and Open ERP.""", 'crm_action_rule_view.xml', 'crm_lead_view.xml', 'crm_lead_menu.xml', + 'crm_meeting_view.xml', 'crm_meeting_menu.xml', + 'crm_phonecall_view.xml', 'crm_phonecall_menu.xml', + 'crm_opportunity_view.xml', 'crm_opportunity_menu.xml', - 'crm_fund_view.xml', - 'crm_fund_menu.xml', - 'crm_claims_view.xml', - 'crm_claims_menu.xml', - - 'crm_helpdesk_view.xml', - 'crm_helpdesk_menu.xml', - + 'security/crm_security.xml', 'security/ir.model.access.csv', 'report/crm_report_view.xml', - 'report/crm_claim_report_view.xml', 'report/crm_lead_report_view.xml', - 'report/crm_fundraising_report_view.xml', 'report/crm_opportunity_report_view.xml' , 'report/crm_phonecall_report_view.xml', 'process/crm_configuration_process.xml', ], 'demo_xml': [ - 'test/test_crm_meeting.yml', 'crm_demo.xml', - 'crm_claims_demo.xml', - 'crm_fund_demo.xml', - 'crm_helpdesk_demo.xml', 'crm_lead_demo.xml', 'crm_meeting_demo.xml', 'crm_opportunity_demo.xml', 'crm_phonecall_demo.xml' ], 'test': ['test/test_crm_lead.yml', + 'test/test_crm_meeting.yml', 'test/test_crm_opportunity.yml', 'test/test_crm_phonecall.yml', - 'test/test_crm_fund.yml', - 'test/test_crm_claim.yml', - 'test/test_crm_helpdesk.yml', ], 'installable': True, 'active': False, diff --git a/addons/crm/report/__init__.py b/addons/crm/report/__init__.py index 7030c43cfe2..bfcbba7d875 100644 --- a/addons/crm/report/__init__.py +++ b/addons/crm/report/__init__.py @@ -21,12 +21,9 @@ #import report_businessopp import crm_report -import crm_claim_report import crm_lead_report import crm_phonecall_report -import crm_fundraising_report import crm_opportunity_report -import crm_helpdesk_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 12e9d2557f1..37a36fc5504 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -5,9 +5,6 @@ "access_crm_case_categ","crm.case.categ","model_crm_case_categ","crm.group_crm_user",1,0,0,0 "access_crm_case_manger","crm.case manager","model_crm_case","crm.group_crm_user",1,1,1,1 "access_crm_case","crm.case","model_crm_case","crm.group_crm_manager",1,1,1,1 -"access_crm_claim","crm.claim","model_crm_claim","crm.group_crm_manager",1,1,1,1 -"access_crm_fundraising","crm.fundraising","model_crm_fundraising","crm.group_crm_manager",1,1,1,1 -"access_crm_helpdesk","crm.helpdesk","model_crm_helpdesk","crm.group_crm_manager",1,1,1,1 "access_crm_meeting","crm.meeting","model_crm_meeting","crm.group_crm_manager",1,1,1,1 "access_crm_lead","crm.lead","model_crm_lead","crm.group_crm_manager",1,1,1,1 "access_crm_opportunity","crm.opportunity","model_crm_opportunity","crm.group_crm_manager",1,1,1,1 @@ -26,8 +23,6 @@ "access_crm_case_resource_type_manager","crm_case_resource_type manager","model_crm_case_resource_type","crm.group_crm_manager",1,1,1,1 "access_crm_case_report_user","crm.case.report","model_crm_case_report","crm.group_crm_user",1,0,0,0 "access_crm_case_report_manager","crm.case.report manager","model_crm_case_report","crm.group_crm_manager",1,1,1,1 -"access_crm_claim_report_user","crm.claim.report","model_crm_claim_report","crm.group_crm_user",1,0,0,0 -"access_crm_fundraising_report_user","crm.fundraising.report","model_crm_fundraising_report","crm.group_crm_user",1,0,0,0 "access_crm_lead_report_user","crm.lead.report","model_crm_lead_report","crm.group_crm_user",1,0,0,0 "access_crm_phonecall_report_user","crm.phonecall.report","model_crm_phonecall_report","crm.group_crm_user",1,0,0,0 "access_crm_opportunity_report_user","crm.opportunity.report","model_crm_opportunity_report","crm.group_crm_user",1,0,0,0 @@ -38,7 +33,6 @@ "access_crm_phonecall2phonecall","crm.phonecall2phonecall","model_crm_phonecall2phonecall","crm.group_crm_user",1,1,1,1 "access_crm_phonecall2partner","crm.phonecall2partner","model_crm_phonecall2partner","crm.group_crm_user",1,1,1,1 "access_crm_phonecall2opportunity","crm.phonecall2opportunity","model_crm_phonecall2opportunity","crm.group_crm_user",1,1,1,1 -"access_report_crm_helpdesk","report.crm.helpdesk","model_crm_helpdesk_report","crm.group_crm_user",1,1,1,1 "access_crm_send_mail","crm.send.mail","model_crm_send_mail","crm.group_crm_user",1,1,1,1 "access_crm_partner2opportunity","crm.partner2opportunity","model_crm_partner2opportunity","crm.group_crm_user",1,1,1,1 "access_crm_lead2opportunity_partner","crm.lead2opportunity.partner","model_crm_lead2opportunity_partner","crm.group_crm_user",1,1,1,1 diff --git a/addons/crm_fundraising/__init__.py b/addons/crm_fundraising/__init__.py new file mode 100644 index 00000000000..b16301ec63c --- /dev/null +++ b/addons/crm_fundraising/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import crm_fundraising +import report + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/crm_fundraising/__openerp__.py b/addons/crm_fundraising/__openerp__.py new file mode 100644 index 00000000000..292325f1084 --- /dev/null +++ b/addons/crm_fundraising/__openerp__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'CRM Fundraising', + 'version': '1.0', + 'category': 'Generic Modules/CRM & SRM', + 'description': """Fundraising""", + 'author': 'Tiny', + 'website': 'http://www.openerp.com', + 'depends': ['crm'], + 'init_xml': [ + 'crm_fundraising_data.xml', + ], + + 'update_xml': [ + 'crm_fundraising_view.xml', + 'crm_fundraising_menu.xml', + 'security/ir.model.access.csv', + 'report/crm_fundraising_report_view.xml', + ], + 'demo_xml': [ + 'crm_fundraising_demo.xml', + ], + 'installable': True, + 'active': False, +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm_fundraising.py b/addons/crm_fundraising/crm_fundraising.py similarity index 98% rename from addons/crm/crm_fundraising.py rename to addons/crm_fundraising/crm_fundraising.py index afd7f7fbf4d..30c413076ea 100644 --- a/addons/crm/crm_fundraising.py +++ b/addons/crm_fundraising/crm_fundraising.py @@ -20,7 +20,7 @@ ############################################################################## from osv import fields, osv, orm -import crm +from crm import crm class crm_fundraising(osv.osv): """ Fund Raising Cases """ @@ -73,5 +73,3 @@ class crm_fundraising(osv.osv): } crm_fundraising() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm_fund_data.xml b/addons/crm_fundraising/crm_fundraising_data.xml similarity index 78% rename from addons/crm/crm_fund_data.xml rename to addons/crm_fundraising/crm_fundraising_data.xml index 1c566279b90..03613d87a7f 100644 --- a/addons/crm/crm_fund_data.xml +++ b/addons/crm_fundraising/crm_fundraising_data.xml @@ -6,25 +6,25 @@ Social Rehabilitation And Rural Upliftment - + Learning And Education - + Healthcare - + Arts And Culture - + @@ -32,25 +32,25 @@ Cash - + Cheque - + Credit Card - + Demand Draft - + diff --git a/addons/crm/crm_fund_demo.xml b/addons/crm_fundraising/crm_fundraising_demo.xml similarity index 92% rename from addons/crm/crm_fund_demo.xml rename to addons/crm_fundraising/crm_fundraising_demo.xml index 23ea6835df1..c7588701af0 100644 --- a/addons/crm/crm_fund_demo.xml +++ b/addons/crm_fundraising/crm_fundraising_demo.xml @@ -12,7 +12,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -118,7 +118,7 @@ - + @@ -136,7 +136,7 @@ - + diff --git a/addons/crm/crm_fund_menu.xml b/addons/crm_fundraising/crm_fundraising_menu.xml similarity index 64% rename from addons/crm/crm_fund_menu.xml rename to addons/crm_fundraising/crm_fundraising_menu.xml index 7a53ab1aa18..eab0603c446 100644 --- a/addons/crm/crm_fund_menu.xml +++ b/addons/crm_fundraising/crm_fundraising_menu.xml @@ -12,29 +12,29 @@ Funds crm.fundraising tree,form,graph - - + + tree - - + + form - - + + graph - - + +