summaryrefslogtreecommitdiff
path: root/addons/board/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/board/static/src')
-rw-r--r--addons/board/static/src/css/dashboard.css19
-rw-r--r--addons/board/static/src/css/dashboard.sass17
-rw-r--r--addons/board/static/src/js/dashboard.js50
-rw-r--r--addons/board/static/src/xml/board.xml1
4 files changed, 53 insertions, 34 deletions
diff --git a/addons/board/static/src/css/dashboard.css b/addons/board/static/src/css/dashboard.css
index 38e224daf42..ed66e338c81 100644
--- a/addons/board/static/src/css/dashboard.css
+++ b/addons/board/static/src/css/dashboard.css
@@ -1,3 +1,17 @@
+.openerp .oe_dashboard_layout_selector ul {
+ white-space: nowrap;
+}
+.openerp .oe_dashboard_layout_selector li {
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+ float: left;
+}
+.openerp .oe_dashboard_layout_selector li .oe_dashboard_selected_layout {
+ margin-left: -30px;
+ vertical-align: bottom;
+ margin-bottom: 10px;
+}
.openerp .oe_dashboard_links {
text-align: right;
margin: 0 4px 6px 0;
@@ -5,11 +19,6 @@
.openerp .oe_dashboard {
width: 100%;
}
-.openerp .oe_dashboard .oe_dashboard_layout_selector ul, .openerp .oe_dashboard .oe_dashboard_layout_selector li {
- margin: 0;
- padding: 0;
- list-style-type: none;
-}
.openerp .oe_dashboard .oe_action {
margin: 0 8px 8px 0;
background-color: white;
diff --git a/addons/board/static/src/css/dashboard.sass b/addons/board/static/src/css/dashboard.sass
index 1bfc01a3809..32f0e3b4f3a 100644
--- a/addons/board/static/src/css/dashboard.sass
+++ b/addons/board/static/src/css/dashboard.sass
@@ -9,16 +9,23 @@
box-shadow: $bsval
.openerp
+ .oe_dashboard_layout_selector
+ ul
+ white-space: nowrap
+ li
+ margin: 0
+ padding: 0
+ list-style-type: none
+ float: left
+ .oe_dashboard_selected_layout
+ margin-left: -30px
+ vertical-align: bottom
+ margin-bottom: 10px
.oe_dashboard_links
text-align: right
margin: 0 4px 6px 0
.oe_dashboard
width: 100%
- .oe_dashboard_layout_selector
- ul, li
- margin: 0
- padding: 0
- list-style-type: none
.oe_action
margin: 0 8px 8px 0
background-color: white
diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js
index 0333690aa57..9c37924144d 100644
--- a/addons/board/static/src/js/dashboard.js
+++ b/addons/board/static/src/js/dashboard.js
@@ -220,36 +220,40 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
am.do_action = function (action) {
self.do_action(action);
};
- if (action_attrs.creatable && action_attrs.creatable !== 'false') {
- var action_id = parseInt(action_attrs.creatable, 10);
- $action.parent().find('button.oe_dashboard_button_create').click(function() {
- if (isNaN(action_id)) {
- action_orig.flags.default_view = 'form';
- self.do_action(action_orig);
- } else {
- self.rpc('/web/action/load', {
- action_id: action_id
- }, function(result) {
- result.result.flags = result.result.flags || {};
- result.result.flags.default_view = 'form';
- self.do_action(result.result);
- });
- }
- });
- }
if (am.inner_widget) {
- am.inner_widget.on_mode_switch.add(function(mode) {
+ var new_form_action = function(id, editable) {
var new_views = [];
_.each(action_orig.views, function(view) {
- new_views[view[1] === mode ? 'unshift' : 'push'](view);
+ new_views[view[1] === 'form' ? 'unshift' : 'push'](view);
});
- if (!new_views.length || new_views[0][1] !== mode) {
- new_views.unshift([false, mode]);
+ if (!new_views.length || new_views[0][1] !== 'form') {
+ new_views.unshift([false, 'form']);
}
action_orig.views = new_views;
- action_orig.res_id = am.inner_widget.dataset.ids[am.inner_widget.dataset.index];
+ action_orig.res_id = id;
+ action_orig.flags = {
+ form: {
+ "initial_mode": editable ? "edit" : "view",
+ }
+ };
self.do_action(action_orig);
- });
+ };
+ var list = am.inner_widget.views.list;
+ if (list) {
+ list.deferred.then(function() {
+ $(list.controller.groups).off('row_link').on('row_link', function(e, id) {
+ new_form_action(id);
+ });
+ });
+ }
+ var kanban = am.inner_widget.views.kanban;
+ if (kanban) {
+ kanban.deferred.then(function() {
+ kanban.controller.open_record = function(id, editable) {
+ new_form_action(id, editable);
+ };
+ });
+ }
}
},
renderElement: function() {
diff --git a/addons/board/static/src/xml/board.xml b/addons/board/static/src/xml/board.xml
index b2363cafd53..e13fa707776 100644
--- a/addons/board/static/src/xml/board.xml
+++ b/addons/board/static/src/xml/board.xml
@@ -26,7 +26,6 @@
<span class="oe_header_txt"> <t t-esc="action.attrs.string"/> </span>
<input class = "oe_header_text" type="text"/>
<t t-if="!action.attrs.string">&amp;nbsp;</t>
- <button t-if="action.attrs.creatable and action.attrs.creatable !== 'false'" class="oe_button oe_button_create">Create</button>
<span class='oe_icon oe_close'></span>
<span class='oe_icon oe_minimize oe_fold' t-if="!action.attrs.fold"></span>
<span class='oe_icon oe_maximize oe_fold' t-if="action.attrs.fold"></span>