From e4a21fbd7b1e2a1f5343f89ccdbd186aa1bb8bb1 Mon Sep 17 00:00:00 2001 From: "Ferdinand,mtr(OpenERP)" <> Date: Thu, 16 Jun 2011 15:00:21 +0530 Subject: [PATCH 01/91] [FIX] account: calculates the correct level lp bug: https://launchpad.net/bugs/783670 fixed bzr revid: mtr@mtr-20110616093021-n7ihs56l7v08ntwq --- addons/account/account.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index f6dd36c01fc..b3b6016fc74 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -340,9 +340,11 @@ class account_account(osv.osv): accounts = self.browse(cr, uid, ids, context=context) for account in accounts: level = 0 - if account.parent_id: - obj = self.browse(cr, uid, account.parent_id.id) - level = obj.level + 1 + parent_id = account.parent_id + while parent_id: + obj = self.browse(cr, uid, parent_id.id) + level += 1 + parent_id = obj.parent_id res[account.id] = level return res @@ -390,7 +392,10 @@ class account_account(osv.osv): 'manage this. So if you import from another software system you may have to use the rate at date. ' \ 'Incoming transactions always use the rate at date.', \ required=True), - 'level': fields.function(_get_level, string='Level', method=True, store=True, type='integer'), + 'level': fields.function(_get_level, string='Level', method=True, type='integer', + store={ + 'account.account': (lambda self, cr, uid, ids, c={}: ids, ['parent_id'], 10), + }), } _defaults = { From ef278ffae6da5a72eabe6ea026a2cc8c3ae97561 Mon Sep 17 00:00:00 2001 From: mtr Date: Tue, 5 Jul 2011 17:56:39 +0530 Subject: [PATCH 02/91] [IMP] account: improved store dictionary of function field 'level' bzr revid: mtr@mtr-20110705122639-nq3yqkebakr4vig7 --- addons/account/account.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index b3b6016fc74..24b04ea6ae7 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -332,9 +332,9 @@ class account_account(osv.osv): for acc in record.child_consol_ids: if acc.id not in result[record.id]: result[record.id].append(acc.id) - + return result - + def _get_level(self, cr, uid, ids, field_name, arg, context=None): res = {} accounts = self.browse(cr, uid, ids, context=context) @@ -344,7 +344,7 @@ class account_account(osv.osv): while parent_id: obj = self.browse(cr, uid, parent_id.id) level += 1 - parent_id = obj.parent_id + parent_id = obj.parent_id res[account.id] = level return res @@ -394,7 +394,7 @@ class account_account(osv.osv): required=True), 'level': fields.function(_get_level, string='Level', method=True, type='integer', store={ - 'account.account': (lambda self, cr, uid, ids, c={}: ids, ['parent_id'], 10), + 'account.account': (_get_children_and_consol, [], 10), }), } From 4ee5b4bedae693d4c9e338b0f9a53b540cff9441 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Wed, 24 Aug 2011 13:31:51 +0530 Subject: [PATCH 03/91] [FIX] mrp_repair:Hardcoded stock name location in mrp_repair are removed lp bug: https://launchpad.net/bugs/831543 fixed bzr revid: aag@tinyerp.com-20110824080151-3hnce2cgz6600gy8 --- addons/mrp_repair/mrp_repair.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 3a538590d10..548c95ffa1c 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -699,7 +699,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): } } - product_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Production')])[0] + product_id = self.pool.get('stock.location').search(cr, uid, [('usage','=','production')])[0] if type != 'add': return {'value': { 'to_invoice': False, @@ -707,15 +707,16 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'location_dest_id': False } } - - stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0] - to_invoice = (guarantee_limit and - datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) - return {'value': { - 'to_invoice': to_invoice, - 'location_id': stock_id, - 'location_dest_id': product_id - } + + if ids: + stock_id = self.browse(cr, uid, ids[0]).repair_id.company_id.partner_id.property_stock_customer.id + to_invoice = (guarantee_limit and + datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) + return {'value': { + 'to_invoice': to_invoice, + 'location_id': stock_id, + 'location_dest_id': product_id + } } mrp_repair_line() From 873b0b206ecdcda9fdc4b06ea137597989992251 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Mon, 29 Aug 2011 15:03:08 +0530 Subject: [PATCH 04/91] [FIX] mrp_repair:Hardcoded stock name location in mrp_repair are removed lp bug: https://launchpad.net/bugs/831543 fixed bzr revid: aag@tinyerp.com-20110829093308-zy30ntoek58l1oyl --- addons/mrp_repair/mrp_repair.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 548c95ffa1c..ad7d1f993c5 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -692,6 +692,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): @param guarantee_limit: Guarantee limit of current record. @return: Dictionary of values. """ + wrehouse_obj = self.pool.get('stock.warehouse') if not type: return {'value': { 'location_id': False, @@ -709,7 +710,8 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): } if ids: - stock_id = self.browse(cr, uid, ids[0]).repair_id.company_id.partner_id.property_stock_customer.id + company_id = self.browse(cr, uid, ids[0]).repair_id.company_id.id + stock_id = wrehouse_obj.browse(cr, uid, company_id).lot_input_id.id to_invoice = (guarantee_limit and datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) return {'value': { From fd04c0d7fcdb7e6ab6336d336452fc09b9424362 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Tue, 30 Aug 2011 10:35:19 +0530 Subject: [PATCH 05/91] [IMP] mrp_repair:Rename stock.warehouse object name bzr revid: aag@tinyerp.com-20110830050519-zlmhksehjub57qto --- addons/mrp_repair/mrp_repair.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index ad7d1f993c5..6f326a0a483 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -692,7 +692,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): @param guarantee_limit: Guarantee limit of current record. @return: Dictionary of values. """ - wrehouse_obj = self.pool.get('stock.warehouse') + warehouse_obj = self.pool.get('stock.warehouse') if not type: return {'value': { 'location_id': False, @@ -711,7 +711,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): if ids: company_id = self.browse(cr, uid, ids[0]).repair_id.company_id.id - stock_id = wrehouse_obj.browse(cr, uid, company_id).lot_input_id.id + stock_id = warehouse_obj.browse(cr, uid, company_id).lot_input_id.id to_invoice = (guarantee_limit and datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) return {'value': { From f6f09e06edb881812ef42eed8007503efa70761c Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Tue, 30 Aug 2011 10:40:58 +0530 Subject: [PATCH 06/91] [IMP] mrp_repair:ADD context in browse method bzr revid: aag@tinyerp.com-20110830051058-4klmhdcsdkucf0aj --- addons/mrp_repair/mrp_repair.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 6f326a0a483..0c8334421da 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -710,8 +710,8 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): } if ids: - company_id = self.browse(cr, uid, ids[0]).repair_id.company_id.id - stock_id = warehouse_obj.browse(cr, uid, company_id).lot_input_id.id + company_id = self.browse(cr, uid, ids[0], context=context).repair_id.company_id.id + stock_id = warehouse_obj.browse(cr, uid, company_id, context=context).lot_input_id.id to_invoice = (guarantee_limit and datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) return {'value': { From c6fe5c3502e50592dd83290c68431e4f45f3517b Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Tue, 30 Aug 2011 10:43:56 +0530 Subject: [PATCH 07/91] [IMP] mrp_repair:ADD context in method bzr revid: aag@tinyerp.com-20110830051356-vi5icqt04n99mf98 --- addons/mrp_repair/mrp_repair.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 0c8334421da..c23f868f370 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -685,13 +685,15 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'product_uom_qty': lambda *a: 1, } - def onchange_operation_type(self, cr, uid, ids, type, guarantee_limit): + def onchange_operation_type(self, cr, uid, ids, type, guarantee_limit, context = None): """ On change of operation type it sets source location, destination location and to invoice field. @param product: Changed operation type. @param guarantee_limit: Guarantee limit of current record. @return: Dictionary of values. """ + if context is None: + context = {} warehouse_obj = self.pool.get('stock.warehouse') if not type: return {'value': { @@ -700,7 +702,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): } } - product_id = self.pool.get('stock.location').search(cr, uid, [('usage','=','production')])[0] + product_id = self.pool.get('stock.location').search(cr, uid, [('usage','=','production')], context=context)[0] if type != 'add': return {'value': { 'to_invoice': False, From cf21a70172907eee6adbbfcbfc04526f9f38039c Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Tue, 30 Aug 2011 12:03:50 +0530 Subject: [PATCH 08/91] [IMP] mrp_repair:Find production location company wise bzr revid: aag@tinyerp.com-20110830063350-94xgxlg2znm2lu29 --- addons/mrp_repair/mrp_repair.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index c23f868f370..153f36c32bd 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -695,31 +695,33 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): if context is None: context = {} warehouse_obj = self.pool.get('stock.warehouse') + location_obj = self.pool.get('stock.location') if not type: return {'value': { 'location_id': False, 'location_dest_id': False } } - - product_id = self.pool.get('stock.location').search(cr, uid, [('usage','=','production')], context=context)[0] - if type != 'add': - return {'value': { - 'to_invoice': False, - 'location_id': product_id, - 'location_dest_id': False - } - } if ids: company_id = self.browse(cr, uid, ids[0], context=context).repair_id.company_id.id + product_id = location_obj.search(cr, uid, [('usage','=','production'), ('company_id','=',company_id)], context=context) + if not product_id: + product_id = location_obj.search(cr, uid, [('usage','=','production')], context=context) + if type != 'add': + return {'value': { + 'to_invoice': False, + 'location_id': product_id[0], + 'location_dest_id': False + } + } stock_id = warehouse_obj.browse(cr, uid, company_id, context=context).lot_input_id.id to_invoice = (guarantee_limit and datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) return {'value': { 'to_invoice': to_invoice, 'location_id': stock_id, - 'location_dest_id': product_id + 'location_dest_id': product_id[0] } } From 3ff689c76375d8d4fa71b70bd0589f66268e3d73 Mon Sep 17 00:00:00 2001 From: "Meera Trambadia (OpenERP)" Date: Fri, 2 Sep 2011 14:57:42 +0530 Subject: [PATCH 09/91] [IMP] hr_payroll: improved data.xml to change the sequence in the display of salary rule categories. bzr revid: mtr@tinyerp.com-20110902092742-cyj58sya4krdu3al --- addons/hr_payroll/hr_payroll_data.xml | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/hr_payroll/hr_payroll_data.xml b/addons/hr_payroll/hr_payroll_data.xml index d5618fab3a0..c752a2ca3a4 100644 --- a/addons/hr_payroll/hr_payroll_data.xml +++ b/addons/hr_payroll/hr_payroll_data.xml @@ -1,37 +1,37 @@ - + Basic BASIC - + Allowance ALW - - - Deduction - DED - - + Gross GROSS - + + + Deduction + DED + + Net NET - + Company Contribution COMP - + Basic @@ -71,13 +71,13 @@ - + - + Payroll 2 - + From cc5c8a71330993540d43385dff74e2ce40c6d36f Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Mon, 5 Sep 2011 14:56:44 +0530 Subject: [PATCH 10/91] [IMP] mrp_repair:optimize code bzr revid: aag@tinyerp.com-20110905092644-86ph50nywnv1eoev --- addons/mrp_repair/mrp_repair.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 153f36c32bd..026ceb51104 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -706,12 +706,15 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): if ids: company_id = self.browse(cr, uid, ids[0], context=context).repair_id.company_id.id product_id = location_obj.search(cr, uid, [('usage','=','production'), ('company_id','=',company_id)], context=context) - if not product_id: - product_id = location_obj.search(cr, uid, [('usage','=','production')], context=context) + if product_id: + product_id = product_id[0] + else: + product_id = False + if type != 'add': return {'value': { 'to_invoice': False, - 'location_id': product_id[0], + 'location_id': product_id, 'location_dest_id': False } } @@ -721,7 +724,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): return {'value': { 'to_invoice': to_invoice, 'location_id': stock_id, - 'location_dest_id': product_id[0] + 'location_dest_id': product_id } } From e133c408cb2e79e65c3d58cabeb5ea75c6c29f9c Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Wed, 21 Sep 2011 11:09:53 +0530 Subject: [PATCH 11/91] [FIX, REF]: mrp_repair: Improvement in code and logic of onchange type of repair line to fix the problem of hard coded location name in search bzr revid: rpa@tinyerp.com-20110921053953-gwcq1k72bln0ue7s --- addons/mrp_repair/mrp_repair.py | 53 +++++++++++++++------------------ 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 026ceb51104..32ea609fd14 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -685,48 +685,43 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'product_uom_qty': lambda *a: 1, } - def onchange_operation_type(self, cr, uid, ids, type, guarantee_limit, context = None): + def onchange_operation_type(self, cr, uid, ids, type, guarantee_limit, context=None): """ On change of operation type it sets source location, destination location and to invoice field. @param product: Changed operation type. @param guarantee_limit: Guarantee limit of current record. @return: Dictionary of values. """ - if context is None: - context = {} - warehouse_obj = self.pool.get('stock.warehouse') - location_obj = self.pool.get('stock.location') if not type: return {'value': { 'location_id': False, 'location_dest_id': False - } - } - - if ids: - company_id = self.browse(cr, uid, ids[0], context=context).repair_id.company_id.id - product_id = location_obj.search(cr, uid, [('usage','=','production'), ('company_id','=',company_id)], context=context) - if product_id: - product_id = product_id[0] - else: - product_id = False - - if type != 'add': - return {'value': { - 'to_invoice': False, - 'location_id': product_id, - 'location_dest_id': False - } - } - stock_id = warehouse_obj.browse(cr, uid, company_id, context=context).lot_input_id.id - to_invoice = (guarantee_limit and - datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) + }} + + warehouse_obj = self.pool.get('stock.warehouse') + location_id = self.pool.get('stock.location').search(cr, uid, [('usage','=','production')], context=context) + location_id = location_id and location_id[0] or False + + if type == 'add': + # TOCHECK: Find stock location for user's company warehouse or + # repair order's company's warehouse (company_id field is added in fix of lp:831583) + company_id = self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.repair', context=context) + warehouse_ids = warehouse_obj.search(cr, uid, [], context=context) + if warehouse_ids: + stock_id = warehouse_obj.browse(cr, uid, warehouse_ids[0], context=context).lot_stock_id.id + to_invoice = (guarantee_limit and datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) + return {'value': { 'to_invoice': to_invoice, 'location_id': stock_id, - 'location_dest_id': product_id - } - } + 'location_dest_id': location_id + }} + + return {'value': { + 'to_invoice': False, + 'location_id': location_id, + 'location_dest_id': False + }} mrp_repair_line() From 74cb5782aa6b8ed6bc8b2210664dc682d045707d Mon Sep 17 00:00:00 2001 From: "Vaibhav (OpenERP)" Date: Fri, 23 Sep 2011 12:22:51 +0530 Subject: [PATCH 12/91] [FIX] Gantview contextmenu Action should affects to record. lp bug: https://launchpad.net/bugs/855346 fixed bzr revid: vda@tinyerp.com-20110923065251-uj5ywar45xyj2y64 --- addons/web/static/src/js/views.js | 3 +- addons/web_gantt/static/src/js/gantt.js | 115 ++++++++++++++---------- 2 files changed, 72 insertions(+), 46 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 88db848118f..e8068fb90d0 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -424,7 +424,8 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View return $.when( this._super(view_type), this.shortcut_check(this.views[view_type])).then(function () { - var view_id = self.views[self.active_view].controller.fields_view.view_id; + var active_controller = self.views[self.active_view].controller; + var view_id = active_controller.fields_view ? active_controller.fields_view.view_id : active_controller.view_id; self.$element.find('.oe_get_xml_view span').text(view_id); }); }, diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index a045bae64e1..378951b2a4f 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -43,7 +43,7 @@ init: function(parent, dataset, view_id) { this.name = this.fields_view.arch.attrs.string; this.view_id = this.fields_view.view_id; - + this.date_start = this.fields_view.arch.attrs.date_start; this.date_delay = this.fields_view.arch.attrs.date_delay; this.date_stop = this.fields_view.arch.attrs.date_stop; @@ -228,7 +228,7 @@ init: function(parent, dataset, view_id) { var evt_date = ""; var evt_duration = ""; var evt_end_date = ""; - + var project_tree_field = []; for (var i in final_events){ evt_id = final_events[i]; evt_date = all_events[evt_id]['evt'][2]; @@ -254,7 +254,7 @@ init: function(parent, dataset, view_id) { self.render_events(all_events, 0); } - for (var i in final_events){ + for (var i in final_events) { evt_id = final_events[i]; res = all_events[evt_id]; task=new GanttTaskInfo(res['evt'][0], res['evt'][1], res['evt'][2], res['evt'][3], res['evt'][4], "",res['evt'][6]); @@ -278,8 +278,9 @@ init: function(parent, dataset, view_id) { ganttChartControl.attachEvent("onTaskStartDrag", function(task) {self.on_drag_start(task);}); ganttChartControl.attachEvent("onTaskEndResize", function(task) {self.on_resize_drag_end(task, "resize");}); ganttChartControl.attachEvent("onTaskEndDrag", function(task) {self.on_resize_drag_end(task, "drag");}); + ganttChartControl.attachEvent("onTaskDblClick", function(task) {self.open_popup(task);}); - + var taskdiv = jQuery("div.taskPanel").parent(); taskdiv.addClass('ganttTaskPanel'); taskdiv.prev().addClass('ganttDayPanel'); @@ -293,7 +294,7 @@ init: function(parent, dataset, view_id) { self.set_width(); }); - jQuery(window).bind('resize',function(){ + jQuery(window).bind('resize',function() { window.clearTimeout(ganttChartControl._resize_timer); ganttChartControl._resize_timer = window.setTimeout(function(){ self.reload_gantt(); @@ -301,6 +302,37 @@ init: function(parent, dataset, view_id) { }); jQuery("div #_1, div #_1 + div").hide(); + + //Custom events + var context_menu = ganttChartControl.contextMenu, + buttons = [], + values = {}; + + _.each(context_menu.arrTabs, function(tab, tab_index) { + buttons.push(_.filter(tab.arrItems,function(b) { + return b.control.type == "button"; + })[0]); + }); + _.each(buttons, function(b, index) { + $(b.control).click(function() { + if(!context_menu.arrTabs[index].object.parentTask) + return false; + var task_info = context_menu.arrTabs[index].object.TaskInfo; + project_id = task_info.Id;; + switch(index) { + case 0: + values[self.text] = task_info.Name; + return self.dataset.write(project_id, values); + case 1: + return self.dataset.unlink([project_id]); + case 3: + if(self.date_delay) { + values[self.date_delay] = task_info.Duration; + return self.dataset.write(project_id, values); + } + } + }) + }); }, set_width: function() { @@ -385,53 +417,46 @@ init: function(parent, dataset, view_id) { }, open_popup : function(task) { + var self = this; var event_id = task.getId(); if(event_id.toString().search("_") != -1) return; if(event_id) event_id = parseInt(event_id, 10); + + var action_manager = new openerp.web.ActionManager(this); + + var dialog = new openerp.web.Dialog(this, { + width: 800, + height: 600, + buttons : { + Cancel : function() { + $(this).dialog('destroy'); + }, + Save : function() { + var form_view = action_manager.inner_viewmanager.views.form.controller; - var action = { - "res_model": this.dataset.model, - "res_id": event_id, - "views":[[false,"form"]], - "type":"ir.actions.act_window", - "view_type":"form", - "view_mode":"form" - }; - - action.flags = { - search_view: false, - sidebar : false, - views_switcher : false, - pager: false - }; - var element_id = _.uniqueId("act_window_dialog"); - var dialog = jQuery('
', { - 'id': element_id - }).dialog({ - modal: true, - width: 'auto', - height: 'auto', - buttons: { - Cancel: function() { - $(this).dialog("destroy"); - }, - Save: function() { - var view_manager = action_manager.viewmanager; - var _dialog = this; - view_manager.views[view_manager.active_view].controller.do_save(function(r) { - $(_dialog).dialog("destroy"); - self.reload_gantt(); - }) - } + form_view.do_save(function() { + self.get_events(); + }); + $(this).dialog('destroy'); } + } + }).start().open(); + action_manager.appendTo(dialog.$element); + action_manager.do_action({ + res_model : this.dataset.model, + res_id: event_id, + views : [[false, 'form']], + type : 'ir.actions.act_window', + auto_search : false, + flags : { + search_view: false, + sidebar : false, + views_switcher : false, + action_buttons : false, + pager: false + } }); - var action_manager = new openerp.web.ActionManager(this, element_id); - action_manager.start(); - action_manager.do_action(action); - - //Default_get - if(!event_id) action_manager.viewmanager.dataset.index = null; }, on_drag_start : function(task){ From dca92e2cc152733c9c6b928ca527b4ff74023d1d Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 7 Oct 2011 17:37:19 +0200 Subject: [PATCH 13/91] [FIX] share: correct default value bzr revid: chs@openerp.com-20111007153719-2lq8ntxom3y8g2xj --- addons/share/wizard/share_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index b66ccc2dd47..bee96b882b8 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -134,7 +134,7 @@ class share_wizard(osv.osv_memory): 'message': fields.text("Personal Message", help="An optional personal message, to be included in the e-mail notification."), } _defaults = { - 'user_type' : 'new', + 'user_type' : 'emails', 'domain': lambda self, cr, uid, context, *a: context.get('domain', '[]'), 'share_root_url': lambda self, cr, uid, context, *a: context.get('share_root_url') or _('Please specify "share_root_url" in context'), 'action_id': lambda self, cr, uid, context, *a: context.get('action_id'), From a1e57977275af752c2b8e9c9c644523fbeb7425b Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 10 Oct 2011 16:25:49 +0200 Subject: [PATCH 14/91] [FIX] share+portal: fix share wizard. [IMP] share wizard: share_root_url and share_url are now function fields bzr revid: chs@openerp.com-20111010142549-uvco15xdf2198e0x --- addons/portal/wizard/share_wizard.py | 4 -- addons/portal/wizard/share_wizard_view.xml | 6 +-- addons/share/wizard/share_wizard.py | 53 ++++++++++------------ addons/share/wizard/share_wizard_view.xml | 8 +++- 4 files changed, 32 insertions(+), 39 deletions(-) diff --git a/addons/portal/wizard/share_wizard.py b/addons/portal/wizard/share_wizard.py index c1366b5dbf0..ab639bdeccc 100644 --- a/addons/portal/wizard/share_wizard.py +++ b/addons/portal/wizard/share_wizard.py @@ -40,10 +40,6 @@ class share_wizard_portal(osv.osv_memory): _columns = { 'user_ids': fields.many2many('res.users', 'share_wizard_res_user_rel', 'share_id', 'user_id', 'Existing users', domain=[('share', '=', True)]), 'group_ids': fields.many2many('res.groups', 'share_wizard_res_group_rel', 'share_id', 'group_id', 'Existing groups', domain=[('share', '=', False)]), - - # no clean way to extend selection yet, copy the field. - 'user_type': fields.selection(_user_type_selection,'Users to share with', - help="Select the type of user(s) you would like to share data with."), } def is_portal_manager(self, cr, uid, context=None): diff --git a/addons/portal/wizard/share_wizard_view.xml b/addons/portal/wizard/share_wizard_view.xml index f16334b68a3..9bee027c3e2 100644 --- a/addons/portal/wizard/share_wizard_view.xml +++ b/addons/portal/wizard/share_wizard_view.xml @@ -8,11 +8,7 @@ form - - - - - + diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index bee96b882b8..82eb814e54a 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -119,24 +119,35 @@ class share_wizard(osv.osv_memory): values['name'] = action.name return super(share_wizard,self).create(cr, uid, values, context=context) + + def _share_root_url(self, cr, uid, ids, _fieldname, _args, context=None): + result = dict.fromkeys(ids, '') + data = dict(dbname=cr.dbname, login='', password='') + for this in self.browse(cr, uid, ids, context=context): + result[this.id] = this.share_url_template % data + return result + _columns = { 'action_id': fields.many2one('ir.actions.act_window', 'Action to share', required=True, help="The action that opens the screen containing the data you wish to share."), 'domain': fields.char('Domain', size=256, help="Optional domain for further data filtering"), - 'user_type': fields.selection(_user_type_selection,'Users to share with', + 'user_type': fields.selection(lambda s, *a, **k: s._user_type_selection(*a, **k),'Users to share with', required=True, help="Select the type of user(s) you would like to share data with."), 'new_users': fields.text("Emails"), 'access_mode': fields.selection([('readonly','Can view'),('readwrite','Can edit')],'Access Mode', required=True, help="Access rights to be granted on the shared documents."), 'result_line_ids': fields.one2many('share.wizard.result.line', 'share_wizard_id', 'Summary', readonly=True), - 'share_root_url': fields.char('Share Access URL', size=512, readonly=True, tooltip='Main access page for users that are granted shared access'), + 'share_url_template': fields.char('Share Access URL Template', size=512, + help='Template for share url. May contains %(dbname)s, %(login)s and %(password)s'), + 'share_root_url': fields.function(_share_root_url, 'Share Access URL', type='char', size=512, readonly=True, + help='Main access page for users that are granted shared access'), 'name': fields.char('Share Title', size=64, required=True, help="Title for the share (displayed to users as menu and shortcut name)"), 'message': fields.text("Personal Message", help="An optional personal message, to be included in the e-mail notification."), } _defaults = { 'user_type' : 'emails', 'domain': lambda self, cr, uid, context, *a: context.get('domain', '[]'), - 'share_root_url': lambda self, cr, uid, context, *a: context.get('share_root_url') or _('Please specify "share_root_url" in context'), + 'share_url_template': lambda self, cr, uid, context, *a: context.get('share_url_template') or _('Please specify "share_url_template" in context'), 'action_id': lambda self, cr, uid, context, *a: context.get('action_id'), 'access_mode': 'readonly', } @@ -537,12 +548,11 @@ class share_wizard(osv.osv_memory): try: domain = safe_eval(wizard_data.domain) if domain: - domain_expr = expression.expression(domain) for rel_field, model in fields_relations: related_domain = [] if not rel_field: continue for element in domain: - if domain_expr._is_leaf(element): + if expression.is_leaf(element): left, operator, right = element left = '%s.%s'%(rel_field, left) element = left, operator, right @@ -555,19 +565,6 @@ class share_wizard(osv.osv_memory): raise osv.except_osv(_('Sharing access could not be created'), _('Sorry, the current screen and filter you are trying to share are not supported at the moment.\nYou may want to try a simpler filter.')) - def _finish_result_lines(self, cr, uid, wizard_data, share_group_id, context=None): - """Perform finalization of the share, and populate the summary""" - share_root_url = wizard_data.share_root_url - format_url = '%(dbname)s' in share_root_url - for result in wizard_data.result_line_ids: - # share_root_url may contain placeholders for dbname, login and password - share_url = (share_root_url % \ - {'login': quote_plus(result.user_id.login), - 'password': '', # kept empty for security reasons - 'dbname': quote_plus(cr.dbname)}) \ - if format_url else share_root_url - result.write({'share_url': share_url}, context=context) - def _check_preconditions(self, cr, uid, wizard_data, context=None): self._assert(wizard_data.action_id and wizard_data.access_mode, _('Action and Access Mode are required to create a shared access'), @@ -662,15 +659,6 @@ class share_wizard(osv.osv_memory): # C. self._create_indirect_sharing_rules(cr, current_user, wizard_data, group_id, obj1, context=context) - # so far, so good -> check summary results and return them - self._finish_result_lines(cr, uid, wizard_data, group_id, context=context) - - # update share URL to make it generic - generic_share_url = wizard_data.share_root_url % {'dbname': cr.dbname, - 'login': '', - 'password': ''} - wizard_data.write({'share_root_url': generic_share_url}, context=context) - # refresh wizard_data wizard_data = self.browse(cr, uid, ids[0], context=context) @@ -742,11 +730,20 @@ share_wizard() class share_result_line(osv.osv_memory): _name = 'share.wizard.result.line' _rec_name = 'user_id' + + + def _share_url(self, cr, uid, ids, _fieldname, _args, context=None): + result = dict.fromkeys(ids, '') + for this in self.browse(cr, uid, ids, context=context): + data = dict(dbname=cr.dbname, login=this.login, password='') # password is kept empty for security reasons + result[this.id] = this.share_wizard_id.share_url_template % data + return result + _columns = { 'user_id': fields.many2one('res.users', required=True, readonly=True), 'login': fields.related('user_id', 'login', string='Login', type='char', size=64, required=True, readonly=True), 'password': fields.char('Password', size=64, readonly=True), - 'share_url': fields.char('Share URL', size=512, required=True), + 'share_url': fields.function(_share_url, 'Share URL', type='char', size=512), 'share_wizard_id': fields.many2one('share.wizard', 'Share Wizard', required=True), 'newly_created': fields.boolean('Newly created', readonly=True), } diff --git a/addons/share/wizard/share_wizard_view.xml b/addons/share/wizard/share_wizard_view.xml index 5087b85d7bd..dedb7c7f4bc 100644 --- a/addons/share/wizard/share_wizard_view.xml +++ b/addons/share/wizard/share_wizard_view.xml @@ -29,6 +29,10 @@ form
+ + + + @@ -78,7 +82,7 @@ - 'action_id' (id of action) - 'domain' (string expression for full domain to apply as sent to server, with dynamic data like 'uid' replaced by actual value (i.e. after eval)!) - - 'share_root_url' : URL for direct access to share page (may include %(login)s and %(password)s placeholders) + - 'share_url_template' : URL for direct access to share page (may include %(login)s and %(password)s placeholders) --> Share Wizard @@ -94,7 +98,7 @@ - 'action_id' (id of action) - 'domain' (string expression for full domain to apply as sent to server, with dynamic data like 'uid' replaced by actual value (i.e. after eval)!) - - 'share_root_url' : URL for direct access to share page (may include %(login)s and %(password)s placeholders) + - 'share_url_template' : URL for direct access to share page (may include %(login)s and %(password)s placeholders) --> Share Wizard From cb7cc66a2e53c325fce682346b7930648f8f16a5 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 10 Oct 2011 16:29:53 +0200 Subject: [PATCH 15/91] [IMP] share: convert web part to v6.1 bzr revid: chs@openerp.com-20111010142953-90ylj17cc1416o5f --- addons/share/__openerp__.py | 7 +- addons/share/static/src/css/share.css | 5 ++ addons/share/static/src/js/share.js | 43 ++++++++++++ addons/share/web/__init__.py | 2 - addons/share/web/controllers.py | 49 -------------- addons/share/web/editors.py | 94 --------------------------- 6 files changed, 53 insertions(+), 147 deletions(-) create mode 100644 addons/share/static/src/css/share.css create mode 100644 addons/share/static/src/js/share.js delete mode 100644 addons/share/web/__init__.py delete mode 100644 addons/share/web/controllers.py delete mode 100644 addons/share/web/editors.py diff --git a/addons/share/__openerp__.py b/addons/share/__openerp__.py index f6a0c93285d..ec026742f87 100644 --- a/addons/share/__openerp__.py +++ b/addons/share/__openerp__.py @@ -3,6 +3,7 @@ # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). +# Copyright (C) 2010-2011 OpenERP SA (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -22,7 +23,7 @@ { "name" : "Web Share", - "version" : "1.5", + "version" : "2.0", "depends" : ["base", "mail"], "author" : "OpenERP SA", "category": 'Hidden', @@ -53,7 +54,9 @@ synchronization with other companies, etc. 'installable': True, 'web': True, 'certificate' : '001301246528927038493', - 'images': ['images/share_wizard.jpeg','images/sharing_wizard_step1.jpeg', 'images/sharing_wizard_step2.jpeg'], + 'js': ['static/src/js/share.js'], + 'css': ['static/src/css/share.css'], + 'images': ['static/src/img/share_wizard.jpeg','static/src/img/sharing_wizard_step1.jpeg', 'static/src/img/sharing_wizard_step2.jpeg'], } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/share/static/src/css/share.css b/addons/share/static/src/css/share.css new file mode 100644 index 00000000000..781bfe197f1 --- /dev/null +++ b/addons/share/static/src/css/share.css @@ -0,0 +1,5 @@ + +.openerp li.oe_share { + background: url(../img/share.png) no-repeat; + padding-left: 20px; +} diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js new file mode 100644 index 00000000000..8a8294d0f12 --- /dev/null +++ b/addons/share/static/src/js/share.js @@ -0,0 +1,43 @@ + +openerp.share = function(instance) { + +instance.web.Sidebar = instance.web.Sidebar.extend({ + + add_default_sections: function() { + this._super(); + this.add_items('Sharing', [{ + label: 'Share', + callback: this.on_sidebar_click_share, + classname: 'oe_share', + }]); + }, + + on_sidebar_click_share: function(item) { + var self = this; + var view = this.widget_parent + var action = view.widget_parent.action; + + var share_url_template = _('%s//%s/?db=%%(dbname)s&login=%%(login)s').sprintf(document.location.protocol, document.location.host); + var Share = new instance.web.DataSet(this, 'share.wizard', view.dataset.get_context()); + + Share.create({ + name: action.name, + domain: view.dataset.domain, + action_id: action.id, + share_url_template: share_url_template, + }, function(result) { + var share_id = result.result; + console.log('share_id', share_id); + + var step1 = Share.call('go_step_1', [[share_id],], function(result) { + var action = result; + console.log('step1', action); + self.do_action(action); + }); + }); + + }, + +}); + +}; diff --git a/addons/share/web/__init__.py b/addons/share/web/__init__.py deleted file mode 100644 index f95bb222c10..00000000000 --- a/addons/share/web/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -import controllers -import editors \ No newline at end of file diff --git a/addons/share/web/controllers.py b/addons/share/web/controllers.py deleted file mode 100644 index e682c8d9709..00000000000 --- a/addons/share/web/controllers.py +++ /dev/null @@ -1,49 +0,0 @@ -import urlparse -import cherrypy - -from openobject import rpc -from openobject.tools import expose, ast - -import openerp.controllers - - - -class ShareWizardController(openerp.controllers.SecuredController): - _cp_path = "/share" - - @expose() - def index(self, domain, context, view_id, search_domain='[]', action_id=None): - context = ast.literal_eval(context) - - if not action_id: - # This should not be needed anymore, but just in case users are - # running the module with an older version of the web client... - - # to remove soon-ish - action_id = rpc.RPCProxy('ir.actions.act_window').search( - [('view_id','=',int(view_id))], context=context) - if not action_id: return "" - - action_id = action_id[0] - - domain = ast.literal_eval(domain) - domain.extend(ast.literal_eval(search_domain)) - - scheme, netloc, _, _, _ = urlparse.urlsplit(cherrypy.request.base) - share_root_url = urlparse.urlunsplit(( - scheme, netloc, '/openerp/login', - 'db=%(dbname)s&user=%(login)s&password=%(password)s', '')) - - context.update( - #active_ids=share_wiz_id, - #active_id=share_wiz_id[0], - _terp_view_name='Share Wizard', - share_root_url=share_root_url) - Share = rpc.RPCProxy('share.wizard') - sharing_view_id = Share.create({ - 'domain': str(domain), - 'action_id': action_id and int(action_id) - }, context) - return openerp.controllers.actions.execute( - Share.go_step_1([sharing_view_id], context), - ids=[sharing_view_id], context=context) diff --git a/addons/share/web/editors.py b/addons/share/web/editors.py deleted file mode 100644 index 677de4a8317..00000000000 --- a/addons/share/web/editors.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- -import openobject.templating - -class FormEditor(openobject.templating.TemplateEditor): - templates = ['/openerp/controllers/templates/form.mako'] - MAIN_FORM_BODY = u'id="main_form_body"' - - def insert_share_button(self, output): - # Insert the share button on the form title H1 line, at the very end, - # but only if the user is a member of the sharing group - share_opener_insertion = output.index('% endif', output.index( - '/view_diagram/process', - output.index(self.MAIN_FORM_BODY))) + len('% endif') - return output[:share_opener_insertion] + ''' - <% - if 'has_share' not in cp.session: - cp.session['has_share'] = rpc.RPCProxy('share.wizard').has_share() - %> - % if cp.session['has_share'] and buttons.toolbar and not is_dashboard: - - - - - \n - % endif -''' + output[share_opener_insertion:] - - def edit(self, template, template_text): - return self.insert_share_button( - super(FormEditor, self).edit(template, template_text)) - - -class SidebarEditor(openobject.templating.TemplateEditor): - templates = ['/openerp/widgets/templates/sidebar.mako'] - ADD_SHARE_SECTION = u'id="sidebar"' - - def insert_share_link(self, output): - # Insert the link on the line, right after the link to open the - # attachment form, but only if the user is a member of the sharing group - share_opener_insertion = output.index( - '\n', - output.index(self.ADD_SHARE_SECTION)) + 1 - return output[:share_opener_insertion] + ''' - <% - if 'has_share' not in cp.session: - cp.session['has_share'] = rpc.RPCProxy('share.wizard').has_share() - %> - % if cp.session['has_share']: -

${_("Sharing")}

- - - \n - % endif -''' + output[share_opener_insertion:] - - def edit(self, template, template_text): - return self.insert_share_link( - super(SidebarEditor, self).edit(template, template_text)) From b46ef4b9605c0b276dfa51779a873c6deb2c9289 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 10 Oct 2011 16:54:06 +0200 Subject: [PATCH 16/91] [FIX] share: correct function fields labels bzr revid: chs@openerp.com-20111010145406-0k4au407iwv9e31n --- addons/share/wizard/share_wizard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 82eb814e54a..20f175b1e0b 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -139,7 +139,7 @@ class share_wizard(osv.osv_memory): 'result_line_ids': fields.one2many('share.wizard.result.line', 'share_wizard_id', 'Summary', readonly=True), 'share_url_template': fields.char('Share Access URL Template', size=512, help='Template for share url. May contains %(dbname)s, %(login)s and %(password)s'), - 'share_root_url': fields.function(_share_root_url, 'Share Access URL', type='char', size=512, readonly=True, + 'share_root_url': fields.function(_share_root_url, string='Share Access URL', type='char', size=512, readonly=True, help='Main access page for users that are granted shared access'), 'name': fields.char('Share Title', size=64, required=True, help="Title for the share (displayed to users as menu and shortcut name)"), 'message': fields.text("Personal Message", help="An optional personal message, to be included in the e-mail notification."), @@ -743,7 +743,7 @@ class share_result_line(osv.osv_memory): 'user_id': fields.many2one('res.users', required=True, readonly=True), 'login': fields.related('user_id', 'login', string='Login', type='char', size=64, required=True, readonly=True), 'password': fields.char('Password', size=64, readonly=True), - 'share_url': fields.function(_share_url, 'Share URL', type='char', size=512), + 'share_url': fields.function(_share_url, string='Share URL', type='char', size=512), 'share_wizard_id': fields.many2one('share.wizard', 'Share Wizard', required=True), 'newly_created': fields.boolean('Newly created', readonly=True), } From 0b803c6852af147c6f423d11754ccff88259b931 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 13 Oct 2011 17:33:02 +0200 Subject: [PATCH 17/91] [IMP] share: put the sidebar item in the "Other Options" section bzr revid: chs@openerp.com-20111013153302-ts5yds22n15zdb4h --- addons/share/static/src/js/share.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js index 8a8294d0f12..96ff5dc4dd6 100644 --- a/addons/share/static/src/js/share.js +++ b/addons/share/static/src/js/share.js @@ -5,7 +5,7 @@ instance.web.Sidebar = instance.web.Sidebar.extend({ add_default_sections: function() { this._super(); - this.add_items('Sharing', [{ + this.add_items('other', [{ label: 'Share', callback: this.on_sidebar_click_share, classname: 'oe_share', From 9f964ca29d1fbf334c8bde793936822a2d1cddd7 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 14 Oct 2011 11:43:24 +0200 Subject: [PATCH 18/91] [IMP] share: share_url_template is read from ir_config_parameter bzr revid: chs@openerp.com-20111014094324-wpj3265vwinel3rj --- addons/share/static/src/js/share.js | 2 -- addons/share/wizard/share_wizard.py | 17 ++++++++++------- addons/share/wizard/share_wizard_view.xml | 2 -- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js index 96ff5dc4dd6..68df8eec878 100644 --- a/addons/share/static/src/js/share.js +++ b/addons/share/static/src/js/share.js @@ -17,14 +17,12 @@ instance.web.Sidebar = instance.web.Sidebar.extend({ var view = this.widget_parent var action = view.widget_parent.action; - var share_url_template = _('%s//%s/?db=%%(dbname)s&login=%%(login)s').sprintf(document.location.protocol, document.location.host); var Share = new instance.web.DataSet(this, 'share.wizard', view.dataset.get_context()); Share.create({ name: action.name, domain: view.dataset.domain, action_id: action.id, - share_url_template: share_url_template, }, function(result) { var share_id = result.result; console.log('share_id', share_id); diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 20f175b1e0b..1cd8104100c 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -119,12 +119,18 @@ class share_wizard(osv.osv_memory): values['name'] = action.name return super(share_wizard,self).create(cr, uid, values, context=context) + def share_url_template(self, cr, uid, _ids, context=None): + # NOTE: take _ids in parameter to allow usage through browse_record objects + base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='', context=context) + if base_url: + base_url += '/?db=%(dbname)s&login=%(login)s' + return base_url def _share_root_url(self, cr, uid, ids, _fieldname, _args, context=None): result = dict.fromkeys(ids, '') - data = dict(dbname=cr.dbname, login='', password='') + data = dict(dbname=cr.dbname, login='') for this in self.browse(cr, uid, ids, context=context): - result[this.id] = this.share_url_template % data + result[this.id] = this.share_url_template() % data return result _columns = { @@ -137,8 +143,6 @@ class share_wizard(osv.osv_memory): 'access_mode': fields.selection([('readonly','Can view'),('readwrite','Can edit')],'Access Mode', required=True, help="Access rights to be granted on the shared documents."), 'result_line_ids': fields.one2many('share.wizard.result.line', 'share_wizard_id', 'Summary', readonly=True), - 'share_url_template': fields.char('Share Access URL Template', size=512, - help='Template for share url. May contains %(dbname)s, %(login)s and %(password)s'), 'share_root_url': fields.function(_share_root_url, string='Share Access URL', type='char', size=512, readonly=True, help='Main access page for users that are granted shared access'), 'name': fields.char('Share Title', size=64, required=True, help="Title for the share (displayed to users as menu and shortcut name)"), @@ -147,7 +151,6 @@ class share_wizard(osv.osv_memory): _defaults = { 'user_type' : 'emails', 'domain': lambda self, cr, uid, context, *a: context.get('domain', '[]'), - 'share_url_template': lambda self, cr, uid, context, *a: context.get('share_url_template') or _('Please specify "share_url_template" in context'), 'action_id': lambda self, cr, uid, context, *a: context.get('action_id'), 'access_mode': 'readonly', } @@ -735,8 +738,8 @@ class share_result_line(osv.osv_memory): def _share_url(self, cr, uid, ids, _fieldname, _args, context=None): result = dict.fromkeys(ids, '') for this in self.browse(cr, uid, ids, context=context): - data = dict(dbname=cr.dbname, login=this.login, password='') # password is kept empty for security reasons - result[this.id] = this.share_wizard_id.share_url_template % data + data = dict(dbname=cr.dbname, login=this.login) + result[this.id] = this.share_wizard_id.share_url_template() % data return result _columns = { diff --git a/addons/share/wizard/share_wizard_view.xml b/addons/share/wizard/share_wizard_view.xml index dedb7c7f4bc..128b32b07da 100644 --- a/addons/share/wizard/share_wizard_view.xml +++ b/addons/share/wizard/share_wizard_view.xml @@ -82,7 +82,6 @@ - 'action_id' (id of action) - 'domain' (string expression for full domain to apply as sent to server, with dynamic data like 'uid' replaced by actual value (i.e. after eval)!) - - 'share_url_template' : URL for direct access to share page (may include %(login)s and %(password)s placeholders) --> Share Wizard @@ -98,7 +97,6 @@ - 'action_id' (id of action) - 'domain' (string expression for full domain to apply as sent to server, with dynamic data like 'uid' replaced by actual value (i.e. after eval)!) - - 'share_url_template' : URL for direct access to share page (may include %(login)s and %(password)s placeholders) --> Share Wizard From 5de33e50224033523288fba1593da2ef5f706e9a Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 14 Oct 2011 14:12:12 +0200 Subject: [PATCH 19/91] [IMP] share bzr revid: chs@openerp.com-20111014121212-zyipo1v68rm7f64c --- addons/share/static/src/css/share.css | 10 ++- addons/share/static/src/js/share.js | 100 +++++++++++++++++++------- 2 files changed, 84 insertions(+), 26 deletions(-) diff --git a/addons/share/static/src/css/share.css b/addons/share/static/src/css/share.css index 781bfe197f1..3b47a065b1e 100644 --- a/addons/share/static/src/css/share.css +++ b/addons/share/static/src/css/share.css @@ -1,5 +1,13 @@ -.openerp li.oe_share { +.openerp li.oe-share { background: url(../img/share.png) no-repeat; padding-left: 20px; } + +.openerp a.oe-share { + background: url(../img/share.png) no-repeat; + display: block; + float: left; + width: 20px; + height: 20px; +} diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js index 68df8eec878..391d2ceb1b2 100644 --- a/addons/share/static/src/js/share.js +++ b/addons/share/static/src/js/share.js @@ -1,41 +1,91 @@ openerp.share = function(instance) { +var QWeb = instance.web.qweb; +QWeb.add_template('/share/static/src/xml/share.xml'); + +function launch_wizard(self, view) { + + var action = view.widget_parent.action; + var Share = new instance.web.DataSet(self, 'share.wizard', view.dataset.get_context()); + + console.log(view); + + domain = view.dataset.domain; + if (view.fields_view.type == 'form') { + domain = new instance.web.CompoundDomain(domain, [['id', '=', view.datarecord.id]]); + } + + Share.create({ + name: action.name, + domain: domain, + action_id: action.id, + }, function(result) { + var share_id = result.result; + var step1 = Share.call('go_step_1', [[share_id],], function(result) { + var action = result; + self.do_action(action); + }); + }); +} + +var _has_share = null; +function if_has_share(yes, no) { + if (!_has_share) { + _has_share = $.Deferred(function() { + var self = this; + var session = instance.webclient.session; + session.on_session_invalid.add_last(function() { _has_share = null; }); + var func = new instance.web.Model(session, "share.wizard").get_func("has_share"); + func(session.uid).pipe(function(res) { + if(res) { + self.resolve(); + } else { + self.reject(); + } + }); + }); + } + _has_share.done(yes).fail(no); +} + instance.web.Sidebar = instance.web.Sidebar.extend({ add_default_sections: function() { this._super(); - this.add_items('other', [{ - label: 'Share', - callback: this.on_sidebar_click_share, - classname: 'oe_share', - }]); + var self = this; + if_has_share(function() { + self.add_items('other', [{ + label: 'Share', + callback: self.on_sidebar_click_share, + classname: 'oe-share', + }]); + }); }, on_sidebar_click_share: function(item) { - var self = this; var view = this.widget_parent - var action = view.widget_parent.action; - - var Share = new instance.web.DataSet(this, 'share.wizard', view.dataset.get_context()); - - Share.create({ - name: action.name, - domain: view.dataset.domain, - action_id: action.id, - }, function(result) { - var share_id = result.result; - console.log('share_id', share_id); - - var step1 = Share.call('go_step_1', [[share_id],], function(result) { - var action = result; - console.log('step1', action); - self.do_action(action); - }); - }); - + launch_wizard(this, view); }, }); + +instance.web.ViewManagerAction.include({ + start: function() { + var self = this; + if_has_share(function() { + self.$element.find('a.oe-share').click(self.on_click_share); + }, function() { + self.$element.find('a.oe-share').remove(); + }); + return this._super.apply(this, arguments); + }, + + on_click_share: function(e) { + e.preventDefault(); + launch_wizard(this, this.views[this.active_view].controller); + }, +}); + }; From 455aa3879f98c10f191a2847b93d3fdc8f3babc9 Mon Sep 17 00:00:00 2001 From: "Bharat (OpenERP)" Date: Tue, 18 Oct 2011 11:17:29 +0530 Subject: [PATCH 20/91] [FIX] account : Added domain in account/board_account_view.xml in order to show the invoices that are in pro-forma state in Account Dashboard lp bug: https://launchpad.net/bugs/876481 fixed bzr revid: bde@tinyerp.com-20111018054729-v576zaphxmxzpsez --- addons/account/board_account_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/board_account_view.xml b/addons/account/board_account_view.xml index e5b262c07f9..1ffcdec1d41 100644 --- a/addons/account/board_account_view.xml +++ b/addons/account/board_account_view.xml @@ -40,7 +40,7 @@ - + From a6074e08d5c047d451d8b865c5b24634376fd122 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Wed, 19 Oct 2011 16:19:57 +0530 Subject: [PATCH 21/91] [IMP] mrp_repair:use company wise warehouse id bzr revid: aag@tinyerp.com-20111019104957-q9mqc8g9bwyve5tw --- addons/mrp_repair/mrp_repair.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index f8d77ea8224..023c91a54b0 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -686,11 +686,12 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): # TOCHECK: Find stock location for user's company warehouse or # repair order's company's warehouse (company_id field is added in fix of lp:831583) company_id = self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.repair', context=context) - warehouse_ids = warehouse_obj.search(cr, uid, [], context=context) + warehouse_ids = warehouse_obj.search(cr, uid, [('company_id','=',company_id)], context=context) + stock_id = False if warehouse_ids: stock_id = warehouse_obj.browse(cr, uid, warehouse_ids[0], context=context).lot_stock_id.id to_invoice = (guarantee_limit and datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()) - + return {'value': { 'to_invoice': to_invoice, 'location_id': stock_id, From c507d1ef7ea17d9a6d0a59466a4c57fe81db23cb Mon Sep 17 00:00:00 2001 From: "RavishchanraMurari (Open ERP)" Date: Thu, 20 Oct 2011 17:21:46 +0530 Subject: [PATCH 22/91] company_id_in_multi_company bzr revid: rmu@tinyerp.com-20111020115146-p0ai3x3q0u48390k --- addons/web/static/src/js/search.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 9cab0ade9d0..2a4d3b1cdfe 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -63,6 +63,8 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search rows.push(row); var filters = []; _.each(items, function (item) { + if(!item.attrs.hasOwnProperty('invisible') && item.attrs.invisible!=1) + { if (filters.length && item.tag !== 'filter') { row.push( new openerp.web.search.FilterGroup( @@ -98,6 +100,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search this.make_field( item, fields[item['attrs'].name])); } + } } }, this); if (filters.length) { From bbd8f2dc258720ab0ab40b87227f83cb1bb51afa Mon Sep 17 00:00:00 2001 From: Geoff Gardiner <> Date: Thu, 20 Oct 2011 18:51:45 +0530 Subject: [PATCH 23/91] [FIX] : [6.1 RC1] installation labels very poor English lp bug: https://launchpad.net/bugs/878149 fixed bzr revid: bde@tinyerp.com-20111020132145-kry8nhxw0j2g2n03 --- addons/account_anglo_saxon/__openerp__.py | 2 +- addons/account_followup/__openerp__.py | 2 +- addons/hr_attendance/__openerp__.py | 2 +- addons/hr_attendance/hr_attendance_view.xml | 10 +++++----- addons/hr_contract/__openerp__.py | 2 +- addons/hr_holidays/__openerp__.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/account_anglo_saxon/__openerp__.py b/addons/account_anglo_saxon/__openerp__.py index 8cf6a37c3fc..52ec0588e88 100644 --- a/addons/account_anglo_saxon/__openerp__.py +++ b/addons/account_anglo_saxon/__openerp__.py @@ -19,7 +19,7 @@ ############################################################################## { - "name" : "Anglo-Saxon Accouting", + "name" : "Anglo-Saxon Accounting", "version" : "1.2", "author" : "OpenERP SA, Veritos", "website" : "http://tinyerp.com - http://veritos.nl", diff --git a/addons/account_followup/__openerp__.py b/addons/account_followup/__openerp__.py index ca6321d5672..3f794682e06 100644 --- a/addons/account_followup/__openerp__.py +++ b/addons/account_followup/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## { - 'name': 'Followups Management', + 'name': 'Followup Management', 'version': '1.0', 'category': 'Accounting & Finance', 'complexity': "normal", diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py index 3d945910144..5f0054c3634 100644 --- a/addons/hr_attendance/__openerp__.py +++ b/addons/hr_attendance/__openerp__.py @@ -21,7 +21,7 @@ { - 'name': 'Attendances', + 'name': 'Attendance', 'version': '1.1', 'category': 'Human Resources', 'complexity': "easy", diff --git a/addons/hr_attendance/hr_attendance_view.xml b/addons/hr_attendance/hr_attendance_view.xml index 7a65ce7f88c..a264f9c0331 100644 --- a/addons/hr_attendance/hr_attendance_view.xml +++ b/addons/hr_attendance/hr_attendance_view.xml @@ -50,7 +50,7 @@ search - + @@ -68,7 +68,7 @@ - Attendances + Attendance hr.attendance form tree,form @@ -79,7 +79,7 @@ - + @@ -116,8 +116,8 @@ - diff --git a/addons/hr_contract/__openerp__.py b/addons/hr_contract/__openerp__.py index a0d303383f7..febc29a89c4 100644 --- a/addons/hr_contract/__openerp__.py +++ b/addons/hr_contract/__openerp__.py @@ -21,7 +21,7 @@ { - 'name': "Employee's Contracts", + 'name': "Employee Contracts", 'version': '1.0', 'category': 'Human Resources', 'complexity': "easy", diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py index 563bb409b41..ec12b884201 100644 --- a/addons/hr_holidays/__openerp__.py +++ b/addons/hr_holidays/__openerp__.py @@ -21,7 +21,7 @@ { - "name": "Leaves Management", + "name": "Leave Management", "version": "1.5", "author": ['OpenERP SA', 'Axelor'], "category": "Human Resources", From 4acc77df77a104412de0642be78aceccec3e80af Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 21 Oct 2011 17:09:58 +0530 Subject: [PATCH 24/91] [Fix]Point Of Sale : Point of sale can not install with Add More fearure Wizard lp bug: https://launchpad.net/bugs/877136 fixed bzr revid: mdi@tinyerp.com-20111021113958-jjxwmhgnlxton7gf --- addons/base_setup/base_setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/base_setup/base_setup.py b/addons/base_setup/base_setup.py index c11bb273ff0..59adf25e015 100644 --- a/addons/base_setup/base_setup.py +++ b/addons/base_setup/base_setup.py @@ -39,7 +39,7 @@ DEFAULT_MODULES = { 'Accounting & Finance' : ['account'], 'Purchase Management' : ['purchase'], 'Human Resources' : ['hr',], - 'Point of Sales' : ['pos',], + 'Point of Sales' : ['point_of_sale',], 'Marketing' : ['marketing',], } @@ -58,7 +58,7 @@ class base_setup_installer(osv.osv_memory): if fields is None: fields = {} - fields = {} + fields = {} category_proxy = self.pool.get('ir.module.category') domain = [('parent_id', '=', False), ('name', '!=', 'Uncategorized'), @@ -389,14 +389,14 @@ class user_preferences_config(osv.osv_memory): ('extended','Extended')], 'Interface', required=True, help= "If you use OpenERP for the first time we strongly advise you to select the simplified interface, which has less features but is easier. You can always switch later from the user preferences." ), 'menu_tips': fields.boolean('Display Tips', help="Check out this box if you want to always display tips on each menu action"), - + } _defaults={ 'view' : lambda self,cr,uid,*args: self.pool.get('res.users').browse(cr, uid, uid).view or 'simple', 'context_lang' : 'en_US', 'menu_tips' : True } - + def default_get(self, cr, uid, fields, context=None): if context is None: context = {} From d417951b98b51850005ced499c557cdce86e0c08 Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Fri, 21 Oct 2011 17:35:35 +0530 Subject: [PATCH 25/91] [ADD]: new view for Unrealized Gains and losses bzr revid: ksa@tinyerp.com-20111021120535-6zq4qwyg7zpl5rle --- addons/account/account.py | 6 ++++++ addons/account/account_menuitem.xml | 1 + addons/account/account_view.xml | 31 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/addons/account/account.py b/addons/account/account.py index 95c9b9f7b71..48d32e2aca5 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -418,6 +418,12 @@ class account_account(osv.osv): 'balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Balance', multi='balance'), 'credit': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Credit', multi='balance'), 'debit': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'), +# 'foreign_balance': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'), + 'foreign_balance': fields.char('Foreign Balance', size=10), + 'adjusted_balance': fields.char('Adjusted Balance', size=10), + 'gain_loss_unrealized_balance':fields.char('Unrealized Gain Loss Balance', size=10), +# 'adjusted_balance': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'), +# 'gain_loss_unrealized_balance': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'), 'reconcile': fields.boolean('Allow Reconciliation', help="Check this box if this account allows reconciliation of journal items."), 'shortcut': fields.char('Shortcut', size=12), 'tax_ids': fields.many2many('account.tax', 'account_account_tax_default_rel', diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 89538603ae7..367442b7fc6 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -43,6 +43,7 @@ + [('parent_id','=',False)]
+ + account.account.tree1 + account.account + tree + 21 + + + + + + + + + + + + + + + Unrealized Gains and losses + account.account + tree + + [('currency_id','!=',False)] + + + + + CLP + $ + 0.01 + 4 + + + + 710 + + + From 1945d19d150544668de7020d7c67b2f2a327a128 Mon Sep 17 00:00:00 2001 From: "RavishchanraMurari (Open ERP)" Date: Mon, 24 Oct 2011 17:44:15 +0530 Subject: [PATCH 32/91] mulit_company_in group_by bzr revid: rmu@tinyerp.com-20111024121415-wkjyjzl6ydqz3t7o --- addons/web/static/src/js/search.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 45a0d40e96e..48d58b5776c 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -63,8 +63,9 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search rows.push(row); var filters = []; _.each(items, function (item) { - if(!item.attrs.hasOwnProperty('invisible') && item.attrs.invisible!=1) - { + if (item.attrs.invisible === '1') { + return; + } if (filters.length && item.tag !== 'filter') { row.push( new openerp.web.search.FilterGroup( @@ -101,7 +102,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search item, fields[item['attrs'].name])); } } - } + }, this); if (filters.length) { row.push(new openerp.web.search.FilterGroup(filters, this)); From 0e54cc6c0082d3abbef620396329c47f97a45920 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Mon, 24 Oct 2011 17:58:12 +0530 Subject: [PATCH 33/91] [IMP]: account: Added computation for adjusted balance (foreign balance / exchange rate) bzr revid: rpa@tinyerp.com-20111024122812-0en1905g27usan7k --- addons/account/account.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/account/account.py b/addons/account/account.py index 07bae6df711..5c623476342 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -308,6 +308,13 @@ class account_account(osv.osv): sums[current.id][fn] += sums[child.id][fn] else: sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) + if current.currency_id and current.exchange_rate: + # Computing Adjusted Balance and Unrealized Gains and losses + # Adjusted Balance = Foreign Balance / Exchange Rate + # Unrealized Gains and losses = Adjusted Balance - Balance + if fn == 'adjusted_balance': + sums[current.id].update({fn: sums[current.id].get('foreign_balance', 0.0) / current.exchange_rate}) + for id in ids: res[id] = sums.get(id, null_result) else: From 96f306b4618625dfbf5362d6486eff5e101511b7 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Mon, 24 Oct 2011 18:09:54 +0530 Subject: [PATCH 34/91] [IMP]: account: Revised field name and string for unrealized gain/loss, before it was "Gains and Losses", but as per usability and functionality "Gain or Loss" suits well bzr revid: rpa@tinyerp.com-20111024123954-8cwlh7kwu1ffvs25 --- addons/account/account.py | 2 +- addons/account/account_view.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 5c623476342..a32f418d45b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -428,7 +428,7 @@ class account_account(osv.osv): 'debit': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'), 'foreign_balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Foreign Balance', multi='balance'), 'adjusted_balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Adjusted Balance', multi='balance'), - 'gain_loss_unrealized': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Unrealized Gains & Losses', multi='balance'), + 'unrealized_gain_loss': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Unrealized Gains & Losses', multi='balance'), 'reconcile': fields.boolean('Allow Reconciliation', help="Check this box if this account allows reconciliation of journal items."), 'exchange_rate': fields.related('currency_id', 'rate', type='float', string='Exchange Rate'), 'shortcut': fields.char('Shortcut', size=12), diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index e12d746cf15..96e7f64dbd7 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -296,7 +296,7 @@ - Unrealized Gains and losses + Unrealized Gain or Loss account.account tree @@ -308,13 +308,13 @@ - + - Unrealized Gains & Losses + Unrealized Gain or Loss account.account form tree @@ -323,7 +323,7 @@ From 8bf3878661beede194b73f4dff29271a9176a161 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Mon, 24 Oct 2011 18:21:47 +0530 Subject: [PATCH 35/91] [IMP]: account: Remaining improvement in field name and string for unrealized gain/loss bzr revid: rpa@tinyerp.com-20111024125147-eptl0gf7dzn1b3nz --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index a32f418d45b..a60906c2326 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -428,7 +428,7 @@ class account_account(osv.osv): 'debit': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'), 'foreign_balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Foreign Balance', multi='balance'), 'adjusted_balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Adjusted Balance', multi='balance'), - 'unrealized_gain_loss': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Unrealized Gains & Losses', multi='balance'), + 'unrealized_gain_loss': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Unrealized Gain or Loss', multi='balance'), 'reconcile': fields.boolean('Allow Reconciliation', help="Check this box if this account allows reconciliation of journal items."), 'exchange_rate': fields.related('currency_id', 'rate', type='float', string='Exchange Rate'), 'shortcut': fields.char('Shortcut', size=12), From 3e20652e55ce8f8eb53d3dc1edf9321a63d5c888 Mon Sep 17 00:00:00 2001 From: kbh Date: Mon, 24 Oct 2011 18:59:59 +0530 Subject: [PATCH 36/91] [IMP] Fixed the issue of checkbutton select all/none in tree view. bzr revid: kbh@bde-desktop-20111024132959-y9b3scfye91nut1c --- addons/web/static/src/js/view_list.js | 5 +++++ addons/web/static/src/xml/base.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 6fd4cdf2e03..1f8430df8a2 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -202,6 +202,11 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# this.$element.html(QWeb.render("ListView", this)); // Head hook + this.$element.find('.all-record-selector').click(function(){ + self.$element.find(':checkbox').prop('checked', + self.$element.find('.all-record-selector').prop('checked') || false); + }); + this.$element.find('#all_checked').click(this.do_all_checked); this.$element.find('.oe-list-add') .click(this.do_add_record) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 4c21a565a69..81611f0315a 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -594,7 +594,7 @@ - + From ce45893633ca0492dfc57a8cd180374565560357 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 24 Oct 2011 15:44:13 +0200 Subject: [PATCH 37/91] [FIX] Display 'don't import' placeholder when no value selected bzr revid: xmo@openerp.com-20111024134413-kgcgemdzquwtn0ns --- addons/web/static/src/xml/base.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 2860174c30f..db3f082ed03 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1461,7 +1461,7 @@ - + From a8b81ed5754ef0f2495b28b517f2a5b7ed9ba749 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 24 Oct 2011 15:55:21 +0200 Subject: [PATCH 38/91] [ADD] dropdown arrow next to import autocompletes bzr revid: xmo@openerp.com-20111024135521-aikh791r9j94moal --- addons/web/static/src/js/data_import.js | 4 ++++ addons/web/static/src/xml/base.xml | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index 711e790dfaa..025ff8df1c5 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -205,6 +205,10 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ return; } + this.$element.delegate('.oe-m2o-drop-down-button', 'click', function () { + $(this).prev('input').focus(); + }); + var self = this; this.ready.then(function () { var $fields = self.$element.find('.sel_fields').bind('blur', function () { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index db3f082ed03..7d010d5867b 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1461,7 +1461,8 @@ - + + From b45b7ad22cce753a00fff13981502e2c807cee79 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 24 Oct 2011 16:06:58 +0200 Subject: [PATCH 39/91] [IMP] import: only show second step once file has been uploaded bzr revid: xmo@openerp.com-20111024140658-8t9csv9i6gd30luj --- addons/web/controllers/main.py | 2 +- addons/web/static/src/js/data_import.js | 2 +- addons/web/static/src/xml/base.xml | 39 +++++++++++++------------ 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 8120141b4f6..6cc46b476a9 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1412,7 +1412,7 @@ class Import(View): return fields @openerpweb.httprequest - def detect_data(self, req, csvfile, csvsep, csvdel, csvcode, jsonp): + def detect_data(self, req, csvfile, csvsep=',', csvdel='"', csvcode='utf-8', jsonp='callback'): try: data = list(csv.reader( csvfile, quotechar=str(csvdel), delimiter=str(csvsep))) diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index 025ff8df1c5..42f0cf8d680 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -80,7 +80,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ this.toggle_import_button(false); this.$element.find('#csvfile').change(this.on_autodetect_data); this.$element.find('fieldset').change(this.on_autodetect_data); - this.$element.find('fieldset legend').click(function() { + this.$element.delegate('fieldset legend', 'click', function() { $(this).next().toggle(); }); this.ready.push(new openerp.web.DataSet(this, this.model).call( diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 7d010d5867b..201ac964ac9 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1419,8 +1419,27 @@

-

2. Check your file format

+ +
+ +

2. Check your file format

+ + + + + + + + + + +
+
+ + +
+
Import Options @@ -1451,25 +1470,7 @@
-
- - - - - - - - - - -
-
- - -
-

The import failed due to:

From cd59e5e6fbf07bb1783dde48ecdafa73000d33c4 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 24 Oct 2011 16:17:37 +0200 Subject: [PATCH 40/91] [ADD] open/close arrow next to import options bzr revid: xmo@openerp.com-20111024141737-bk2rg08wvll1hgno --- addons/web/static/src/css/data_import.css | 12 ++++++++++++ addons/web/static/src/js/data_import.js | 2 +- addons/web/static/src/xml/base.xml | 9 +++++---- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/css/data_import.css b/addons/web/static/src/css/data_import.css index 1fb3b22aa45..b1c4330402f 100644 --- a/addons/web/static/src/css/data_import.css +++ b/addons/web/static/src/css/data_import.css @@ -11,6 +11,18 @@ .openerp .oe_import_grid-row .oe_import_grid-cell { border-bottom: 1px solid #E3E3E3; } +.openerp .oe-import fieldset { + cursor: pointer; +} +.openerp .oe-import fieldset legend:before { + content: '\25BC '; +} +.openerp .oe-import fieldset.oe-closed legend:before { + content: '\25B6 '; +} +.openerp .oe-import fieldset.oe-closed table { + display: none; +} .openerp .separator.horizontal { font-weight: bold; border-bottom-width: 1px; diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index 42f0cf8d680..a284669732d 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -81,7 +81,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ this.$element.find('#csvfile').change(this.on_autodetect_data); this.$element.find('fieldset').change(this.on_autodetect_data); this.$element.delegate('fieldset legend', 'click', function() { - $(this).next().toggle(); + $(this).parent().toggleClass('oe-closed'); }); this.ready.push(new openerp.web.DataSet(this, this.model).call( 'fields_get', [], function (fields) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 201ac964ac9..f2f77b83eb7 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1409,7 +1409,8 @@ Import -
+

1. Import a .CSV file

Select a .CSV file to import. If you need a sample of file to import, @@ -1440,9 +1441,9 @@ -

- Import Options - +
+ Import Options +
From 0e402d7143f5ab62b6474f0fe7b2c768ff1d93b5 Mon Sep 17 00:00:00 2001 From: xavinsky Date: Mon, 24 Oct 2011 16:18:27 +0200 Subject: [PATCH 41/91] fix lp:876308 package 'addons/base' not exist. I use standart method find_packages from setuptools for fill packages setup. lp bug: https://launchpad.net/bugs/876308 fixed bzr revid: xavier.manach@xcg-consulting.fr-20111024141827-e7l1dtefonxe6h3n --- setup.py | 172 +++++++++++++++++++++---------------------------------- 1 file changed, 66 insertions(+), 106 deletions(-) mode change 100755 => 100644 setup.py diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 index 374f7308ca8..c4d16fee83e --- a/setup.py +++ b/setup.py @@ -1,113 +1,73 @@ -#!/usr/bin/env python -# -*- 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 glob, os, re, setuptools, sys -from os.path import join, isfile +import os +import re +import sys +from setuptools import setup, find_packages -# List all data files -def data(): - files = [] - for root, dirnames, filenames in os.walk('openerp'): - for filename in filenames: - if not re.match(r'.*(\.pyc|\.pyo|\~)$',filename): - files.append(os.path.join(root, filename)) - d = {} - for v in files: - k=os.path.dirname(v) - if k in d: - d[k].append(v) - else: - d[k]=[v] - r = d.items() - return r +execfile('addons/web/common/release.py') -def gen_manifest(): - file_list="\n".join(data()) - open('MANIFEST','w').write(file_list) +version_dash_incompatible = False +if 'bdist_rpm' in sys.argv: + version_dash_incompatible = True +try: + import py2exe + from py2exe_utils import opts + version_dash_incompatible = True +except ImportError: + opts = {} +if version_dash_incompatible: + version = version.split('-')[0] -def py2exe_options(): - if os.name == 'nt': - import py2exe - return { - "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("pixmaps","openerp-icon.ico"))], }], - 'options' : { - "py2exe": { - "skip_archive": 1, - "optimize": 2, - "dist_dir": 'dist', - "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber" "vobject", "xml", "xml", "xml.dom", "xml.xpath", "yaml", ], - "excludes" : ["Tkconstants","Tkinter","tcl"], - } - } - } - else: - return {} +FILE_PATTERNS = \ + r'.+\.(py|cfg|po|pot|mo|txt|rst|gif|png|jpg|ico|mako|html|js|css|htc|swf)$' +def find_data_files(source, patterns=FILE_PATTERNS): + file_matcher = re.compile(patterns, re.I) + out = [] + for base, _, files in os.walk(source): + cur_files = [] + for f in files: + if file_matcher.match(f): + cur_files.append(os.path.join(base, f)) + if cur_files: + out.append( + (base, cur_files)) -execfile(join(os.path.dirname(__file__), 'openerp', 'release.py')) + return out -setuptools.setup( - name = 'openerp', - version = version, - description = description, - long_description = long_desc, - url = url, - author = author, - author_email = author_email, - classifiers = filter(None, classifiers.split("\n")), - license = license, - scripts = ['openerp-server'], - data_files = data(), - packages = setuptools.find_packages(), - #include_package_data = True, - install_requires = [ - # TODO the pychart package we include in openerp corresponds to PyChart 1.37. - # It seems there is a single difference, which is a spurious print in generate_docs.py. - # It is probably safe to move to PyChart 1.39 (the latest one). - # (Let setup.py choose the latest one, and we should check we can remove pychart from - # our tree.) http://download.gna.org/pychart/ - # TODO 'pychart', - 'babel', - 'feedparser', - 'gdata', - 'lxml', - 'mako', - 'psycopg2', - 'pydot', - 'python-dateutil', - 'python-ldap', - 'python-openid', - 'pytz', - 'pywebdav', - 'pyyaml', - 'reportlab', - 'simplejson', - 'vatnumber', - 'vobject', - 'werkzeug', - 'zsi', - ], - extras_require = { - 'SSL' : ['pyopenssl'], - }, - **py2exe_options() +setup( + name=name, + version=version, + description=description, + long_description=long_description, + author=author, + author_email=author_email, + url=url, + download_url=download_url, + license=license, + install_requires=[ + "Babel >= 0.9.6", + "simplejson >= 2.0.9", + "python-dateutil >= 1.4.1", + "pytz", + "werkzeug == 0.7", + ], + tests_require=[ + 'unittest2', + 'mock', + ], + test_suite = 'unittest2.collector', + zip_safe=False, + packages=find_packages(), + classifiers=[ + 'Development Status :: 6 - Production/Stable', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Environment :: Web Environment', + 'Topic :: Office/Business :: Financial', + ], + scripts=['scripts/openerp-web'], + data_files=(find_data_files('addons') + + opts.pop('data_files', []) + ), + **opts ) - From 1902ceca97be67fda806c91f1d85ecf47b85bb8e Mon Sep 17 00:00:00 2001 From: xavinsky Date: Mon, 24 Oct 2011 16:24:42 +0200 Subject: [PATCH 42/91] fix : setup scripts value error. bzr revid: xavier.manach@xcg-consulting.fr-20111024142442-zrc1po1ouhgauzxd --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c4d16fee83e..224049733ae 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ setup( 'Environment :: Web Environment', 'Topic :: Office/Business :: Financial', ], - scripts=['scripts/openerp-web'], + scripts=['openerp-web.py'], data_files=(find_data_files('addons') + opts.pop('data_files', []) ), From c3b6ba715702d6bd7d43d87af1adbf3bcd0bd505 Mon Sep 17 00:00:00 2001 From: xavinsky Date: Mon, 24 Oct 2011 16:25:43 +0200 Subject: [PATCH 43/91] rename openerp-web.py to openerp-web as openerp-server, openerp-client bzr revid: xavier.manach@xcg-consulting.fr-20111024142543-sottvrs1chqlw0t4 --- openerp-web.py => openerp-web | 0 setup.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename openerp-web.py => openerp-web (100%) diff --git a/openerp-web.py b/openerp-web similarity index 100% rename from openerp-web.py rename to openerp-web diff --git a/setup.py b/setup.py index 224049733ae..3f108685f94 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ setup( 'Environment :: Web Environment', 'Topic :: Office/Business :: Financial', ], - scripts=['openerp-web.py'], + scripts=['openerp-web'], data_files=(find_data_files('addons') + opts.pop('data_files', []) ), From 06344150ebf2860247929c76f3fc6d9b43ca27b9 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 24 Oct 2011 16:27:44 +0200 Subject: [PATCH 44/91] [FIX] automatically open options box if the file fails to parse entirely bzr revid: xmo@openerp.com-20111024142744-zeal912gqf9bvrrp --- addons/web/static/src/css/data_import.css | 4 ++ addons/web/static/src/js/data_import.js | 3 ++ addons/web/static/src/xml/base.xml | 46 +++++++++++------------ 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/addons/web/static/src/css/data_import.css b/addons/web/static/src/css/data_import.css index b1c4330402f..e5d1c9a910c 100644 --- a/addons/web/static/src/css/data_import.css +++ b/addons/web/static/src/css/data_import.css @@ -11,6 +11,10 @@ .openerp .oe_import_grid-row .oe_import_grid-cell { border-bottom: 1px solid #E3E3E3; } + +.openerp .oe-import-no-result .oe-import-result { + display: none; +} .openerp .oe-import fieldset { cursor: pointer; } diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index a284669732d..355c6c1b493 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -194,9 +194,11 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ : with_headers ? results.records.slice(1) : results.records })); + this.$element.find('fieldset').addClass('oe-closed'); } else if (results['error']) { result_node.append(QWeb.render('ImportView.error', { 'error': results['error']})); + this.$element.find('fieldset').removeClass('oe-closed'); } else if (results['success']) { if (this.widget_parent.widget_parent.active_view == "list") { this.widget_parent.reload_content(); @@ -204,6 +206,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ this.stop(); return; } + this.$element.find('form').removeClass('oe-import-no-result'); this.$element.delegate('.oe-m2o-drop-down-button', 'click', function () { $(this).prev('input').focus(); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index f2f77b83eb7..1054a76dcf6 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1410,7 +1410,7 @@ + class="oe-import oe-import-no-result">

1. Import a .CSV file

Select a .CSV file to import. If you need a sample of file to import, @@ -1420,28 +1420,9 @@

-
- -
- -

2. Check your file format

- - - - - - - - - - -
-
- - -
-
-
+

2. Check your file format

+
+
Import Options @@ -1471,6 +1452,25 @@
+ + + + + + + + + + + + + +
+
+ + +
+

The import failed due to:

From 2e0737e83041ad4f314c66130fa61beab414db55 Mon Sep 17 00:00:00 2001 From: xavinsky Date: Mon, 24 Oct 2011 16:34:08 +0200 Subject: [PATCH 45/91] Error when the log_config path is false. And it is false in default configuration for now. Then I switch to logging.basicConfig if path is bad. bzr revid: xavier.manach@xcg-consulting.fr-20111024143408-9zarpka33m3te2pf --- openerp-web | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp-web b/openerp-web index fe33585a233..667658b59ff 100755 --- a/openerp-web +++ b/openerp-web @@ -63,7 +63,7 @@ if __name__ == "__main__": os.environ["TZ"] = "UTC" - if sys.version_info >= (2, 7): + if sys.version_info >= (2, 7) and os.path.exists(options.log_config): with open(options.log_config) as file: dct = json.load(file) logging.config.dictConfig(dct) From fdcd161a7e7b1874d671190abeaa09c3fec40ac5 Mon Sep 17 00:00:00 2001 From: xavinsky Date: Mon, 24 Oct 2011 17:01:44 +0200 Subject: [PATCH 46/91] For import addons web modules, we need includes addons path in sys.path Default addons path didn't works in Debian. And config file or command line didn't affect the sys.path sys.path.insert must be do after path_addons evaluation by config or param. I add some formating path and test path with clearest error message. bzr revid: xavier.manach@xcg-consulting.fr-20111024150144-kwby5dwi1gla4gmr --- openerp-web | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/openerp-web b/openerp-web index 667658b59ff..ecc487dad26 100755 --- a/openerp-web +++ b/openerp-web @@ -10,11 +10,6 @@ import logging.config import werkzeug.serving import werkzeug.contrib.fixers -path_root = os.path.dirname(os.path.abspath(__file__)) -path_addons = os.path.join(path_root, 'addons') -if path_addons not in sys.path: - sys.path.insert(0, path_addons) - optparser = optparse.OptionParser() optparser.add_option("-s", "--session-path", dest="session_storage", default=os.path.join(tempfile.gettempdir(), "oe-sessions"), @@ -25,7 +20,7 @@ optparser.add_option("--server-port", dest="server_port", default=8069, help="OpenERP server port", type="int", metavar="NUMBER") optparser.add_option("--db-filter", dest="dbfilter", default='.*', help="Filter listed database", metavar="REGEXP") -optparser.add_option('--addons-path', dest='addons_path', default=[path_addons], action='append', +optparser.add_option('--addons-path', dest='addons_path', default=[], action='append', help="Path do addons directory", metavar="PATH") optparser.add_option('--load', dest='server_wide_modules', default=['web'], action='append', help="Load a additional module before login (by default only 'web' is loaded)", metavar="MODULE") @@ -55,12 +50,41 @@ logging_opts.add_option("--log-config", dest="log_config", default=os.path.join( help="Logging configuration file", metavar="FILE") optparser.add_option_group(logging_opts) -import web.common.http if __name__ == "__main__": (options, args) = optparser.parse_args(sys.argv[1:]) - options.backend = 'xmlrpc' + if not options.addons_path: + path_root = os.path.dirname(os.path.abspath(__file__)) + path_addons = os.path.join(path_root, 'addons') + if os.path.exists(path_addons): + options.addons_path.append(path_addons) + + def remove_end_slash(text): + if text[-1] in '/\\': + return text[:-1] + return text + + def drop_false_path(path): + if os.path.exists(path): + return True + + options.addons_path = map(remove_end_slash, options.addons_path) + options.addons_path = filter(drop_false_path, options.addons_path) + + if not options.addons_path: + raise('Error Importing web modules. Missing or incorrect --addons-path ') + + for path_addons in options.addons_path: + if path_addons not in sys.path: + sys.path.insert(0, path_addons) + + try: + import web.common.http + except: + raise('Error Importing web modules. addons_path must be wrong.') + + options.backend = 'xmlrpc' os.environ["TZ"] = "UTC" if sys.version_info >= (2, 7) and os.path.exists(options.log_config): From a617e3bacc5ea44b4aa3ec9840e3eb8a4009047f Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 24 Oct 2011 17:10:39 +0200 Subject: [PATCH 47/91] [fix] small problem with the context menu of m2o when there is not item selected bzr revid: nicolas.vanhoren@openerp.com-20111024151039-k9jlntcj3n56h13d --- addons/web/static/src/xml/base.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 1054a76dcf6..349dccec867 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -859,9 +859,9 @@