diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index d6465027059..c7f1dc9e149 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -21,7 +21,7 @@ { - "name" : "Accounting and financial management", + "name" : "Accounting and Financial Management", "version" : "1.1", "depends" : ["product", "base", "process"], "author" : "Tiny", diff --git a/addons/caldav/common.py b/addons/caldav/common.py index 77187c91419..2119584a399 100644 --- a/addons/caldav/common.py +++ b/addons/caldav/common.py @@ -51,19 +51,26 @@ def real_id2caldav_id(real_id, recurrent_date): return '%d-%s'%(real_id, recurrent_date) return real_id -def uid2openobjectid(cr, uidval, oomodel): +def uid2openobjectid(cr, uidval, oomodel, rdate): __rege = re.compile(r'OpenObject-([\w|\.]+)_([0-9]+)@(\w+)$') wematch = __rege.match(uidval.encode('utf8')) if not wematch: - return False + return (False, None) else: model, id, dbname = wematch.groups() if (not model == oomodel) or (not dbname == cr.dbname): - return False - cr.execute('select distinct(id) from %s' % model.replace('.', '_')) + return (False, None) + qry = 'select distinct(id) from %s' % model.replace('.', '_') + if rdate: + qry += " where recurrent_id='%s'" % (rdate) + cr.execute(qry) + r_id = cr.fetchone() + if r_id: + return (id, r_id[0]) + cr.execute(qry) ids = map(lambda x: str(x[0]), cr.fetchall()) if id in ids: - return id + return (id, None) return False def openobjectid2uid(cr, uidval, oomodel): diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 27d744c38d2..d73823bd710 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -194,13 +194,18 @@ rule or repeating pattern for anexception to a recurrence set"), vals = event_obj.import_ical(cr, uid, file_content) ids = [] for val in vals: - is_exists = common.uid2openobjectid(cr, val['id'], self._name) + exists, r_id = common.uid2openobjectid(cr, val['id'], self._name, \ + val.get('recurrent_id')) if val.has_key('create_date'): val.pop('create_date') val['caldav_url'] = context.get('url') or '' val.pop('id') - if is_exists: - self.write(cr, uid, [is_exists], val) - ids.append(is_exists) + if exists and r_id: + val.update({'recurrent_uid': exists}) + self.write(cr, uid, [r_id], val) + ids.append(r_id) + elif exists: + self.write(cr, uid, [exists], val) + ids.append(exists) else: case_id = self.create(cr, uid, val) ids.append(case_id) diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py index 2161f0886b1..8994f96de4a 100644 --- a/addons/hr_attendance/hr_attendance.py +++ b/addons/hr_attendance/hr_attendance.py @@ -114,7 +114,11 @@ class hr_employee(osv.osv): def attendance_action_change(self, cr, uid, ids, type='action', context={}, dt=False, *args): id = False warning_sign = 'sign' - + + #Special case when button calls this method :type=context + if isinstance(type,dict): + type = type.get('type','action') + if type == 'sign_in': warning_sign = "Sign In" elif type == 'sign_out': @@ -125,7 +129,7 @@ class hr_employee(osv.osv): raise osv.except_osv(_('Warning'), _('You tried to %s with a date anterior to another event !\nTry to contact the administrator to correct attendances.')%(warning_sign,)) res = {'action' : type, 'employee_id' : emp['id']} - + if dt: res['name'] = dt diff --git a/addons/hr_attendance/hr_attendance_view.xml b/addons/hr_attendance/hr_attendance_view.xml index 2511d76b1f5..6bfedddd3b5 100644 --- a/addons/hr_attendance/hr_attendance_view.xml +++ b/addons/hr_attendance/hr_attendance_view.xml @@ -99,8 +99,8 @@ -