diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 9bd1f495f1e..430c11c19b3 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -3437,7 +3437,7 @@ body.oe_single_form .oe_single_form_container { .dropdown-menu.state { background: white; background: white !important; - min-width: 73px; + min-width: 100%; } .dropdown-menu.state li a, .dropdown-menu.state li a:hover, .dropdown-menu.state li a:focus { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 6a065668376..84db0ff5da7 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2777,7 +2777,7 @@ body.oe_single_form .dropdown-menu.state background: white background: white !important - min-width: 73px + min-width: 100% .dropdown-menu.state li a, .dropdown-menu.state li a:hover, .dropdown-menu.state li a:focus text-decoration: none color: #333 diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 3ef2aea706b..c10e2b56d27 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2338,9 +2338,9 @@ instance.web.Legend = instance.web.Widget.extend({ this.dataset = dataset; }, prepare_kanban_state_legend: function(){ - return [{ 'name': 'normal', 'legend_name': ' Normal', 'legend_class': 'btn-default' }, + return [{ 'name': 'normal', 'legend_name': ' In Progress', 'legend_class': 'btn-default' }, { 'name': 'blocked', 'legend_name': ' Blocked', 'legend_class': 'btn-danger' }, - { 'name': 'done', 'legend_name': ' Done', 'legend_class': 'btn-success' }] + { 'name': 'done', 'legend_name': ' Ready', 'legend_class': 'btn-success' }] }, prepare_priority_legend: function(){ var data = []; @@ -2379,9 +2379,7 @@ instance.web.Legend = instance.web.Widget.extend({ this.parent.$el.html(content); else this.parent.$el = $(content); - if (!this.parent.get("effective_readonly")){ - this.parent.$el.find('.oe_legend').click(self.do_action.bind(self)); - } + this.parent.$el.find('.oe_legend').click(self.do_action.bind(self)); }, do_action: function(e){ var self = this; @@ -2389,7 +2387,15 @@ instance.web.Legend = instance.web.Widget.extend({ if (li.length){ var value = {}; value[self.parent.name] = String(li.data('value')); - return self.dataset._model.call('write', [[self.record_id], value, self.dataset.get_context()]).done(self.parent.reload_record.bind(self.parent)); + if (self.record_id){ + return self.dataset._model.call('write', [[self.record_id], value, self.dataset.get_context()]).done(self.parent.reload_record.bind(self.parent)); + } else { + return self.parent.view.on_button_save().done(function(result) { + if (result){ + self.dataset._model.call('write', [[result], value, self.dataset.get_context()]).done(self.parent.reload_record.bind(self.parent)); + } + }); + } } } });