From 0b3956e2b4fd4512b4952dd6286b756da190e1b5 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Wed, 18 Apr 2012 10:56:25 +0530 Subject: [PATCH 01/21] [IMP] crm: Improved code to make pending state records bold bzr revid: tpa@tinyerp.com-20120418052625-i56b39c38pdd5gfh --- addons/crm/crm_lead_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 7a985c94b71..655fdeba793 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -169,7 +169,7 @@ crm.lead tree - + From 4ab750b80d3f168801972a5b826ea7560552c4ce Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Wed, 18 Apr 2012 18:21:24 +0530 Subject: [PATCH 02/21] [IMP] added example for fonts attribute bzr revid: tpa@tinyerp.com-20120418125124-syv5no1dsv98e1h4 --- addons/crm/crm_lead_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 655fdeba793..9a94144823b 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -169,7 +169,7 @@ crm.lead tree - + From b55d7abf1c9eb387722e6f62e729276fba2a07a1 Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Thu, 19 Apr 2012 15:18:52 +0530 Subject: [PATCH 03/21] [IMP]project,project_issue: add listview bold feature bzr revid: kjo@tinyerp.com-20120419094852-w5s0evbdt2z4nf8x --- addons/project/project_view.xml | 6 ++++-- addons/project_issue/project_issue_view.xml | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index c48b075721a..63898cb518d 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -140,8 +140,9 @@ tree child_ids - + + @@ -414,7 +415,8 @@ tree - + + diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index cb532f4af38..50c79346127 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -123,7 +123,8 @@ project.issue tree - + + From 055de194f172c03061962583f19ca2a2d4a34df0 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 19 Apr 2012 15:29:54 +0530 Subject: [PATCH 04/21] [IMP] crm,sale:improved code for tree view bzr revid: tpa@tinyerp.com-20120419095954-dx9quzex5k1d2ylb --- addons/crm/crm_lead_view.xml | 6 ++++-- addons/crm/crm_meeting_view.xml | 3 ++- addons/crm/crm_phonecall_view.xml | 6 ++++-- addons/sale/sale_view.xml | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 9a94144823b..7de9858713a 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -169,7 +169,8 @@ crm.lead tree - + + @@ -536,7 +537,8 @@ crm.lead tree - + + diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index a82a34d80ce..d740a00cf02 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -224,8 +224,9 @@ crm.meeting tree - + diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index ae0e0ce7f3c..eb836428b6e 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -24,7 +24,8 @@ crm.phonecall tree - + + @@ -132,7 +133,8 @@ crm.phonecall tree - + + tree 2 - + + From a326d17fabca540761957be708231feb24e626fe Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 19 Apr 2012 15:36:53 +0530 Subject: [PATCH 05/21] [IMP] purchase:improved code for tree view bzr revid: tpa@tinyerp.com-20120419100653-1mwb6lao6oz0kf9p --- addons/purchase/purchase_view.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index b1511139102..45e0882edc8 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -286,7 +286,8 @@ purchase.order tree - + + From b657cdb9671908351310cf4ceed9916f95dcc038 Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Thu, 19 Apr 2012 15:38:55 +0530 Subject: [PATCH 06/21] [IMP]hr_recruitment, hr_holidays: add treeview fonts bold bzr revid: kjo@tinyerp.com-20120419100855-7tomt33drutwkpvy --- addons/hr_holidays/hr_holidays_view.xml | 9 ++++++--- addons/hr_recruitment/hr_recruitment_view.xml | 3 ++- addons/project_issue/project_issue_view.xml | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index d6ee7ed869c..066ac29c6e3 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -150,7 +150,8 @@ hr.holidays tree - + + @@ -205,7 +206,8 @@ tree 20 - + + @@ -231,7 +233,8 @@ hr.holidays tree - + + diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 1f7d916c6f3..9e4948eebc6 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -41,7 +41,8 @@ hr.applicant tree - + + diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 50c79346127..3b47965306c 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -123,7 +123,7 @@ project.issue tree - + @@ -291,8 +291,9 @@ project.issue tree - + + From 3ebc3652ffb8378da145fc89b82e647b11bfde30 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 19 Apr 2012 15:46:38 +0530 Subject: [PATCH 07/21] [IMP] mrp:improved code for tree view bzr revid: tpa@tinyerp.com-20120419101638-ltl5621fdkyyv8yr --- addons/mrp/mrp_view.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 986e1b2f754..76062249d7d 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -573,7 +573,8 @@ mrp.production tree - + + From 8f5c30c7e987ae78d0be834499eb7f0978d96d01 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 19 Apr 2012 13:55:04 +0200 Subject: [PATCH 08/21] [FIX] really convert to float when trying to convert to float might work better than converting to a float field bzr revid: xmo@openerp.com-20120419115504-2tic6l0qjb8zlhuh --- openerp/osv/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index e228ac32c41..95aecf18ec6 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -1057,7 +1057,7 @@ class function(_column): # This is not needed for stored fields and non-functional integer # fields, as their values are constrained by the database backend # to the same 32bits signed int limit. - result = float(value) + result = __builtins__.float(value) return result def get(self, cr, obj, ids, name, uid=False, context=None, values=None): From 931c2376862f1064aafaecd044712465e394bb9e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 19 Apr 2012 15:02:45 +0200 Subject: [PATCH 09/21] [FIX] previous fix: actual module should be __builtin__ apparently we do weird things with __builtins__, on my machine it's consistently an alias to the __builtin__ importable module, but in the server it's a dict bzr revid: xmo@openerp.com-20120419130245-ael83wc5h310m38s --- openerp/osv/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 95aecf18ec6..4364c0f985e 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -1057,7 +1057,7 @@ class function(_column): # This is not needed for stored fields and non-functional integer # fields, as their values are constrained by the database backend # to the same 32bits signed int limit. - result = __builtins__.float(value) + result = __builtin__.float(value) return result def get(self, cr, obj, ids, name, uid=False, context=None, values=None): From 9ca448c1e868b6acf6581d32a85c226b7e396e98 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 19 Apr 2012 15:43:41 +0200 Subject: [PATCH 10/21] [imp] Changed some names to improve framework comprehension bzr revid: nicolas.vanhoren@openerp.com-20120419134341-b6rcx58lghgvayia --- addons/web/static/src/js/corelib.js | 18 ++++++++---------- addons/web/static/src/js/view_form.js | 6 +++--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index cbd28aca8a3..32e35575933 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -239,9 +239,7 @@ instance.web.ParentedMixin = { }; /** - * TODO al: move into the the mixin - * - * Backbone's events + * Backbone's events. Do not ever use it directly, use EventDispatcherMixin instead. * * (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. * Backbone may be freely distributed under the MIT license. @@ -253,8 +251,7 @@ instance.web.ParentedMixin = { * events is done in EventDispatcherMixin. * */ -instance.web.Events = instance.web.Class.extend({ - +var Events = instance.web.Class.extend({ on : function(events, callback, context) { var ev; events = events.split(/\s+/); @@ -323,12 +320,13 @@ instance.web.Events = instance.web.Class.extend({ return this; } }); +// end of Jeremy Ashkenas' code instance.web.EventDispatcherMixin = _.extend({}, instance.web.ParentedMixin, { __eventDispatcherMixin: true, init: function() { instance.web.ParentedMixin.init.call(this); - this.__edispatcherEvents = new instance.web.Events(); + this.__edispatcherEvents = new Events(); this.__edispatcherRegisteredEvents = []; }, on: function(events, dest, func) { @@ -373,7 +371,7 @@ instance.web.EventDispatcherMixin = _.extend({}, instance.web.ParentedMixin, { } }); -instance.web.GetterSetterMixin = _.extend({}, instance.web.EventDispatcherMixin, { +instance.web.PropertiesMixin = _.extend({}, instance.web.EventDispatcherMixin, { init: function() { instance.web.EventDispatcherMixin.init.call(this); this.__getterSetterInternalMap = {}; @@ -400,9 +398,9 @@ instance.web.GetterSetterMixin = _.extend({}, instance.web.EventDispatcherMixin, } }); -instance.web.CallbackEnabledMixin = _.extend({}, instance.web.GetterSetterMixin, { +instance.web.CallbackEnabledMixin = _.extend({}, instance.web.PropertiesMixin, { init: function() { - instance.web.GetterSetterMixin.init.call(this); + instance.web.PropertiesMixin.init.call(this); var self = this; var callback_maker = function(obj, name, method) { var callback = function() { @@ -535,7 +533,7 @@ instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { if(this.$element != null) { this.$element.remove(); } - instance.web.GetterSetterMixin.destroy.call(this); + instance.web.PropertiesMixin.destroy.call(this); }, /** * Renders the current widget and appends it to the given jQuery object or Widget. diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 47cee79ffcb..a87982fdabd 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1307,7 +1307,7 @@ instance.web.form.compute_domain = function(expr, fields) { }; /** - * Must be applied over an class already possessing the GetterSetterMixin. + * Must be applied over an class already possessing the PropertiesMixin. * * Apply the result of the "invisible" domain to this.$element. */ @@ -1335,10 +1335,10 @@ instance.web.form.InvisibilityChangerMixin = { }, }; -instance.web.form.InvisibilityChanger = instance.web.Class.extend(_.extend({}, instance.web.GetterSetterMixin, instance.web.form.InvisibilityChangerMixin, { +instance.web.form.InvisibilityChanger = instance.web.Class.extend(_.extend({}, instance.web.PropertiesMixin, instance.web.form.InvisibilityChangerMixin, { init: function(parent, field_manager, invisible_domain, $element) { this.setParent(parent); - instance.web.GetterSetterMixin.init.call(this); + instance.web.PropertiesMixin.init.call(this); instance.web.form.InvisibilityChangerMixin.init.call(this, field_manager, invisible_domain); this.$element = $element; this.start(); From 869407033ef430be11bbec8663b1d88dfcf9d0fd Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 19 Apr 2012 16:28:14 +0200 Subject: [PATCH 11/21] [fix] problem with sidebar showing in popups bzr revid: nicolas.vanhoren@openerp.com-20120419142814-7hp51n8lp7iwlucc --- addons/web/static/src/js/views.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 36e3c2b802b..9625e074e83 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -245,7 +245,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ controller : null, options : _.extend({ $buttons : self.$element.find('.oe_view_manager_buttons'), - $sidebar : self.$element.find('.oe_view_manager_sidebar'), + $sidebar : self.flags.sidebar ? self.$element.find('.oe_view_manager_sidebar') : undefined, $pager : self.$element.find('.oe_view_manager_pager'), action : self.action, action_views_ids : views_ids From 3da11976a455a0ad55fcf8ecaee534fd61ff7ed1 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 19 Apr 2012 16:50:51 +0200 Subject: [PATCH 12/21] [fix] problem with editable lists & buttons bzr revid: nicolas.vanhoren@openerp.com-20120419145051-41ywt5u35z04m8wm --- addons/web/static/src/js/view_list_editable.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index ac19e3f341d..2015232349a 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -406,14 +406,17 @@ openerp.web.list_editable = function (instance) { if (modifiers.tree_invisible === true) $td.hide(); var tag_name = el.tagName.toLowerCase(); - var key = tag_name; + var w; if (tag_name === "field") { var name = $(el).attr("name"); - key = $(el).attr('widget') || self.fvg.fields[name].type; + var key = $(el).attr('widget') || self.fvg.fields[name].type; + var obj = self.view.fields_registry.get_object(key); + w = new (obj)(self.view, instance.web.xml_to_json(el)); + self.view.register_field(w, $(el).attr("name")); + } else { + var obj = self.tags_registry.get_object(tag_name); + w = new (obj)(self.view, instance.web.xml_to_json(el)); } - var obj = self.view.fields_registry.get_object(key); - var w = new (obj)(self.view, instance.web.xml_to_json(el)); - self.view.register_field(w, $(el).attr("name")); w.appendTo($td); $td.appendTo($element); }); From a6bc55c95ca613c288df7213448bc623558828a4 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 19 Apr 2012 17:11:39 +0200 Subject: [PATCH 13/21] [fix] problem in calendar view bzr revid: nicolas.vanhoren@openerp.com-20120419151139-92ujq4get9gxbkl3 --- addons/web_calendar/static/src/js/calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 8bd83c0bb30..b4c43fbba98 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -289,9 +289,9 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ var field_name = self[field]; if (field_name && form.fields[field_name]) { var ffield = form.fields[field_name]; - ffield.reset(); + ffield._dirty_flag = false; $.when(ffield.set_value(data[field_name])).then(function() { - ffield.dirty = true; + ffield._dirty_flag = true; form.do_onchange(ffield); }); } From 5afd20a530f53a8da14778673468980312333518 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 19 Apr 2012 17:33:41 +0200 Subject: [PATCH 14/21] [IMP] Improved rendering engine group cells width computing bzr revid: fme@openerp.com-20120419153341-gequ3826z6fd44x6 --- addons/web/static/src/css/base.css | 5 ++++- addons/web/static/src/css/base.sass | 4 +++- addons/web/static/src/js/view_form.js | 15 ++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 854946cdf97..2b90d47c002 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1783,11 +1783,14 @@ font-weight: bold; } .openerp .oe_layout_debugging .oe_form_group { - outline: 2px dashed red; + outline: 2px dashed green; } .openerp .oe_layout_debugging .oe_form_group_cell { outline: 1px solid blue; } +.openerp .oe_layout_debugging .oe_form_group:hover, .openerp .oe_layout_debugging .oe_form_group_cell:hover { + outline-color: red; +} .openerp .oe_debug_view { float: left; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 98caeafbb29..fc645a92e44 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1490,9 +1490,11 @@ $colour4: #8a89ba // Debugging stuff {{{ .oe_layout_debugging .oe_form_group - outline: 2px dashed red + outline: 2px dashed green .oe_form_group_cell outline: 1px solid blue + .oe_form_group:hover, .oe_form_group_cell:hover + outline-color: red .oe_debug_view float: left diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a87982fdabd..c13e283354c 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1119,7 +1119,20 @@ instance.web.form.FormRenderingEngine = instance.web.Class.extend({ } break; default: - to_compute.push($td); + var width = _.str.trim($child.attr('width') || ''), + iwidth = parseInt(width, 10); + if (iwidth) { + if (width.substr(-1) === '%') { + total -= iwidth; + width = iwidth + '%'; + } + $td.attr('width', width); + $child.removeAttr('width'); + row_cols--; + } else { + to_compute.push($td); + } + } }); var unit = Math.floor(total / row_cols); From 630eabbbb221cdf2ca0bece16f09c858efcbde9a Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 19 Apr 2012 17:38:57 +0200 Subject: [PATCH 15/21] [fix] some problem in editable list, still not solved but made more usable until we find a real fix bzr revid: nicolas.vanhoren@openerp.com-20120419153857-cdnau0g5yt2e1iy6 --- addons/web/static/src/js/view_list_editable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 2015232349a..ca6dcc7c1c8 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -420,7 +420,7 @@ openerp.web.list_editable = function (instance) { w.appendTo($td); $td.appendTo($element); }); - $("").appendTo($element); + $("").appendTo($element); }, }); }; From 8a66f58d52dc556737029a90b95fa33ac0a5135c Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 19 Apr 2012 17:55:14 +0200 Subject: [PATCH 16/21] [fix] problem in editable lists: could not edit an existing row bzr revid: nicolas.vanhoren@openerp.com-20120419155514-j8bslmn6z7z1dh8h --- addons/web/static/src/js/view_form.js | 5 +---- addons/web/static/src/js/view_list_editable.js | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index c13e283354c..1d17e1acab0 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -52,7 +52,6 @@ instance.web.FormView = instance.web.View.extend({ this.mutating_mutex = new $.Mutex(); this.on_change_mutex = new $.Mutex(); this.reload_mutex = new $.Mutex(); - this.mode = null; this.rendering_engine = new instance.web.form.FormRenderingEngineReadonly(this); this.qweb = null; // A QWeb instance will be created if the view is a QWeb template }, @@ -499,9 +498,8 @@ instance.web.FormView = instance.web.View.extend({ } }, switch_mode: function() { - var mode = this.get("mode"); var self = this; - if(mode=="view") { + if(this.get("mode") == "view") { self.$buttons.find('.oe_form_buttons_edit').hide(); self.$buttons.find('.oe_form_buttons_view').show(); _.each(this.fields,function(field){ @@ -514,7 +512,6 @@ instance.web.FormView = instance.web.View.extend({ field.set({"force_readonly": false}); }); } - self.mode = mode; }, on_button_save: function() { var self = this; diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index ca6dcc7c1c8..816143afa5d 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -372,6 +372,7 @@ openerp.web.list_editable = function (instance) { init: function() { this._super.apply(this, arguments); this.rendering_engine = new instance.web.ListEditableRenderingEngine(this); + this.options.initial_mode = "edit"; }, renderElement: function() {} }); From 58483fcd65cc0515afa343876a94e0a9d17c64a2 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Thu, 19 Apr 2012 22:44:18 +0200 Subject: [PATCH 17/21] [IMP] form change cancel button into discard link bzr revid: al@openerp.com-20120419204418-mn8r1w624j4ba46o --- addons/web/static/src/js/view_form.js | 16 ++++++++-------- addons/web/static/src/xml/base.xml | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 1d17e1acab0..c457554e44b 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -88,13 +88,12 @@ instance.web.FormView = instance.web.View.extend({ } else { this.$element.find('.oe_form_buttons').replaceWith(this.$buttons); } - this.$buttons - .on('click','button.oe_form_button_save',this.on_button_save) - .on('click','button.oe_form_button_cancel',this.on_button_cancel) - .on('click','button.oe_form_button_edit',this.on_button_edit) - .on('click','button.oe_form_button_create',this.on_button_create) - .on('click','button.oe_form_button_duplicate',this.on_button_duplicate) - .on('click','button.oe_form_button_delete',this.on_button_delete); + this.$buttons.on('click','.oe_form_button_create',this.on_button_create); + this.$buttons.on('click','.oe_form_button_edit',this.on_button_edit); + this.$buttons.on('click','.oe_form_button_duplicate',this.on_button_duplicate); + this.$buttons.on('click','.oe_form_button_delete',this.on_button_delete); + this.$buttons.on('click','.oe_form_button_save',this.on_button_save); + this.$buttons.on('click','.oe_form_button_cancel',this.on_button_cancel); this.$pager = $(QWeb.render("FormView.pager", {'widget':self})); if (this.options.$pager) { @@ -519,10 +518,11 @@ instance.web.FormView = instance.web.View.extend({ self.set({mode: "view"}); }); }, - on_button_cancel: function() { + on_button_cancel: function(event) { if (this.can_be_discarded()) { this.set({mode: "view"}); } + return false; }, on_button_new: function() { var self = this; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index b47c8d01684..b11eadde42d 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -715,8 +715,8 @@ - - + or + Discard From af1eeca0c3ad29643eb4d838d490a16e80c2d0e5 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Thu, 19 Apr 2012 22:52:52 +0200 Subject: [PATCH 18/21] [FIX] restore default user menu avatar bzr revid: al@openerp.com-20120419205252-jsbldr26uc7ioi35 --- addons/web/static/src/img/user_menu_avatar.png | Bin 0 -> 846 bytes addons/web/static/src/xml/base.xml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 addons/web/static/src/img/user_menu_avatar.png diff --git a/addons/web/static/src/img/user_menu_avatar.png b/addons/web/static/src/img/user_menu_avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..a2c70ea7d498e746904ee270cffe6fcb45f7c6b6 GIT binary patch literal 846 zcmex=_1P|rX?qqI0P zFI~aY%U!`Mz|~!$%*;qrN1?DZF(6Oj-S5fuR$!pIEN!@|nR z%E~Fi%grl7GWdUhL6Cz%j6sZ4 zD%dK(z{JSR%*4VBay3wOEl{3;MUYiU(a@1iI53f2sZhkIapFP_Wv7h?MT0JWP%%y_ zYU1P)6PJ*bQdLve(9|+9H8Z!cv~qTFb#wRd^a>6M4GWKmj7m;PO-s+n%qlJ^Ei136 ztZHs)ZENr7?3y%r%G7DoXUv?nXz`Mz%a*TLxoXqqEnBy3-?4Mop~FXx9y@;G&P778mFHFAhJO|>fcdxG1 zdgg7NTwEgXvoM9P{?`@8&+{}EUR_+~9<**bYeYh`D?`=wgKzCLzI5-t!)!9SGJ3D5 sgT
  • - +
      From fc585722019735e0b2ac441f54b774901f1d7a98 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Thu, 19 Apr 2012 23:47:19 +0200 Subject: [PATCH 19/21] [REM] default homepage bzr revid: al@openerp.com-20120419214719-pj23mry2gs0fi44y --- addons/board/board_data_admin.xml | 3 +-- addons/board/board_data_home.xml | 31 ------------------------------- addons/board/board_demo.xml | 4 ---- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/addons/board/board_data_admin.xml b/addons/board/board_data_admin.xml index 1942aa7c066..dfe4134be99 100644 --- a/addons/board/board_data_admin.xml +++ b/addons/board/board_data_admin.xml @@ -35,10 +35,9 @@
      - + -
      diff --git a/addons/board/board_data_home.xml b/addons/board/board_data_home.xml index 8794173810a..f1e90ace7ad 100644 --- a/addons/board/board_data_home.xml +++ b/addons/board/board_data_home.xml @@ -37,36 +37,5 @@ - - - Homepage Board - board.board - form - -
      - - - - - -
      -
      -
      - - Home Page - board.board - form - form - - - - - - - - - - - diff --git a/addons/board/board_demo.xml b/addons/board/board_demo.xml index 384e29abdf2..d36ec6161fe 100644 --- a/addons/board/board_demo.xml +++ b/addons/board/board_demo.xml @@ -1,9 +1,5 @@ - - - - From 5522c5e10022fa2d049ab83a21741a6fb5b70906 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Thu, 19 Apr 2012 23:53:44 +0200 Subject: [PATCH 20/21] [REM] homepage support, trigger first menu item instead bzr revid: al@openerp.com-20120419215344-vn1yyk70oztpn2mw --- addons/web/static/src/js/chrome.js | 8 +- .../web_dashboard/static/src/js/dashboard.js | 155 ------------------ .../static/src/xml/web_dashboard.xml | 62 ------- 3 files changed, 7 insertions(+), 218 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index f1d3faef367..f43da0431ff 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -638,6 +638,7 @@ instance.web.Menu = instance.web.Widget.extend({ } }, on_menu_click: function(ev, id) { + // TODO If first level menu doesnt have action trigger first leaf this.do_hide_more(); id = id || 0; var $clicked_menu, manual = false; @@ -984,13 +985,18 @@ instance.web.WebClient = instance.web.Widget.extend({ }); }, bind_hashchange: function() { + var self = this; $(window).bind('hashchange', this.on_hashchange); var state = $.bbq.getState(true); if (! _.isEmpty(state)) { $(window).trigger('hashchange'); } else { - this.action_manager.do_action({type: 'ir.actions.client', tag: 'default_home'}); + self.menu.has_been_loaded.then(function() { + var first_menu_id = self.menu.$element.find("a:first").data("menu"); + if(first_menu_id) + self.menu.on_menu_click(null,first_menu_id); + }); } }, on_hashchange: function(event) { diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index f0c04d6d270..d9f4443ac24 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -277,87 +277,6 @@ instance.web.form.tags.add('hpaned', 'instance.web.form.DashBoardLegacy'); instance.web.form.tags.add('vpaned', 'instance.web.form.DashBoardLegacy'); instance.web.form.tags.add('board', 'instance.web.form.DashBoard'); -/* - * ConfigOverview - * This client action designed to be used as a dashboard widget display - * ir.actions.todo in a fancy way - */ -instance.web.client_actions.add( 'board.config.overview', 'instance.web_dashboard.ConfigOverview'); -instance.web_dashboard.ConfigOverview = instance.web.View.extend({ - template: 'ConfigOverview', - init: function (parent) { - this._super(parent); - this.user = _.extend(new instance.web.DataSet(this, 'res.users'), { - index: 0, - ids: [this.session.uid] - }); - this.dataset = new instance.web.DataSetSearch(this, 'ir.actions.todo'); - }, - start: function () { - var self = this; - return this.user.read_index(['groups_id']).pipe(function(record) { - var todos_filter = [ - ['type', '!=', 'automatic'], - '|', ['groups_id', '=', false], - ['groups_id', 'in', record['groups_id']]]; - return $.when( - self.dataset.read_slice( - ['state', 'action_id', 'category_id'], - { domain: todos_filter } - ), - self.dataset.call('progress').pipe( - function (arg) { return arg; }, null)) - }, null).then(this.on_records_loaded); - - }, - on_records_loaded: function (records, progress) { - var grouped_todos = _(records).chain() - .map(function (record) { - return { - id: record.id, - name: record.action_id[1], - done: record.state !== 'open', - to_do: record.state === 'open', - category: record['category_id'][1] || _t("Uncategorized") - } - }) - .groupBy(function (record) {return record.category}) - .value(); - this.$element.html(QWeb.render('ConfigOverview.content', { - completion: 100 * progress.done / progress.total, - groups: grouped_todos, - task_title: _t("Execute task \"%s\""), - checkbox_title: _t("Mark this task as done"), - _: _ - })); - var $progress = this.$element.find('div.oe-config-progress-bar'); - $progress.progressbar({value: $progress.data('completion')}); - - var self = this; - this.$element.find('dl') - .delegate('input', 'click', function (e) { - // switch todo status - e.stopImmediatePropagation(); - var new_state = this.checked ? 'done' : 'open', - todo_id = parseInt($(this).val(), 10); - self.dataset.write(todo_id, {state: new_state}, {}, function () { - self.start(); - }); - }) - .delegate('li:not(.oe-done)', 'click', function () { - self.getParent().getParent().getParent().do_execute_action({ - type: 'object', - name: 'action_launch' - }, self.dataset, - $(this).data('id'), function () { - // after action popup closed, refresh configuration - // thingie - self.start(); - }); - }); - } -}); - /* * Widgets * This client action designed to be used as a dashboard widget display @@ -397,79 +316,5 @@ instance.web_dashboard.Widget = instance.web.View.extend(/** @lends instance.web } }); -/* - * HomeTiles this client action display either the list of application to - * install (if none is installed yet) or a list of root menu items - */ -instance.web.client_actions.add('default_home', 'session.web_dashboard.ApplicationTiles'); -instance.web_dashboard.ApplicationTiles = instance.web.OldWidget.extend({ - template: 'web_dashboard.ApplicationTiles', - init: function(parent) { - this._super(parent); - }, - start: function() { - var self = this; - var domain = [['application','=',true], ['state','=','installed'], ['name', '!=', 'base']]; - var ds = new instance.web.DataSetSearch(this, 'ir.module.module',{},domain); - ds.read_slice(['id']).then(function(result) { - if(result.length) { - self.on_installed_database(); - } else { - self.on_uninstalled_database(); - } - }); - }, - on_uninstalled_database: function() { - installer = new instance.web_dashboard.ApplicationInstaller(this); - installer.appendTo(this.$element); - }, - on_installed_database: function() { - var self = this; - self.rpc('/web/menu/get_user_roots', {}).then(function (menu_ids) { - var menuds = new instance.web.DataSet(this, 'ir.ui.menu',{}) - .read_ids(menu_ids, ['name', 'web_icon_data', 'web_icon_hover_data', 'module']).then(function (applications) { - var tiles = QWeb.render('ApplicationTiles.content', {applications: applications}); - $(tiles).appendTo(self.$element).find('.oe_install-module-link').click(function () { - instance.webclient.menu.on_menu_click(null, $(this).data('menu')) - }); - }); - }); - } -}); - -/** - * ApplicationInstaller - * This client action display a list of applications to install. - */ -instance.web.client_actions.add( 'board.application.installer', 'instance.web_dashboard.ApplicationInstaller'); -instance.web_dashboard.ApplicationInstaller = instance.web.OldWidget.extend({ - template: 'web_dashboard.ApplicationInstaller', - start: function () { - // TODO menu hide - var r = this._super(); - this.action_manager = new instance.web.ActionManager(this); - this.action_manager.appendTo(this.$element.find('.oe_installer')); - this.action_manager.do_action({ - type: 'ir.actions.act_window', - res_model: 'ir.module.module', - domain: [['application','=',true]], - views: [[false, 'kanban']], - flags: { - display_title:false, - search_view: false, - views_switcher: false, - action_buttons: false, - sidebar: false, - pager: false - } - }); - return r; - }, - destroy: function() { - this.action_manager.destroy(); - return this._super(); - } -}); - }; diff --git a/addons/web_dashboard/static/src/xml/web_dashboard.xml b/addons/web_dashboard/static/src/xml/web_dashboard.xml index 9a9c0486400..c182d8b58a7 100644 --- a/addons/web_dashboard/static/src/xml/web_dashboard.xml +++ b/addons/web_dashboard/static/src/xml/web_dashboard.xml @@ -56,71 +56,9 @@ -
      - -
      -
      - progress: % -
      -
      -
      -

      Click on the functionalites listed below to launch them and configure your system

      -
      - -
      -
        -
      • - - -
      • -
      -
      - -
      - -