diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 0672b28ba33..020d2740d4d 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -126,6 +126,10 @@ class base_action_rule(osv.osv): obj.state = action.act_state write['state'] = action.act_state + if hasattr(obj, 'categ_id') and action.act_categ_id: + obj.categ_id = action.act_categ_id + write['categ_id'] = action.act_categ_id.id + if hasattr(obj, 'priority') and action.act_priority: obj.priority = action.act_priority write['priority'] = action.act_priority diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml index 71c84e3eaaa..9892886c675 100644 --- a/addons/base_action_rule/base_action_rule_view.xml +++ b/addons/base_action_rule/base_action_rule_view.xml @@ -2,9 +2,9 @@ - - base.action.rule.form @@ -12,27 +12,28 @@ form
- + - +
- + base.action.rule.tree base.action.rule tree - - + + + - + Action Rules base.action.rule @@ -40,10 +41,11 @@ tree,form + - - base.action.rule.line.form @@ -54,34 +56,44 @@ - - - - - - - - - - - - - - - - + + + +
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 584762828f1..82ceb2aab70 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -38,7 +38,7 @@ months = { def get_recurrent_dates(rrulestring, exdate, startdate=None): def todate(date): - val = parser.parse(''.join((re.compile('\d')).findall(date)) + 'Z') + val = parser.parse(''.join((re.compile('\d')).findall(date))) return val if not startdate: startdate = datetime.now() @@ -778,13 +778,15 @@ rule or repeating pattern for anexception to a recurrence set"), def modify_this(self, cr, uid, ids, defaults, context=None, *args): datas = self.read(cr, uid, ids[0], context=context) - date = datas.get('date') defaults.update({ 'recurrent_uid': base_calendar_id2real_id(datas['id']), 'recurrent_id': defaults.get('date'), 'rrule_type': 'none', 'rrule': '' }) + exdate = datas['exdate'] and datas['exdate'].split(',') or [] + exdate.append(defaults.get('date')) + self.write(cr, uid, ids, {'exdate': ','.join(exdate)}, context=context) new_id = self.copy(cr, uid, ids[0], default=defaults, context=context) return new_id diff --git a/addons/caldav/caldav.py b/addons/caldav/caldav.py index 6c416903959..3afcc28dd40 100644 --- a/addons/caldav/caldav.py +++ b/addons/caldav/caldav.py @@ -192,7 +192,12 @@ class CalDAV(object): vals = alarm.import_cal(cr, uid, cal_data, context=ctx) self.ical_set(cal_data.name.lower(), vals, 'value') continue + if cal_data.name.lower() == 'exdate': + exval = map(lambda x: str(x), cal_data.value) + self.ical_set(cal_data.name.lower(), ','.join(exval), 'value') + continue if cal_data.name.lower() in self.__attribute__: + if cal_data.params.get('X-VOBJ-ORIGINAL-TZID'): self.ical_set('vtimezone', cal_data.params.get('X-VOBJ-ORIGINAL-TZID'), 'value') self.ical_set(cal_data.name.lower(), cal_data.value, 'value') @@ -248,15 +253,15 @@ class CalDAV(object): data[map_field], ical, context=context) elif data[map_field]: if map_type in ("char", "text"): - vevent.add(field).value = tools.ustr(data[map_field]) - elif map_type in ('datetime', 'date') and data[map_field]: if field in ('exdate'): - vevent.add(field).value = [parser.parse(data[map_field])] + vevent.add(field).value = map(parser.parse, (data[map_field]).split(',')) else: - dtfield = vevent.add(field) - dtfield.value = parser.parse(data[map_field]) - if tzval: - dtfield.params['TZID'] = [tzval.title()] + vevent.add(field).value = tools.ustr(data[map_field]) + elif map_type in ('datetime', 'date') and data[map_field]: + dtfield = vevent.add(field) + dtfield.value = parser.parse(data[map_field]) + if tzval: + dtfield.params['TZID'] = [tzval.title()] elif map_type == "timedelta": vevent.add(field).value = timedelta(hours=data[map_field]) elif map_type == "many2one": @@ -275,11 +280,13 @@ class CalDAV(object): def check_import(self, cr, uid, vals, context={}): ids = [] model_obj = self.pool.get(context.get('model')) + recur_pool = {} try: for val in vals: exists, r_id = 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}) @@ -289,8 +296,14 @@ class CalDAV(object): model_obj.write(cr, uid, [exists], val) ids.append(exists) else: - event_id = model_obj.create(cr, uid, val) - ids.append(event_id) + 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 @@ -369,6 +382,7 @@ class Calendar(CalDAV, osv.osv): def import_cal(self, cr, uid, content, data_id=None, context=None): if not context: context = {} + vals = [] ical_data = base64.decodestring(content) parsedCal = vobject.readOne(ical_data) if not data_id: @@ -385,11 +399,12 @@ class Calendar(CalDAV, osv.osv): }) self.__attribute__ = get_attribute_mapping(cr, uid, child.name.lower(), context=context) val = self.parse_ics(cr, uid, child, cal_children=cal_children, context=context) + vals.append(val) obj = self.pool.get(cal_children[child.name.lower()]) - if hasattr(obj, 'check_import'): - obj.check_import(cr, uid, [val], context=context) - else: - self.check_import(cr, uid, [val], context=context) + if hasattr(obj, 'check_import'): + obj.check_import(cr, uid, vals, context=context) + else: + self.check_import(cr, uid, vals, context=context) return {} Calendar() diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 589e26d5521..7765f61ec32 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -606,6 +606,6 @@ class users(osv.osv): _inherit = 'res.users' _description = "Users" _columns = { - 'context_section_id': fields.many2one('crm.case.section', 'Sales Section'), + 'context_section_id': fields.many2one('crm.case.section', 'Sales Team'), } users() diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index c3184ea4097..1e7c50588db 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -188,6 +188,7 @@ class base_action_rule_line(osv.osv): '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 section 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."), } diff --git a/addons/crm/crm_action_rule_view.xml b/addons/crm/crm_action_rule_view.xml index 0cca1b22416..8fee80c86f2 100644 --- a/addons/crm/crm_action_rule_view.xml +++ b/addons/crm/crm_action_rule_view.xml @@ -1,6 +1,6 @@ - + base.action.rule.line.form.inherit @@ -8,27 +8,32 @@ form - - - - - + + + + + + + - + base.action.rule.line.form2.inherit base.action.rule.line form - - - - + + + + + + + - + base.action.rule.line.form3.inherit base.action.rule.line @@ -36,7 +41,8 @@ form - + + diff --git a/addons/crm/crm_claims_view.xml b/addons/crm/crm_claims_view.xml index b82f57b88ca..e0fd5d90c80 100644 --- a/addons/crm/crm_claims_view.xml +++ b/addons/crm/crm_claims_view.xml @@ -36,6 +36,8 @@ + + diff --git a/addons/crm/crm_fund_view.xml b/addons/crm/crm_fund_view.xml index 250f7473592..f7a45b1f082 100644 --- a/addons/crm/crm_fund_view.xml +++ b/addons/crm/crm_fund_view.xml @@ -37,7 +37,7 @@ - + @@ -197,7 +197,7 @@ - + +