From c1e2afebe8f3eea7f08dd39dfb1840f0bb867cef Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Fri, 8 Jul 2011 14:06:28 +0200 Subject: [PATCH 01/44] [FIX] cannot open from of task when project caldav is installed bzr revid: tfr@openerp.com-20110708120628-i6eyl0kdpkgt2ara --- addons/project_caldav/project_caldav.py | 2 +- addons/project_caldav/project_caldav_view.xml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/project_caldav/project_caldav.py b/addons/project_caldav/project_caldav.py index ada89d35e69..c0f780dfc57 100644 --- a/addons/project_caldav/project_caldav.py +++ b/addons/project_caldav/project_caldav.py @@ -42,11 +42,11 @@ class project_task(osv.osv): help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\ \n If the task is over, the states is set to \'Done\'.'), } + _defaults = { 'state': 'draft', } - def open_task(self, cr, uid, ids, context=None): """ Open Task Form for Project Task. diff --git a/addons/project_caldav/project_caldav_view.xml b/addons/project_caldav/project_caldav_view.xml index d27a4474fc9..f361dc9580b 100644 --- a/addons/project_caldav/project_caldav_view.xml +++ b/addons/project_caldav/project_caldav_view.xml @@ -66,8 +66,7 @@ - + From 461e41910255a1366270cd8e54d263b267c299de Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Fri, 8 Jul 2011 15:12:03 +0200 Subject: [PATCH 02/44] [FIX] event.todo don't erase project.task column anymore bzr revid: tfr@openerp.com-20110708131203-o9cduv00he161ahl --- addons/project_caldav/project_caldav.py | 2 +- addons/project_caldav/project_caldav_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/project_caldav/project_caldav.py b/addons/project_caldav/project_caldav.py index c0f780dfc57..f17ef3050d4 100644 --- a/addons/project_caldav/project_caldav.py +++ b/addons/project_caldav/project_caldav.py @@ -28,7 +28,7 @@ from project.project import task as base_project_task class project_task(osv.osv): _name = "project.task" - _inherit = ["calendar.todo", "project.task"] + _inherit = ["project.task", "calendar.todo"] _columns = { # force inherit from project.project_task so that # calendar.todo.active is masked oute diff --git a/addons/project_caldav/project_caldav_view.xml b/addons/project_caldav/project_caldav_view.xml index f361dc9580b..57e9e75a53b 100644 --- a/addons/project_caldav/project_caldav_view.xml +++ b/addons/project_caldav/project_caldav_view.xml @@ -66,7 +66,7 @@ - + From a2dcc919cea8e2bce788ab656c4d6674f2a67490 Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Fri, 8 Jul 2011 15:35:02 +0200 Subject: [PATCH 03/44] [CLEAN] clean recurrent option view in task, but deactivate reccurency for task in openerp since it's not well implemented bzr revid: tfr@openerp.com-20110708133502-gqdovbyhm717xdgx --- addons/project_caldav/project_caldav_view.xml | 64 +++++++++++-------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/addons/project_caldav/project_caldav_view.xml b/addons/project_caldav/project_caldav_view.xml index 57e9e75a53b..0d566be4619 100644 --- a/addons/project_caldav/project_caldav_view.xml +++ b/addons/project_caldav/project_caldav_view.xml @@ -65,7 +65,8 @@ form - + + @@ -78,46 +79,57 @@ form - - - - - - - - - - - + + + + + + + + + + - + + - - + + - + + - + - - + + - - - - - - + + + + From 7c75f19da5e025fd7971d10c233c1c5a45037158 Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Fri, 8 Jul 2011 17:35:07 +0200 Subject: [PATCH 04/44] [FIX] creation of todo bzr revid: tfr@openerp.com-20110708153507-0old9j33jus9grmc --- addons/base_calendar/base_calendar.py | 3 +-- addons/caldav/caldav_node.py | 2 +- addons/project_caldav/project_caldav.py | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 5f24b08884a..e50bb52abd9 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1208,7 +1208,7 @@ rule or repeating pattern of time to exclude from the recurring rule."), def remove_virtual_id(self, ids): - if isinstance(ids, (str, int)): + if isinstance(ids, (str, int, long)): return base_calendar_id2real_id(ids) if isinstance(ids, (list, tuple)): @@ -1239,7 +1239,6 @@ rule or repeating pattern of time to exclude from the recurring rule."), if until_date: continue until_date = arg[2] - res = super(calendar_event, self).search(cr, uid, args_without_date, \ 0, 0, order, context, count=False) res = self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit, context=context) diff --git a/addons/caldav/caldav_node.py b/addons/caldav/caldav_node.py index 5272d0fc1fd..71e9bdc2468 100644 --- a/addons/caldav/caldav_node.py +++ b/addons/caldav/caldav_node.py @@ -324,7 +324,6 @@ class node_calendar(nodes.node_class): uid = self.context.uid res = self.set_data(cr, data) - if res and len(res): # We arbitrarily construct only the first node of the data # that have been imported. ICS may have had more elements, @@ -332,6 +331,7 @@ class node_calendar(nodes.node_class): assert isinstance(res[0], (int, long)) fnodes = fil_obj.get_calendar_objects(cr, uid, [self.calendar_id], self, domain=[('id','=',res[0])], context=ctx) + if self.context.get('DAV-client','') in ('iPhone', 'iCalendar',): # For those buggy clients, register the alias bca_obj = fil_obj.pool.get('basic.calendar.alias') diff --git a/addons/project_caldav/project_caldav.py b/addons/project_caldav/project_caldav.py index f17ef3050d4..782f167d69b 100644 --- a/addons/project_caldav/project_caldav.py +++ b/addons/project_caldav/project_caldav.py @@ -109,6 +109,8 @@ class project_task(osv.osv): self.write(cr, uid, [exists], val) ids.append(exists) else: + #set user_id with id, needed later + val.update({'user_id' : uid}) task_id = self.create(cr, uid, val) ids.append(task_id) return ids From aedeaadb4663a57e0ee9c45b7b372d5bae000946 Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Mon, 11 Jul 2011 14:20:55 +0200 Subject: [PATCH 05/44] [FIX] caldav write_date problem + attendees synchronization bzr revid: tfr@openerp.com-20110711122055-63syh4xflmko9ajb --- addons/caldav/calendar.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index a70a31bc017..94d28e4ad37 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -121,10 +121,10 @@ def str2mailto(emailstr, multi=False): for mas in mailz: m = mege.match(mas.strip()) if not m: - # one of the rare non-matching strings is "sad" :( - # retz.append({ 'name': mas.strip() }) - # continue - raise ValueError("Invalid email address %r" % mas) + #one of the rare non-matching strings is "sad" :( + retz.append({ 'name': mas.strip() }) + continue + # raise ValueError("Invalid email address %r" % mas) rd = { 'name': m.group(1).strip(), 'email': m.group(5), } if m.group(2): @@ -189,6 +189,9 @@ def map_data(cr, uid, obj, context=None): field = obj.ical_get(map_dict, 'field') field_type = obj.ical_get(map_dict, 'type') if field: + #ignore write date, this field is resered for the orm + if field == 'write_date': + continue if field_type == 'selection': if not map_val: continue @@ -299,7 +302,6 @@ class CalDAV(object): att_data = [] exdates = [] _server_tzinfo = pytz.timezone(tools.get_server_timezone()) - for cal_data in child.getChildren(): if cal_data.name.lower() == 'organizer': dmail = { 'name': cal_data.params.get('CN', ['',])[0], @@ -552,7 +554,7 @@ class CalDAV(object): @param data_id: Get Data’s ID or False @param context: A standard dictionary for contextual values """ - + ical_data = content self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context) parsedCal = vobject.readOne(ical_data) From 0a583564912137386a36da42c5fefb651add8ee9 Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Mon, 11 Jul 2011 17:51:29 +0200 Subject: [PATCH 06/44] [IMP] in progress translate rrule into openerp data bzr revid: tfr@openerp.com-20110711155129-jjhuvaby3m5eryuu --- addons/base_calendar/base_calendar.py | 80 ++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 3 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index e50bb52abd9..dfa898c633f 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -991,14 +991,80 @@ class calendar_event(osv.osv): """ result = {} + if not isinstance(ids, list): + ids = [ids] + for datas in self.read(cr, uid, ids, ['id','byday','recurrency', 'month_list','end_date', 'rrule_type', 'select1', 'interval', 'count', 'end_type', 'mo', 'tu', 'we', 'th', 'fr', 'sa', 'su', 'exrule', 'day', 'week_list' ], context=context): event = datas['id'] if datas.get('interval', 0) < 0: raise osv.except_osv(_('Warning!'), _('Interval can not be Negative')) if datas.get('count', 0) < 0: raise osv.except_osv(_('Warning!'), _('Count can not be Negative')) - result[event] = self.compute_rule_string(datas) + if datas['recurrency']: + result[event] = self.compute_rule_string(datas) + else: + result[event] = "" return result + + def _parse_rrule(self, rule, data): + day_list = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su'] + r = rrule.rrulestr(rule) + data['count'] = r._count + data['interval'] = r._interval + data['end_date'] = r._until and r._until.strftime("%Y-%m-%d %H:%M:%S") + #repeat weekly + if r._byweekday: + for i in xrange(0,7): + if i in r._byweekday: + data[day_list[i]] = True + data['rrule_type'] = 'weekly' + #repeat monthly bynweekday ((weekday, weeknumber), ) + if r._bynweekday: + data['week_list'] = day_list[r._bynweekday[0][0]].upper() + data['byday'] = r._bynweekday[0][1] + data['rrule_type'] = 'monthly' + + #end of recurrence + #in case of repeat for ever that we do not support right now + if not (data.get('count') or data.get('end_date')): + data['count'] = 100 + if data.get('count'): + data['end_type'] = 'count' + else: + data['end_type'] = 'end_date' + return data + + def _write_rrule(self, cr, uid, ids, field_name, field_value, arg, context): + print field_name, field_value + data = { + 'byday' : False, + 'recurrency' : False, + 'month_list' : False, + 'end_date' : False, + 'rrule_type' : False, + 'select1' : False, + 'interval' : 0, + 'count' : False, + 'end_type' : False, + 'mo' : False, + 'tu' : False, + 'we' : False, + 'th' : False, + 'fr' : False, + 'sa' : False, + 'su' : False, + 'exrule' : False, + 'day' : False, + 'week_list' : False + } + + if field_value: + update_data = self._parse_rrule(field_value, dict(data)) + print update_data + #parse_rrule + self.write(cr, uid, ids, data, context=context) + + print "rrule", self._get_rulestring(cr, uid, ids, None, arg, context) _columns = { 'id': fields.integer('ID'), @@ -1022,7 +1088,7 @@ class calendar_event(osv.osv): defines the list of date/time exceptions for a recurring calendar component."), 'exrule': fields.char('Exception Rule', size=352, help="Defines a \ rule or repeating pattern of time to exclude from the recurring rule."), - 'rrule': fields.function(_get_rulestring, type='char', size=124, \ + 'rrule': fields.function(_get_rulestring, fnct_inv=_write_rrule, type='char', size=124, \ store=True, string='Recurrent Rule'), 'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \ ('weekly', 'Weekly'), ('monthly', 'Monthly'), \ @@ -1173,7 +1239,7 @@ rule or repeating pattern of time to exclude from the recurring rule."), @param self: the object pointer @param datas: dictionary of freq and interval value. """ - + print "compute rule string" def get_week_string(freq, datas): weekdays = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su'] if freq == 'weekly': @@ -1277,6 +1343,8 @@ rule or repeating pattern of time to exclude from the recurring rule."), except Exception: return True + + def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): if context is None: context = {} @@ -1284,6 +1352,9 @@ rule or repeating pattern of time to exclude from the recurring rule."), select = [ids] else: select = ids + + + new_ids = [] res = False for event_id in select: @@ -1335,6 +1406,9 @@ rule or repeating pattern of time to exclude from the recurring rule."), context=context) vals.update(updated_vals.get('value', {})) if new_ids: + if 'rrule' in vals.keys(): + print "write, rrule" + print "write ", vals res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context) if ('alarm_id' in vals or 'base_calendar_alarm_id' in vals)\ From 842b67f5b095a11c2185307102eba11e2e7ceeae Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Tue, 12 Jul 2011 12:03:12 +0200 Subject: [PATCH 07/44] [IMP] support caldav recurrency bzr revid: tfr@openerp.com-20110712100312-lj0uib1rnx90dbhc --- addons/base_calendar/base_calendar.py | 155 +++++++++++++++----------- 1 file changed, 92 insertions(+), 63 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index dfa898c633f..1e71ea65634 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1006,66 +1006,9 @@ class calendar_event(osv.osv): result[event] = "" return result - def _parse_rrule(self, rule, data): - day_list = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su'] - r = rrule.rrulestr(rule) - data['count'] = r._count - data['interval'] = r._interval - data['end_date'] = r._until and r._until.strftime("%Y-%m-%d %H:%M:%S") - #repeat weekly - if r._byweekday: - for i in xrange(0,7): - if i in r._byweekday: - data[day_list[i]] = True - data['rrule_type'] = 'weekly' - #repeat monthly bynweekday ((weekday, weeknumber), ) - if r._bynweekday: - data['week_list'] = day_list[r._bynweekday[0][0]].upper() - data['byday'] = r._bynweekday[0][1] - data['rrule_type'] = 'monthly' - - #end of recurrence - #in case of repeat for ever that we do not support right now - if not (data.get('count') or data.get('end_date')): - data['count'] = 100 - if data.get('count'): - data['end_type'] = 'count' - else: - data['end_type'] = 'end_date' - return data + + - def _write_rrule(self, cr, uid, ids, field_name, field_value, arg, context): - print field_name, field_value - data = { - 'byday' : False, - 'recurrency' : False, - 'month_list' : False, - 'end_date' : False, - 'rrule_type' : False, - 'select1' : False, - 'interval' : 0, - 'count' : False, - 'end_type' : False, - 'mo' : False, - 'tu' : False, - 'we' : False, - 'th' : False, - 'fr' : False, - 'sa' : False, - 'su' : False, - 'exrule' : False, - 'day' : False, - 'week_list' : False - } - - if field_value: - update_data = self._parse_rrule(field_value, dict(data)) - print update_data - #parse_rrule - self.write(cr, uid, ids, data, context=context) - - print "rrule", self._get_rulestring(cr, uid, ids, None, arg, context) - _columns = { 'id': fields.integer('ID'), 'sequence': fields.integer('Sequence'), @@ -1088,7 +1031,7 @@ class calendar_event(osv.osv): defines the list of date/time exceptions for a recurring calendar component."), 'exrule': fields.char('Exception Rule', size=352, help="Defines a \ rule or repeating pattern of time to exclude from the recurring rule."), - 'rrule': fields.function(_get_rulestring, fnct_inv=_write_rrule, type='char', size=124, \ + 'rrule': fields.function(_get_rulestring, type='char', size=124, \ store=True, string='Recurrent Rule'), 'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \ ('weekly', 'Weekly'), ('monthly', 'Monthly'), \ @@ -1239,7 +1182,6 @@ rule or repeating pattern of time to exclude from the recurring rule."), @param self: the object pointer @param datas: dictionary of freq and interval value. """ - print "compute rule string" def get_week_string(freq, datas): weekdays = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su'] if freq == 'weekly': @@ -1271,7 +1213,85 @@ rule or repeating pattern of time to exclude from the recurring rule."), return '' interval_srting = datas.get('interval') and (';INTERVAL=' + str(datas.get('interval'))) or '' return 'FREQ=' + freq.upper() + get_week_string(freq, datas) + interval_srting + get_end_date(datas) + get_month_string(freq, datas) + + def _get_empty_rrule_data(self): + return { + 'byday' : False, + 'recurrency' : False, + 'end_date' : False, + 'rrule_type' : False, + 'select1' : False, + 'interval' : 0, + 'count' : False, + 'end_type' : False, + 'mo' : False, + 'tu' : False, + 'we' : False, + 'th' : False, + 'fr' : False, + 'sa' : False, + 'su' : False, + 'exrule' : False, + 'day' : False, + 'week_list' : False + } + def _write_rrule(self, cr, uid, ids, field_value, rule_date=False, context=None): + data = self._get_empty_rrule_data() + + if field_value: + data['recurrency'] = True + for event in self.browse(cr, uid, ids, context=context): + rdate = rule_date or event.date + update_data = self._parse_rrule(field_value, dict(data), rdate) + data.update(update_data) + #parse_rrule + self.write(cr, uid, event.id, data, context=context) + + + def _parse_rrule(self, rule, data, date_start): + day_list = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su'] + rrule_type = ['yearly', 'monthly', 'weekly', 'daily'] + r = rrule.rrulestr(rule, dtstart=datetime.strptime(date_start, "%Y-%m-%d %H:%M:%S")) + + if r._freq > 0 and r._freq < 4: + data['rrule_type'] = rrule_type[r._freq] + + data['count'] = r._count + data['interval'] = r._interval + data['end_date'] = r._until and r._until.strftime("%Y-%m-%d %H:%M:%S") + #repeat weekly + if r._byweekday: + for i in xrange(0,7): + if i in r._byweekday: + data[day_list[i]] = True + data['rrule_type'] = 'weekly' + #repeat monthly bynweekday ((weekday, weeknumber), ) + if r._bynweekday: + data['week_list'] = day_list[r._bynweekday[0][0]].upper() + data['byday'] = r._bynweekday[0][1] + data['select1'] = 'day' + data['rrule_type'] = 'monthly' + + if r._bymonthday: + data['day'] = r._bymonthday[0] + data['select1'] = 'date' + data['rrule_type'] = 'monthly' + + #yearly but for openerp it's monthly, take same information as monthly but interval is 12 times + if r._bymonth: + data['interval'] = data['interval'] * 12 + + #FIXEME handle forever case + #end of recurrence + #in case of repeat for ever that we do not support right now + if not (data.get('count') or data.get('end_date')): + data['count'] = 100 + if data.get('count'): + data['end_type'] = 'count' + else: + data['end_type'] = 'end_date' + return data def remove_virtual_id(self, ids): if isinstance(ids, (str, int, long)): @@ -1407,8 +1427,12 @@ rule or repeating pattern of time to exclude from the recurring rule."), vals.update(updated_vals.get('value', {})) if new_ids: if 'rrule' in vals.keys(): - print "write, rrule" - print "write ", vals + if 'date' in vals.keys(): + date_to_write = vals['date'] + else: + date_to_write = False + self._write_rrule(cr, uid, new_ids, vals['rrule'], date_to_write, context) + res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context) if ('alarm_id' in vals or 'base_calendar_alarm_id' in vals)\ @@ -1535,6 +1559,11 @@ rule or repeating pattern of time to exclude from the recurring rule."), if vals.get('vtimezone', '') and vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'): vals['vtimezone'] = vals['vtimezone'][40:] + + if 'date' in vals and 'rrule' in vals and vals['rrule']: + update_datas = self._parse_rrule(vals['rrule'], self._get_empty_rrule_data(), vals['date']) + update_datas['recurrency'] = True + vals.update(update_datas) updated_vals = self.onchange_dates(cr, uid, [], vals.get('date', False), From cac9fb4e0322ad041acc2cdb9e9a90322b9decba Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Tue, 12 Jul 2011 16:02:13 +0200 Subject: [PATCH 08/44] [FIX] get hostname using tools.get_hostname bzr revid: tfr@openerp.com-20110712140213-flf80sbimzhkmekx --- addons/caldav/wizard/caldav_browse.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/caldav/wizard/caldav_browse.py b/addons/caldav/wizard/caldav_browse.py index f6ecc5dccd5..49b313b9886 100644 --- a/addons/caldav/wizard/caldav_browse.py +++ b/addons/caldav/wizard/caldav_browse.py @@ -24,6 +24,7 @@ from tools import config import base64 import addons from tools.translate import _ +import tools class caldav_browse(osv.osv_memory): @@ -239,12 +240,8 @@ class user_preference(osv.osv_memory): return ids[0] def _get_default_host(self, cr, uid, context): - ids=self.search(cr,uid,[]) - host_name = '' - if ids: - ids = len(ids)> 1 and len(ids)-1 or ids[0] # Use len(ids)-1 for taking the value of last id - host_name = self.browse(cr, uid,[ids],context=context)[0].host_name - return host_name + + return tools.get_hostname(self, cr, uid) _defaults={ 'service': 'webdav', From 8a69cc5504369c565e8c11545b9164bcf4b905cc Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 16 Sep 2011 15:24:46 +0530 Subject: [PATCH 09/44] [FIX] After installing base_contact Contact in search view of partner not work lp bug: https://launchpad.net/bugs/849420 fixed bzr revid: dbr@tinyerp.com-20110916095446-6cwydtneyhng01by --- addons/base_contact/base_contact.py | 18 +++++++++++++++++- addons/base_contact/base_contact_view.xml | 16 +++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py index cf0bc610be8..8be20109591 100644 --- a/addons/base_contact/base_contact.py +++ b/addons/base_contact/base_contact.py @@ -131,7 +131,7 @@ class res_partner_address(osv.osv): if not len(ids): return [] res = [] - if context is None: + if context is None: context = {} for r in self.read(cr, user, ids, ['zip', 'city', 'partner_id', 'street']): if context.get('contact_display', 'contact')=='partner' and r['partner_id']: @@ -143,6 +143,22 @@ class res_partner_address(osv.osv): res.append((r['id'], addr.strip() or '/')) return res + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): + if not args: + args=[] + if not context: + context={} + if name: + ids = [] + job_ids = self.pool.get('res.partner.job').search(cr, user, [('contact_id', operator, name)] + args, limit=limit, context=context) + partner_ids = self.pool.get('res.partner.job').browse(cr, user, job_ids) + partner_data = [(partner.name.name) for partner in partner_ids] + for partner in partner_data: + ids += self.search(cr, user, [('partner_id',operator,partner)] + args, limit=limit, context=context) + else: + ids = self.search(cr, user, args, limit=limit, context=context) + return self.name_get(cr, user, ids, context) + _name = 'res.partner.address' _inherit = 'res.partner.address' _description ='Partner Address' diff --git a/addons/base_contact/base_contact_view.xml b/addons/base_contact/base_contact_view.xml index 8029084b7c3..a65f107fb25 100644 --- a/addons/base_contact/base_contact_view.xml +++ b/addons/base_contact/base_contact_view.xml @@ -252,7 +252,20 @@ - + + + + + res.partner.select + search + res.partner + + + + + + + @@ -422,3 +435,4 @@ + From 0c13fea7cd069ea761824f9fba79e873c1dec895 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 16 Sep 2011 18:02:07 +0530 Subject: [PATCH 10/44] [RMV]base_contact: Remove the extra added inherited view bzr revid: dbr@tinyerp.com-20110916123207-voyla0qs0bx1j3te --- addons/base_contact/base_contact_view.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/addons/base_contact/base_contact_view.xml b/addons/base_contact/base_contact_view.xml index a65f107fb25..0ac009169b3 100644 --- a/addons/base_contact/base_contact_view.xml +++ b/addons/base_contact/base_contact_view.xml @@ -252,20 +252,6 @@ - - - - - res.partner.select - search - res.partner - - - - - - - From 007af7601f455ab5b21a6e977efbfe25920c8756 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 16 Sep 2011 18:10:46 +0530 Subject: [PATCH 11/44] [IMP]base_contact:Improve the code bzr revid: dbr@tinyerp.com-20110916124046-2p713bhbsi8g9zev --- addons/base_contact/base_contact.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py index 8be20109591..2f228bdf345 100644 --- a/addons/base_contact/base_contact.py +++ b/addons/base_contact/base_contact.py @@ -144,14 +144,13 @@ class res_partner_address(osv.osv): return res def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): + ids = [] if not args: args=[] - if not context: - context={} + jobs = self.pool.get('res.partner.job') if name: - ids = [] - job_ids = self.pool.get('res.partner.job').search(cr, user, [('contact_id', operator, name)] + args, limit=limit, context=context) - partner_ids = self.pool.get('res.partner.job').browse(cr, user, job_ids) + job_ids = jobs.search(cr, user, [('contact_id', operator, name)] + args, limit=limit, context=context) + partner_ids = jobs.browse(cr, user, job_ids) partner_data = [(partner.name.name) for partner in partner_ids] for partner in partner_data: ids += self.search(cr, user, [('partner_id',operator,partner)] + args, limit=limit, context=context) From 2b997a1fce1f48105f67a6570953a40245edc50c Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 20 Sep 2011 11:39:49 +0530 Subject: [PATCH 12/44] [FIX] : Remove the conflict bzr revid: dbr@tinyerp.com-20110920060949-j8wtqlq7huc9jvd1 --- addons/auction/auction_demo.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/auction/auction_demo.xml b/addons/auction/auction_demo.xml index 7f34eb6697c..e93cc3ea04d 100644 --- a/addons/auction/auction_demo.xml +++ b/addons/auction/auction_demo.xml @@ -39,7 +39,7 @@ Auction Adjudications A7x* - receivable + other @@ -48,7 +48,7 @@ Auction Adjudication Expenses A6x* - payable + other @@ -56,7 +56,7 @@ Auction Buyer Costs A8x* - payable + other @@ -64,7 +64,7 @@ Auction Seller Costs A9x* - receivable + other @@ -251,7 +251,7 @@ - Frais de vente + Frais de vente0 0 auction From a9eaeb39598726af1e09956f462ee09bad501e75 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 20 Sep 2011 14:24:19 +0530 Subject: [PATCH 13/44] [IMP]base_contact : Improve the code bzr revid: dbr@tinyerp.com-20110920085419-8vft3k6yu72eb54n --- addons/base_contact/base_contact.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py index 2f228bdf345..25cd38d60fb 100644 --- a/addons/base_contact/base_contact.py +++ b/addons/base_contact/base_contact.py @@ -144,18 +144,14 @@ class res_partner_address(osv.osv): return res def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): - ids = [] if not args: args=[] + ids = self.search(cr, user, [('name',operator,name)] + args, limit=limit, context=context) jobs = self.pool.get('res.partner.job') if name: job_ids = jobs.search(cr, user, [('contact_id', operator, name)] + args, limit=limit, context=context) - partner_ids = jobs.browse(cr, user, job_ids) - partner_data = [(partner.name.name) for partner in partner_ids] - for partner in partner_data: + for partner in [(partner.name.name) for partner in (jobs.browse(cr, user, job_ids))]: ids += self.search(cr, user, [('partner_id',operator,partner)] + args, limit=limit, context=context) - else: - ids = self.search(cr, user, args, limit=limit, context=context) return self.name_get(cr, user, ids, context) _name = 'res.partner.address' From 8693b8108a5c76115654e0d719249417590da9fc Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 13 Oct 2011 16:10:34 +0530 Subject: [PATCH 14/44] [Fix] Account :[Account]In menu Accounting/Configuration/Miscellaneous/Payment Terms Improve some usability Issue lp bug: https://launchpad.net/bugs/873234 fixed bzr revid: aag@tinyerp.com-20111013104034-znmers3jo3h6e7j0 --- addons/account/account_view.xml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 2ae910a36b3..74157fb8f19 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1714,19 +1714,20 @@ form
- - - - - - + + + + + + + + + + + + + - - - - - - - From abe5a3e1d05613176660cf4b596dd6e4be4c5216 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Wed, 19 Oct 2011 17:50:53 +0530 Subject: [PATCH 20/44] [FIX]: account: typo + improvement in payment term line view bzr revid: rpa@tinyerp.com-20111019122053-qr4uuz9z244s389u --- addons/account/account_view.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index ad2d616c2e5..3912f665916 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1730,10 +1730,10 @@ -