From 8d509498b6ee28c96866b76803b07bce00114329 Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Mon, 16 Dec 2013 18:26:02 +0530 Subject: [PATCH 01/37] [IMP] add stage mode widget bzr revid: rgaopenerp-20131216125602-r10t3se7hgvoy73w --- addons/web/static/src/js/view_form.js | 40 ++++++++++++++++++++++++++- addons/web/static/src/xml/base.xml | 25 +++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index f20e9053867..d772cbb55cd 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2330,7 +2330,44 @@ instance.web.form.FieldChar = instance.web.form.AbstractField.extend(instance.we }); } }); - +instance.web.form.StageMode = instance.web.form.FieldChar.extend({ + init: function (field_manager, node) { + this._super(field_manager, node); + this.options = py.eval(node.attrs.options) + this.stage_dataset = new instance.web.DataSetStatic(this, this.options.stage_model, this.build_context()); + this.stage_field = this.options.stage_field; + }, + + get_stage_value: function(){ + var def = $.Deferred(); + var stage_id = this.field_manager.fields[this.stage_field].get_value() + this.stage_dataset.call('search_read', [[[this.stage_field,'=', stage_id],['type','=',this.name]]]).then(function (res){ + def.resolve(res); + }) + return def + }, + + render_value: function() { + var self = this; + self.get_stage_value().then(function (res){ + var content = QWeb.render("StageMode."+self.name, { + 'widget': self, + 'res': res, + }); + self.$el.html(content); + self.$el.find("li").click(self.execute_action.bind(self)); + }) + }, + execute_action: function(e){ + e.preventDefault(); + var self = this; + $this = $(e.target) + var value = $this.data('value') || $this.parent().data('value'); + return this.view.dataset.call_button(self.options.action, [this.view.datarecord.id, value, this.view.dataset.get_context()]).done(function(r) { + self.view.reload(); + }); + } +}); instance.web.form.FieldID = instance.web.form.FieldChar.extend({ process_modifiers: function () { this._super(); @@ -5853,6 +5890,7 @@ instance.web.form.widgets = new instance.web.Registry({ 'monetary': 'instance.web.form.FieldMonetary', 'many2many_checkboxes': 'instance.web.form.FieldMany2ManyCheckBoxes', 'x2many_counter': 'instance.web.form.X2ManyCounter', + 'stage_mode':'instance.web.form.StageMode' }); /** diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index ae7a4f279b0..8d1f9cb01f4 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1031,6 +1031,31 @@ + + + +
+ + + + + + +
+
+ + + + + + + From b5feff915301efaef7468d736af78f963f2d1f24 Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Tue, 17 Dec 2013 17:03:10 +0530 Subject: [PATCH 02/37] [IMP] template set priority bzr revid: rgaopenerp-20131217113310-nkjo30xtdkebkj6q --- addons/web/static/src/xml/base.xml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 8d1f9cb01f4..c6a78ff7f0f 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1050,11 +1050,18 @@ - - - - + From 752fa2e2a5b144cb9ce2e7217827c2432f385255 Mon Sep 17 00:00:00 2001 From: "Mahendra Barad (OpenERP)" Date: Thu, 19 Dec 2013 14:08:51 +0530 Subject: [PATCH 03/37] [IMP]improved css as well as improved stagemode widget bzr revid: mba@tinyerp.com-20131219083851-c2hp4dddtpfxm0l6 --- addons/web/static/src/css/base.css | 38 +++++++++++++++++++++-- addons/web/static/src/css/base.sass | 25 +++++++++++++++ addons/web/static/src/js/view_form.js | 5 +-- addons/web/static/src/js/view_list.js | 3 +- addons/web/static/src/xml/base.xml | 6 ++-- addons/web_kanban/static/src/js/kanban.js | 13 +++++--- 6 files changed, 76 insertions(+), 14 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 010585ee4a0..e59be2e551e 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; @font-face { font-family: "mnmliconsRegular"; src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); @@ -2290,7 +2290,7 @@ } .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span { font-size: 80%; - color: darkGreen; + color: darkgreen; vertical-align: top; position: relative; top: -4px; @@ -3434,7 +3434,6 @@ div.ui-widget-overlay { overflow: hidden !important; } } - .nav li > a { padding: 3px 4px 2px 18px; color: #4c4c4c; @@ -3569,6 +3568,39 @@ h5 { color: #eeeeee; } +.dropdown-menu.with-arrow { + background: white; + background: white !important; +} + +.dropdown-menu.with-arrow:before { + position: absolute; + top: -12px; + left: 9px; + display: inline-block; + border-right: 12px solid transparent; + border-bottom: 12px solid #cccccc; + border-left: 12px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ""; +} + +.dropdown-menu.with-arrow:after { + position: absolute; + top: -11px; + left: 10px; + display: inline-block; + border-right: 11px solid transparent; + border-bottom: 11px solid white; + border-left: 11px solid transparent; + content: ""; +} + +.dropdown-menu.with-arrow li a { + color: black; + font-weight: bold; +} + .ui-icon { width: 18px; height: 18px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index e9a51370192..3f915de78d9 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2843,6 +2843,31 @@ h5 li a,a:hover,a:focus color: #eeeeee +.dropdown-menu.with-arrow + background: #FFF + background: #FFF !important +.dropdown-menu.with-arrow:before + position: absolute + top: -12px + left: 9px + display: inline-block + border-right: 12px solid transparent + border-bottom: 12px solid #ccc + border-left: 12px solid transparent + border-bottom-color: rgba(0, 0, 0, 0.2) + content: '' +.dropdown-menu.with-arrow:after + position: absolute + top: -11px + left: 10px + display: inline-block + border-right: 11px solid transparent + border-bottom: 11px solid #ffffff + border-left: 11px solid transparent + content: '' +.dropdown-menu.with-arrow li a + color: #000 + font-weight: bold // End hack }}} // Hack for ui icon {{{ diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index d772cbb55cd..ceed2037813 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2334,14 +2334,15 @@ instance.web.form.StageMode = instance.web.form.FieldChar.extend({ init: function (field_manager, node) { this._super(field_manager, node); this.options = py.eval(node.attrs.options) - this.stage_dataset = new instance.web.DataSetStatic(this, this.options.stage_model, this.build_context()); + this.stage_dataset = new instance.web.DataSetStatic(this, 'ir.ui.legend', this.build_context()); this.stage_field = this.options.stage_field; }, get_stage_value: function(){ var def = $.Deferred(); var stage_id = this.field_manager.fields[this.stage_field].get_value() - this.stage_dataset.call('search_read', [[[this.stage_field,'=', stage_id],['type','=',this.name]]]).then(function (res){ + var model = this.field_manager.fields[this.stage_field].field.relation + this.stage_dataset.call('search_read', [[['res_id','=', stage_id],['type','=',this.name],['res_model','=',model]]]).then(function (res){ def.resolve(res); }) return def diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 17c62917a18..d11393825cf 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1104,10 +1104,11 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. record.set(column.id, false); } } - return column.format(record.toForm().data, { + var value = column.format(record.toForm().data, { model: this.dataset.model, id: record.get('id') }); + return _.unescape(value) }, render: function () { this.$current.empty().append( diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index c6a78ff7f0f..14122c5acf8 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1040,17 +1040,17 @@ -