summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorJigar Amin - OpenERP <jam@tinyerp.com>2012-09-13 10:06:44 +0530
committerJigar Amin - OpenERP <jam@tinyerp.com>2012-09-13 10:06:44 +0530
commit188eff46ecade0774bf40fbafbe84e31e801b4c2 (patch)
treedf139787a70cfe8deeaa8544e3a12966aa4abc58 /addons/web/static/src
parent14ed53e196441985e6242b4bcad4f0ed411646a8 (diff)
parentcd004c2c77e95cf3ab3c2889806b5ce54d107874 (diff)
[merge] lp:openerp-web
bzr revid: jam@tinyerp.com-20120913043644-t41gs5n4kp8a0j0e
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/css/base.css411
-rw-r--r--addons/web/static/src/css/base.sass220
-rw-r--r--addons/web/static/src/css/data_import.css46
-rw-r--r--addons/web/static/src/js/data_import.js393
-rw-r--r--addons/web/static/src/js/view_form.js33
-rw-r--r--addons/web/static/src/js/view_list.js9
-rw-r--r--addons/web/static/src/js/views.js12
-rw-r--r--addons/web/static/src/xml/base.xml16
8 files changed, 295 insertions, 845 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index 73457e2bc19..16861a7853f 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -25,6 +25,7 @@
display: none !important;
}
}
+
.openerp.openerp_webclient_container {
height: 100%;
position: relative;
@@ -40,7 +41,7 @@
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
/* http://www.quirksmode.org/dom/inputfile.html
* http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image
- */
+ */ */
}
.openerp :-moz-placeholder {
color: #afafb6 !important;
@@ -111,28 +112,6 @@
.openerp h4 {
margin: 4px 0;
}
-.openerp .oe_semantic_html_override ul, .openerp .oe_semantic_html_override ol {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_semantic_html_override ul ul, .openerp .oe_semantic_html_override ul ol, .openerp .oe_semantic_html_override ul li, .openerp .oe_semantic_html_override ol ul, .openerp .oe_semantic_html_override ol ol, .openerp .oe_semantic_html_override ol li {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_semantic_html_override ul li, .openerp .oe_semantic_html_override ol li {
- list-style-type: none;
-}
-.openerp ul.oe_semantic_html_override {
- margin: 0;
- padding: 0;
-}
-.openerp ul.oe_semantic_html_override ul, .openerp ul.oe_semantic_html_override ol, .openerp ul.oe_semantic_html_override li {
- margin: 0;
- padding: 0;
-}
-.openerp ul.oe_semantic_html_override li {
- list-style-type: none;
-}
.openerp a.button:link, .openerp a.button:visited, .openerp button, .openerp input[type='submit'], .openerp .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button {
display: inline-block;
border: 1px solid #ababab;
@@ -265,7 +244,7 @@
border-radius: 0 0 2px 2px;
}
.openerp.ui-dialog .ui-dialog-buttonpane button {
- margin: 0;
+ margin: 0 4px 0 0;
}
.openerp.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: left;
@@ -602,26 +581,6 @@
padding: 0 16px;
list-style: none;
zoom: 1;
- margin: 0;
- padding: 0;
-}
-.openerp .oe_notebook ul, .openerp .oe_notebook ol, .openerp .oe_notebook li {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_notebook li {
- list-style-type: none;
-}
-.openerp .oe_notebook ul, .openerp .oe_notebook ol {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_notebook ul ul, .openerp .oe_notebook ul ol, .openerp .oe_notebook ul li, .openerp .oe_notebook ol ul, .openerp .oe_notebook ol ol, .openerp .oe_notebook ol li {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_notebook ul li, .openerp .oe_notebook ol li {
- list-style-type: none;
}
.openerp .oe_notebook.ui-corner-all {
-moz-border-radius: 0;
@@ -697,6 +656,8 @@
top: 26px;
left: 0;
z-index: 1;
+ margin: 0;
+ padding: 0;
border: 1px solid #afafb6;
background: white;
padding: 4px 0;
@@ -714,6 +675,7 @@
float: none;
display: block;
position: relative;
+ margin: 0;
padding: 2px 8px;
}
.openerp .oe_dropdown_menu > li:hover {
@@ -831,9 +793,10 @@
font-size: 14px;
height: 100%;
}
-.openerp .oe_login li {
+.openerp .oe_login ul, .openerp .oe_login li {
+ margin: 0;
list-style-type: none;
- padding-bottom: 4px;
+ padding: 0 0 4px 0;
}
.openerp .oe_login button {
float: right;
@@ -926,17 +889,6 @@
-webkit-box-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
box-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
}
-.openerp .oe_login .oe_login_pane ul, .openerp .oe_login .oe_login_pane ol {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_login .oe_login_pane ul ul, .openerp .oe_login .oe_login_pane ul ol, .openerp .oe_login .oe_login_pane ul li, .openerp .oe_login .oe_login_pane ol ul, .openerp .oe_login .oe_login_pane ol ol, .openerp .oe_login .oe_login_pane ol li {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_login .oe_login_pane ul li, .openerp .oe_login .oe_login_pane ol li {
- list-style-type: none;
-}
.openerp .oe_login .oe_login_pane h2 {
margin-top: 0;
font-size: 18px;
@@ -1015,17 +967,6 @@
background-image: -o-linear-gradient(top, #646060, #262626);
background-image: linear-gradient(to bottom, #646060, #262626);
}
-.openerp .oe_topbar ul, .openerp .oe_topbar ol {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_topbar ul ul, .openerp .oe_topbar ul ol, .openerp .oe_topbar ul li, .openerp .oe_topbar ol ul, .openerp .oe_topbar ol ol, .openerp .oe_topbar ol li {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_topbar ul li, .openerp .oe_topbar ol li {
- list-style-type: none;
-}
.openerp .oe_topbar .oe_topbar_item {
display: block;
padding: 5px 10px 7px;
@@ -1098,17 +1039,6 @@
text-shadow: 0 1px 1px white;
padding-bottom: 16px;
}
-.openerp .oe_leftbar ul, .openerp .oe_leftbar ol {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_leftbar ul ul, .openerp .oe_leftbar ul ol, .openerp .oe_leftbar ul li, .openerp .oe_leftbar ol ul, .openerp .oe_leftbar ol ol, .openerp .oe_leftbar ol li {
- margin: 0;
- padding: 0;
-}
-.openerp .oe_leftbar ul li, .openerp .oe_leftbar ol li {
- list-style-type: none;
-}
.openerp a.oe_logo {
width: 220px;
display: block;
@@ -1164,6 +1094,9 @@
margin: 0;
}
.openerp .oe_menu > li {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
float: left;
}
.openerp .oe_menu > li > a {
@@ -1203,7 +1136,9 @@
}
.openerp .oe_secondary_submenu li {
position: relative;
+ margin: 0;
padding: 1px 0 1px 20px !important;
+ list-style-type: none;
}
.openerp .oe_secondary_submenu li a {
display: block;
@@ -1306,6 +1241,13 @@
.openerp .oe_application > div {
height: 100%;
}
+.openerp .oe_application .oe_breadcrumb_item:not(:last-child) {
+ display: inline-block;
+ max-width: 7em;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
.openerp .oe_view_manager .oe_view_manager_body {
height: inherit;
}
@@ -1316,16 +1258,6 @@
width: 100%;
table-layout: fixed;
}
-.openerp .oe_view_manager table.oe_view_manager_header ul {
- padding: 0;
- margin-right: 0;
- margin-top: 0;
- margin-bottom: 0;
-}
-.openerp .oe_view_manager table.oe_view_manager_header ul li {
- list-style-type: none;
- margin: 0;
-}
.openerp .oe_view_manager table.oe_view_manager_header .oe_header_row {
clear: both;
text-shadow: 0 1px 1px white;
@@ -1397,6 +1329,10 @@
float: left;
margin-right: 8px;
}
+.openerp .oe_view_manager ul.oe_pager_group {
+ padding: 0;
+ margin: 0;
+}
.openerp .oe_view_manager .oe_pager_group {
float: left;
height: 24px;
@@ -1412,6 +1348,8 @@
height: 24px;
line-height: 24px;
padding: 0;
+ margin: 0;
+ list-style-type: none;
float: left;
border-right: 1px solid #ababab;
}
@@ -1436,14 +1374,17 @@
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.openerp .oe_view_manager .oe_view_manager_switch {
- margin-left: 8px;
+ padding: 0;
+ margin: 0 0 0 8px;
}
.openerp .oe_view_manager .oe_view_manager_switch li {
- text-align: center;
+ margin: 0;
width: 24px;
height: 24px;
line-height: 16px;
padding: 0;
+ text-align: center;
+ list-style-type: none;
}
.openerp .oe_view_manager .oe_view_manager_switch li a {
position: relative;
@@ -2047,135 +1988,6 @@
.openerp .oe_form div.oe_form_configuration .oe_form_group_cell div div {
padding: 1px 0;
}
-.openerp .oe_form ul.oe_form_steps, .openerp .oe_form ul.oe_form_steps_clickable {
- display: inline-block;
- padding-right: 18px;
-}
-.openerp .oe_form ul.oe_form_steps li, .openerp .oe_form ul.oe_form_steps_clickable li {
- display: inline-block;
- margin-right: -20px;
- background-color: #fcfcfc;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#fcfcfc), to(#dedede));
- background-image: -webkit-linear-gradient(top, #fcfcfc, #dedede);
- background-image: -moz-linear-gradient(top, #fcfcfc, #dedede);
- background-image: -ms-linear-gradient(top, #fcfcfc, #dedede);
- background-image: -o-linear-gradient(top, #fcfcfc, #dedede);
- background-image: linear-gradient(to bottom, #fcfcfc, #dedede);
-}
-.openerp .oe_form ul.oe_form_steps li:first-child .label, .openerp .oe_form ul.oe_form_steps_clickable li:first-child .label {
- border-left: 1px solid #cacaca;
- padding-left: 14px;
-}
-.openerp .oe_form ul.oe_form_steps li:last-child, .openerp .oe_form ul.oe_form_steps_clickable li:last-child {
- border-right: 1px solid #cacaca;
-}
-.openerp .oe_form ul.oe_form_steps li:last-child .label, .openerp .oe_form ul.oe_form_steps_clickable li:last-child .label {
- padding-right: 14px;
-}
-.openerp .oe_form ul.oe_form_steps li:last-child .arrow, .openerp .oe_form ul.oe_form_steps_clickable li:last-child .arrow {
- display: none;
-}
-.openerp .oe_form ul.oe_form_steps li .label, .openerp .oe_form ul.oe_form_steps_clickable li .label {
- color: #4c4c4c;
- text-shadow: 0 1px 1px #fcfcfc, 0 -1px 1px #dedede;
- padding: 7px;
- display: inline-block;
- padding-left: 24px;
- margin: 0;
- position: relative;
-}
-.openerp .oe_form ul.oe_form_steps li .arrow, .openerp .oe_form ul.oe_form_steps_clickable li .arrow {
- width: 17px;
- display: inline-block;
- vertical-align: top;
- overflow: hidden;
- margin-left: -5px;
-}
-.openerp .oe_form ul.oe_form_steps li .arrow span, .openerp .oe_form ul.oe_form_steps_clickable li .arrow span {
- position: relative;
- width: 24px;
- height: 24px;
- display: inline-block;
- margin-left: -12px;
- margin-top: 3px;
- box-shadow: -1px 1px 2px rgba(255, 255, 255, 0.2), inset -1px 1px 1px rgba(0, 0, 0, 0.2);
- background-color: #dedede;
- background: -moz-linear-gradient(135deg, #dedede, #fcfcfc);
- background: -o-linear-gradient(135deg, #fcfcfc, #dedede);
- background: -webkit-gradient(linear, left top, right bottom, from(#fcfcfc), to(#dedede));
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -webkit-transform: rotate(45deg);
- -moz-transform: rotate(45deg);
- -ms-transform: rotate(45deg);
- -o-transform: rotate(45deg);
- transform: rotate(45deg);
-}
-.openerp .oe_form ul.oe_form_steps li.oe_active, .openerp .oe_form ul.oe_form_steps_clickable li.oe_active {
- background-color: #729fcf;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#729fcf), to(#3465a4));
- background-image: -webkit-linear-gradient(top, #729fcf, #3465a4);
- background-image: -moz-linear-gradient(top, #729fcf, #3465a4);
- background-image: -ms-linear-gradient(top, #729fcf, #3465a4);
- background-image: -o-linear-gradient(top, #729fcf, #3465a4);
- background-image: linear-gradient(to bottom, #729fcf, #3465a4);
-}
-.openerp .oe_form ul.oe_form_steps li.oe_active .arrow span, .openerp .oe_form ul.oe_form_steps_clickable li.oe_active .arrow span {
- background-color: #3465a4;
- background: -moz-linear-gradient(135deg, #3465a4, #729fcf);
- background: -o-linear-gradient(135deg, #729fcf, #3465a4);
- background: -webkit-gradient(linear, left top, right bottom, from(#729fcf), to(#3465a4));
-}
-.openerp .oe_form ul.oe_form_steps li.oe_active .label, .openerp .oe_form ul.oe_form_steps_clickable li.oe_active .label {
- color: white;
- text-shadow: 0 1px 1px #729fcf, 0 -1px 1px #3465a4;
-}
-.openerp .oe_form ul.oe_form_steps_clickable li {
- cursor: pointer;
-}
-.openerp .oe_form ul.oe_form_steps_clickable li:hover {
- background-color: #e8e8e8;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#cacaca));
- background-image: -webkit-linear-gradient(top, #e8e8e8, #cacaca);
- background-image: -moz-linear-gradient(top, #e8e8e8, #cacaca);
- background-image: -ms-linear-gradient(top, #e8e8e8, #cacaca);
- background-image: -o-linear-gradient(top, #e8e8e8, #cacaca);
- background-image: linear-gradient(to bottom, #e8e8e8, #cacaca);
-}
-.openerp .oe_form ul.oe_form_steps_clickable li:hover .label {
- text-shadow: 0 -1px 1px #fcfcfc, 0 1px 1px #dedede;
-}
-.openerp .oe_form ul.oe_form_steps_clickable li:hover .arrow span {
- background-color: #e8e8e8;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#cacaca));
- background-image: -webkit-linear-gradient(top, #e8e8e8, #cacaca);
- background-image: -moz-linear-gradient(top, #e8e8e8, #cacaca);
- background-image: -ms-linear-gradient(top, #e8e8e8, #cacaca);
- background-image: -o-linear-gradient(top, #e8e8e8, #cacaca);
- background-image: linear-gradient(to bottom, #e8e8e8, #cacaca);
-}
-.openerp .oe_form ul.oe_form_steps_clickable li .label {
- color: #7c7bad;
-}
-.openerp .oe_form ul.oe_form_steps_clickable li.oe_active:hover {
- background-color: #4c85c2;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#4c85c2), to(#284d7d));
- background-image: -webkit-linear-gradient(top, #4c85c2, #284d7d);
- background-image: -moz-linear-gradient(top, #4c85c2, #284d7d);
- background-image: -ms-linear-gradient(top, #4c85c2, #284d7d);
- background-image: -o-linear-gradient(top, #4c85c2, #284d7d);
- background-image: linear-gradient(to bottom, #4c85c2, #284d7d);
-}
-.openerp .oe_form ul.oe_form_steps_clickable li.oe_active:hover .label {
- text-shadow: 0 -1px 1px #729fcf, 0 1px 1px #3465a4;
-}
-.openerp .oe_form ul.oe_form_steps_clickable li.oe_active:hover .arrow span {
- background-color: #284d7d;
- background: -moz-linear-gradient(135deg, #284d7d, #4c85c2);
- background: -o-linear-gradient(135deg, #4c85c2, #284d7d);
- background: -webkit-gradient(linear, left top, right bottom, from(#4c85c2), to(#284d7d));
-}
.openerp .oe_form .oe_subtotal_footer {
width: 1% !important;
}
@@ -2463,27 +2275,137 @@
.openerp.ui-autocomplete li:not(.oe_m2o_dropdown_option) + li.oe_m2o_dropdown_option {
margin-top: 10px;
}
-.openerp .oe_form_field_status {
+.openerp ul.oe_form_status, .openerp ul.oe_form_status_clickable {
+ display: inline-block;
margin: 0;
- padding: 0;
+ padding: 0 18px 0 0;
}
-.openerp .oe_form_field_status ul, .openerp .oe_form_field_status ol {
- margin: 0;
+.openerp ul.oe_form_status li, .openerp ul.oe_form_status_clickable li {
+ display: inline-block;
+ list-style-type: none;
+ margin: 0 -20px 0 0;
padding: 0;
+ background-color: #fcfcfc;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#fcfcfc), to(#dedede));
+ background-image: -webkit-linear-gradient(top, #fcfcfc, #dedede);
+ background-image: -moz-linear-gradient(top, #fcfcfc, #dedede);
+ background-image: -ms-linear-gradient(top, #fcfcfc, #dedede);
+ background-image: -o-linear-gradient(top, #fcfcfc, #dedede);
+ background-image: linear-gradient(to bottom, #fcfcfc, #dedede);
}
-.openerp .oe_form_field_status ul ul, .openerp .oe_form_field_status ul ol, .openerp .oe_form_field_status ul li, .openerp .oe_form_field_status ol ul, .openerp .oe_form_field_status ol ol, .openerp .oe_form_field_status ol li {
- margin: 0;
- padding: 0;
+.openerp ul.oe_form_status li:first-child .label, .openerp ul.oe_form_status_clickable li:first-child .label {
+ border-left: 1px solid #cacaca;
+ padding-left: 14px;
}
-.openerp .oe_form_field_status ul li, .openerp .oe_form_field_status ol li {
- list-style-type: none;
+.openerp ul.oe_form_status li:last-child, .openerp ul.oe_form_status_clickable li:last-child {
+ border-right: 1px solid #cacaca;
+}
+.openerp ul.oe_form_status li:last-child .label, .openerp ul.oe_form_status_clickable li:last-child .label {
+ padding-right: 14px;
}
-.openerp .oe_form_field_status ul, .openerp .oe_form_field_status ol, .openerp .oe_form_field_status li {
+.openerp ul.oe_form_status li:last-child .arrow, .openerp ul.oe_form_status_clickable li:last-child .arrow {
+ display: none;
+}
+.openerp ul.oe_form_status li .label, .openerp ul.oe_form_status_clickable li .label {
+ color: #4c4c4c;
+ text-shadow: 0 1px 1px #fcfcfc, 0 -1px 1px #dedede;
+ padding: 7px;
+ display: inline-block;
+ padding-left: 24px;
margin: 0;
- padding: 0;
+ position: relative;
}
-.openerp .oe_form_field_status li {
- list-style-type: none;
+.openerp ul.oe_form_status li .arrow, .openerp ul.oe_form_status_clickable li .arrow {
+ width: 17px;
+ display: inline-block;
+ vertical-align: top;
+ overflow: hidden;
+ margin-left: -5px;
+}
+.openerp ul.oe_form_status li .arrow span, .openerp ul.oe_form_status_clickable li .arrow span {
+ position: relative;
+ width: 24px;
+ height: 24px;
+ display: inline-block;
+ margin-left: -12px;
+ margin-top: 3px;
+ box-shadow: -1px 1px 2px rgba(255, 255, 255, 0.2), inset -1px 1px 1px rgba(0, 0, 0, 0.2);
+ background-color: #dedede;
+ background: -moz-linear-gradient(135deg, #dedede, #fcfcfc);
+ background: -o-linear-gradient(135deg, #fcfcfc, #dedede);
+ background: -webkit-gradient(linear, left top, right bottom, from(#fcfcfc), to(#dedede));
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ -webkit-transform: rotate(45deg);
+ -moz-transform: rotate(45deg);
+ -ms-transform: rotate(45deg);
+ -o-transform: rotate(45deg);
+ transform: rotate(45deg);
+}
+.openerp ul.oe_form_status li.oe_active, .openerp ul.oe_form_status_clickable li.oe_active {
+ background-color: #729fcf;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#729fcf), to(#3465a4));
+ background-image: -webkit-linear-gradient(top, #729fcf, #3465a4);
+ background-image: -moz-linear-gradient(top, #729fcf, #3465a4);
+ background-image: -ms-linear-gradient(top, #729fcf, #3465a4);
+ background-image: -o-linear-gradient(top, #729fcf, #3465a4);
+ background-image: linear-gradient(to bottom, #729fcf, #3465a4);
+}
+.openerp ul.oe_form_status li.oe_active .arrow span, .openerp ul.oe_form_status_clickable li.oe_active .arrow span {
+ background-color: #3465a4;
+ background: -moz-linear-gradient(135deg, #3465a4, #729fcf);
+ background: -o-linear-gradient(135deg, #729fcf, #3465a4);
+ background: -webkit-gradient(linear, left top, right bottom, from(#729fcf), to(#3465a4));
+}
+.openerp ul.oe_form_status li.oe_active .label, .openerp ul.oe_form_status_clickable li.oe_active .label {
+ color: white;
+ text-shadow: 0 1px 1px #729fcf, 0 -1px 1px #3465a4;
+}
+.openerp ul.oe_form_status_clickable li {
+ cursor: pointer;
+}
+.openerp ul.oe_form_status_clickable li:hover {
+ background-color: #e8e8e8;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#cacaca));
+ background-image: -webkit-linear-gradient(top, #e8e8e8, #cacaca);
+ background-image: -moz-linear-gradient(top, #e8e8e8, #cacaca);
+ background-image: -ms-linear-gradient(top, #e8e8e8, #cacaca);
+ background-image: -o-linear-gradient(top, #e8e8e8, #cacaca);
+ background-image: linear-gradient(to bottom, #e8e8e8, #cacaca);
+}
+.openerp ul.oe_form_status_clickable li:hover .label {
+ text-shadow: 0 -1px 1px #fcfcfc, 0 1px 1px #dedede;
+}
+.openerp ul.oe_form_status_clickable li:hover .arrow span {
+ background-color: #e8e8e8;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#cacaca));
+ background-image: -webkit-linear-gradient(top, #e8e8e8, #cacaca);
+ background-image: -moz-linear-gradient(top, #e8e8e8, #cacaca);
+ background-image: -ms-linear-gradient(top, #e8e8e8, #cacaca);
+ background-image: -o-linear-gradient(top, #e8e8e8, #cacaca);
+ background-image: linear-gradient(to bottom, #e8e8e8, #cacaca);
+}
+.openerp ul.oe_form_status_clickable li .label {
+ color: #7c7bad;
+}
+.openerp ul.oe_form_status_clickable li.oe_active:hover {
+ background-color: #4c85c2;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#4c85c2), to(#284d7d));
+ background-image: -webkit-linear-gradient(top, #4c85c2, #284d7d);
+ background-image: -moz-linear-gradient(top, #4c85c2, #284d7d);
+ background-image: -ms-linear-gradient(top, #4c85c2, #284d7d);
+ background-image: -o-linear-gradient(top, #4c85c2, #284d7d);
+ background-image: linear-gradient(to bottom, #4c85c2, #284d7d);
+}
+.openerp ul.oe_form_status_clickable li.oe_active:hover .label {
+ text-shadow: 0 -1px 1px #729fcf, 0 1px 1px #3465a4;
+}
+.openerp ul.oe_form_status_clickable li.oe_active:hover .arrow span {
+ background-color: #284d7d;
+ background: -moz-linear-gradient(135deg, #284d7d, #4c85c2);
+ background: -o-linear-gradient(135deg, #4c85c2, #284d7d);
+ background: -webkit-gradient(linear, left top, right bottom, from(#4c85c2), to(#284d7d));
}
.openerp .oe_form .oe_form_field_one2many > .oe_view_manager .oe_list_pager_single_page {
display: none;
@@ -2545,7 +2467,7 @@
.openerp .oe_list.oe_list_editable.oe_editing .oe_m2o_cm_button {
display: none;
}
-.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field input {
+.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field textarea {
height: 27px;
}
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field textarea {
@@ -2555,9 +2477,6 @@
border: 1px solid #aaaaff;
margin: 0;
}
-.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field textarea {
- height: 60px;
-}
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer input {
text-align: right;
}
@@ -2574,10 +2493,13 @@
.openerp .oe_form .oe_form_field_many2many > .oe_list .oe_list_pager_single_page {
display: none;
}
+.openerp .oe_list_buttons .oe_alternative {
+ visibility: hidden;
+}
.openerp .oe_list_buttons .oe_list_save, .openerp .oe_list_buttons .oe_list_discard {
display: none;
}
-.openerp .oe_list_buttons.oe_editing .oe_list_add, .openerp .oe_list_buttons.oe_editing .oe_list_button_import {
+.openerp .oe_list_buttons.oe_editing .oe_list_add {
display: none;
}
.openerp .oe_list_buttons.oe_editing .oe_list_save {
@@ -2586,6 +2508,9 @@
.openerp .oe_list_buttons.oe_editing .oe_list_discard {
display: inline;
}
+.openerp .oe_list_buttons.oe_editing .oe_alternative {
+ visibility: visible;
+}
.openerp .oe_list {
position: relative;
}
@@ -2826,16 +2751,6 @@
float: right;
color: #333333;
}
-.openerp .oe_semantic_html li {
- list-style-type: disc;
- display: list-item;
-}
-.openerp .oe_semantic_html ul {
- padding-left: 1em;
-}
-.openerp .oe_semantic_html p {
- color: #4c4c4c !important;
-}
.kitten-mode-activated {
background-image: url(http://placekitten.com/g/1365/769);
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index 5e346b32df2..e3cb661d580 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -124,19 +124,6 @@ $sheet-max-width: 860px
content: $icon-name
color: $color
-@mixin ul-html-override()
- margin: 0
- padding: 0
- ul, ol, li
- margin: 0
- padding: 0
- li
- list-style-type: none
-
-@mixin semantic-html-override()
- ul, ol
- @include ul-html-override()
-
// }}}
@media print
@@ -200,10 +187,6 @@ $sheet-max-width: 860px
vertical-align: middle
h4
margin: 4px 0
- .oe_semantic_html_override
- @include semantic-html-override
- ul.oe_semantic_html_override
- @include ul-html-override
// }}}
// Button style {{{
a.button:link, a.button:visited, button, input[type='submit'], .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button
@@ -283,7 +266,7 @@ $sheet-max-width: 860px
margin: 0
@include radius(0 0 2px 2px)
button
- margin: 0
+ margin: 0 4px 0 0
.ui-dialog-buttonset
float: left
.ui-button
@@ -509,8 +492,6 @@ $sheet-max-width: 860px
padding: 0 16px
list-style: none
zoom: 1
- @include ul-html-override
- @include semantic-html-override
.oe_notebook.ui-corner-all
@include radius(0)
.oe_notebook:before, .oe_notebook:after
@@ -567,6 +548,8 @@ $sheet-max-width: 860px
top: 26px
left: 0
z-index: 1
+ margin: 0
+ padding: 0
border: 1px solid $tag-border
background: white
padding: 4px 0
@@ -582,6 +565,7 @@ $sheet-max-width: 860px
float: none
display: block
position: relative
+ margin: 0
padding: 2px 8px
> a
white-space: nowrap
@@ -670,9 +654,10 @@ $sheet-max-width: 860px
text-align: center
font-size: 14px
height: 100%
- li
+ ul, li
+ margin: 0
list-style-type: none
- padding-bottom: 4px
+ padding: 0 0 4px 0
button
float: right
display: inline-block
@@ -730,7 +715,6 @@ $sheet-max-width: 860px
text-align: left
@include radius(8px)
@include box-shadow(0 0 18px rgba(0, 0, 0, 0.9))
- @include semantic-html-override
h2
margin-top: 0
font-size: 18px
@@ -795,7 +779,6 @@ $sheet-max-width: 860px
width: 100%
height: 31px
@include vertical-gradient(#646060, #262626)
- @include semantic-html-override
.oe_topbar_item
display: block
padding: 5px 10px 7px
@@ -846,7 +829,6 @@ $sheet-max-width: 860px
border-right: 1px solid $tag-border
text-shadow: 0 1px 1px white
padding-bottom: 16px
- @include semantic-html-override
a.oe_logo
width: 220px
display: block
@@ -897,6 +879,9 @@ $sheet-max-width: 860px
padding: 0
margin: 0
> li
+ list-style-type: none
+ padding: 0
+ margin: 0
float: left
> a
display: block
@@ -926,7 +911,9 @@ $sheet-max-width: 860px
display: inline-block
li
position: relative
+ margin: 0
padding: 1px 0 1px 20px !important
+ list-style-type: none
a
display: block
color: #4c4c4c
@@ -1001,6 +988,12 @@ $sheet-max-width: 860px
text-decoration: underline
> div
height: 100%
+ .oe_breadcrumb_item:not(:last-child)
+ display: inline-block
+ max-width: 7em
+ white-space: nowrap
+ overflow: hidden
+ text-overflow: ellipsis
// }}}
// ViewManager common {{{
.oe_view_manager
@@ -1012,14 +1005,6 @@ $sheet-max-width: 860px
table.oe_view_manager_header
width: 100%
table-layout: fixed
- ul
- padding: 0
- margin-right: 0
- margin-top: 0
- margin-bottom: 0
- li
- list-style-type: none
- margin: 0
.oe_header_row
//min-height: 26px
//line-height: 26px
@@ -1074,6 +1059,9 @@ $sheet-max-width: 860px
.oe_pager_value
float: left
margin-right: 8px
+ ul.oe_pager_group
+ padding: 0
+ margin: 0
.oe_pager_group
float: left
height: 24px
@@ -1086,6 +1074,8 @@ $sheet-max-width: 860px
height: 24px
line-height: 24px
padding: 0
+ margin: 0
+ list-style-type: none
float: left
border-right: 1px solid #ababab
&:last-child
@@ -1104,13 +1094,16 @@ $sheet-max-width: 860px
// }}}
// ViewManager.switches {{{
.oe_view_manager_switch
- margin-left: 8px
+ padding: 0
+ margin: 0 0 0 8px
li
- text-align: center
+ margin: 0
width: 24px
height: 24px
line-height: 16px
padding: 0
+ text-align: center
+ list-style-type: none
a
position: relative
.oe_vm_switch_list:after, .oe_vm_switch_tree:after
@@ -1571,72 +1564,6 @@ $sheet-max-width: 860px
padding: 1px 0
.oe_form_group_cell div div
padding: 1px 0
- ul.oe_form_steps, ul.oe_form_steps_clickable
- display: inline-block
- padding-right: 18px
- li
- display: inline-block
- margin-right: -20px
- @include vertical-gradient(#fcfcfc, #dedede)
- &:first-child .label
- border-left: 1px solid #cacaca
- padding-left: 14px
- &:last-child
- border-right: 1px solid #cacaca
- .label
- padding-right: 14px
- .arrow
- display: none
- .label
- color: #4c4c4c
- text-shadow: 0 1px 1px #fcfcfc, 0 -1px 1px #dedede
- padding: 7px
- display: inline-block
- padding-left: 24px
- margin: 0
- position: relative
- .arrow
- width: 17px
- display: inline-block
- vertical-align: top
- overflow: hidden
- margin-left: -5px
- span
- position: relative
- width: 24px
- height: 24px
- display: inline-block
- margin-left: -12px
- margin-top: 3px
- box-shadow: -1px 1px 2px rgba(255,255,255,0.2), inset -1px 1px 1px rgba(0,0,0,0.2)
- @include skew-gradient(#fcfcfc, #dedede)
- @include radius(3px)
- @include transform(rotate(45deg))
- li.oe_active
- @include vertical-gradient(#729fcf, #3465a4)
- .arrow span
- @include skew-gradient(#729fcf, #3465a4)
- .label
- color: white
- text-shadow: 0 1px 1px #729fcf, 0 -1px 1px #3465a4
- ul.oe_form_steps_clickable
- li
- cursor: pointer
- &:hover
- @include vertical-gradient(darken(#fcfcfc, 8%), darken(#dedede, 8%))
- .label
- text-shadow: 0 -1px 1px #fcfcfc, 0 1px 1px #dedede
- .arrow span
- @include vertical-gradient(darken(#fcfcfc, 8%), darken(#dedede, 8%))
- .label
- color: $link-color
- li.oe_active
- &:hover
- @include vertical-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%))
- .label
- text-shadow: 0 -1px 1px #729fcf, 0 1px 1px #3465a4
- .arrow span
- @include skew-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%))
.oe_subtotal_footer
width: 1% !important
td.oe_form_group_cell
@@ -1878,9 +1805,75 @@ $sheet-max-width: 860px
margin-top: 10px
// }}}
// FormView.fieldstatus {{{
- .oe_form_field_status
- @include semantic-html-override
- @include ul-html-override
+ ul.oe_form_status, ul.oe_form_status_clickable
+ display: inline-block
+ margin: 0
+ padding: 0 18px 0 0
+ li
+ display: inline-block
+ list-style-type: none
+ margin: 0 -20px 0 0
+ padding: 0
+ @include vertical-gradient(#fcfcfc, #dedede)
+ &:first-child .label
+ border-left: 1px solid #cacaca
+ padding-left: 14px
+ &:last-child
+ border-right: 1px solid #cacaca
+ .label
+ padding-right: 14px
+ .arrow
+ display: none
+ .label
+ color: #4c4c4c
+ text-shadow: 0 1px 1px #fcfcfc, 0 -1px 1px #dedede
+ padding: 7px
+ display: inline-block
+ padding-left: 24px
+ margin: 0
+ position: relative
+ .arrow
+ width: 17px
+ display: inline-block
+ vertical-align: top
+ overflow: hidden
+ margin-left: -5px
+ span
+ position: relative
+ width: 24px
+ height: 24px
+ display: inline-block
+ margin-left: -12px
+ margin-top: 3px
+ box-shadow: -1px 1px 2px rgba(255,255,255,0.2), inset -1px 1px 1px rgba(0,0,0,0.2)
+ @include skew-gradient(#fcfcfc, #dedede)
+ @include radius(3px)
+ @include transform(rotate(45deg))
+ li.oe_active
+ @include vertical-gradient(#729fcf, #3465a4)
+ .arrow span
+ @include skew-gradient(#729fcf, #3465a4)
+ .label
+ color: white
+ text-shadow: 0 1px 1px #729fcf, 0 -1px 1px #3465a4
+ ul.oe_form_status_clickable
+ li
+ cursor: pointer
+ &:hover
+ @include vertical-gradient(darken(#fcfcfc, 8%), darken(#dedede, 8%))
+ .label
+ text-shadow: 0 -1px 1px #fcfcfc, 0 1px 1px #dedede
+ .arrow span
+ @include vertical-gradient(darken(#fcfcfc, 8%), darken(#dedede, 8%))
+ .label
+ color: $link-color
+ li.oe_active
+ &:hover
+ @include vertical-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%))
+ .label
+ text-shadow: 0 -1px 1px #729fcf, 0 1px 1px #3465a4
+ .arrow span
+ @include skew-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%))
// }}}
// FormView.one2many {{{
.oe_form .oe_form_field_one2many > .oe_view_manager
@@ -1944,14 +1937,12 @@ $sheet-max-width: 860px
.oe_m2o_cm_button
display: none
.oe_form_field
- input
+ input, textarea
height: $row-height
input, textarea
@include radius(0)
border: 1px solid #aaf
margin: 0
- textarea
- height: 60px
&.oe_form_field_float,&.oe_form_view_integer
input
text-align: right
@@ -1971,15 +1962,19 @@ $sheet-max-width: 860px
// }}}
// ListView {{{
.oe_list_buttons
+ .oe_alternative
+ visibility: hidden
.oe_list_save, .oe_list_discard
display: none
&.oe_editing
- .oe_list_add, .oe_list_button_import
+ .oe_list_add
display: none
.oe_list_save
display: inline-block
.oe_list_discard
display: inline
+ .oe_alternative
+ visibility: visible
.oe_list
position: relative
@@ -2166,15 +2161,6 @@ $sheet-max-width: 860px
float: right
color: #333
// }}}
- .oe_semantic_html // a style to use normal html
- li
- list-style-type: disc
- display: list-item
- ul
- padding-left: 1em
- p
- color: #4C4C4C !important
-
// Kitten Mode {{{
.kitten-mode-activated
background-image: url(http://placekitten.com/g/1365/769)
diff --git a/addons/web/static/src/css/data_import.css b/addons/web/static/src/css/data_import.css
deleted file mode 100644
index 47cd52aa081..00000000000
--- a/addons/web/static/src/css/data_import.css
+++ /dev/null
@@ -1,46 +0,0 @@
-.openerp .oe_import_grid {
- border: none;
- border-collapse: collapse;
-}
-.openerp .oe_import_grid-header .oe_import_grid-cell {
- background: url(../img/gradientlinebg.gif) repeat-x #CCCCCC;
- border-bottom: 1px solid #E3E3E3;
- font-weight: bold;
- text-align: left;
-}
-.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;
-}
-.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 .oe_import .separator.horizontal {
- font-weight: bold;
- border-bottom-width: 1px;
- margin: 6px 4px 6px 1px;
- height: 20px;
-}
-.openerp .duplicate_fld{
- background-color:#FF6666;
-}
-.openerp .select_fld{
- background: none repeat scroll 0 0 white;
-}
-.openerp .ui-autocomplete {
- max-height: 300px;
- overflow-y: auto;
- padding-right: 20px;
-}
diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js
deleted file mode 100644
index 3c677b0ec26..00000000000
--- a/addons/web/static/src/js/data_import.js
+++ /dev/null
@@ -1,393 +0,0 @@
-openerp.web.data_import = function(instance) {
-var QWeb = instance.web.qweb,
- _t = instance.web._t;
-/**
- * Safari does not deal well at all with raw JSON data being returned. As a
- * result, we're going to cheat by using a pseudo-jsonp: instead of getting
- * JSON data in the iframe, we're getting a ``script`` tag which consists of a
- * function call and the returned data (the json dump).
- *
- * The function is an auto-generated name bound to ``window``, which calls
- * back into the callback provided here.
- *
- * @param {Object} form the form element (DOM or jQuery) to use in the call
- * @param {Object} attributes jquery.form attributes object
- * @param {Function} callback function to call with the returned data
- */
-function jsonp(form, attributes, callback) {
- attributes = attributes || {};
- var options = {jsonp: _.uniqueId('import_callback_')};
- window[options.jsonp] = function () {
- delete window[options.jsonp];
- callback.apply(null, arguments);
- };
- if ('data' in attributes) {
- _.extend(attributes.data, options);
- } else {
- _.extend(attributes, {data: options});
- }
- $(form).ajaxSubmit(attributes);
-}
-
-instance.web.DataImport = instance.web.Dialog.extend({
- template: 'ImportDataView',
- dialog_title: {toString: function () { return _t("Import Data"); }},
- init: function(parent, dataset){
- var self = this;
- this._super(parent, {});
- this.model = parent.model;
- this.fields = [];
- this.all_fields = [];
- this.fields_with_defaults = [];
- this.required_fields = null;
-
- var convert_fields = function (root, prefix) {
- prefix = prefix || '';
- _(root.fields).each(function (f) {
- self.all_fields.push(prefix + f.name);
- if (f.fields) {
- convert_fields(f, prefix + f.id + '/');
- }
- });
- };
- this.ready = $.Deferred.queue().then(function () {
- self.required_fields = _(self.fields).chain()
- .filter(function (field) {
- return field.required &&
- !_.include(self.fields_with_defaults, field.id); })
- .pluck('id')
- .uniq()
- .value();
- convert_fields(self);
- self.all_fields.sort();
- });
- },
- start: function() {
- var self = this;
- this._super();
- this.open({
- buttons: [
- {text: _t("Close"), click: function() { self.destroy(); }},
- {text: _t("Import File"), click: function() { self.do_import(); }, 'class': 'oe_import_dialog_button'}
- ],
- close: function(event, ui) {
- self.destroy();
- }
- });
- this.toggle_import_button(false);
- this.$el.find('#csvfile').change(this.on_autodetect_data);
- this.$el.find('fieldset').change(this.on_autodetect_data);
- this.$el.delegate('fieldset legend', 'click', function() {
- $(this).parent().toggleClass('oe_closed');
- });
- this.ready.push(new instance.web.DataSet(this, this.model).call(
- 'fields_get', [], function (fields) {
- self.graft_fields(fields);
- self.ready.push(new instance.web.DataSet(self, self.model)
- .default_get(_.pluck(self.fields, 'id')).then(function (fields) {
- _.each(fields, function(val, key) {
- if (val) {
- self.fields_with_defaults.push(key);
- }
- });
- })
- )
- }));
- },
- graft_fields: function (fields, parent, level) {
- parent = parent || this;
- level = level || 0;
-
- var self = this;
- if (level === 0) {
- parent.fields.push({
- id: 'id',
- name: 'id',
- string: _t('External ID'),
- required: false
- });
- }
- _(fields).each(function (field, field_name) {
- // Ignore spec for id field
- // Don't import function fields (function and related)
- if (field_name === 'id') {
- return;
- }
- // Skip if there's no state which could disable @readonly,
- // if a field is ever always readonly we can't import it
- if (field.readonly) {
- // no states at all
- if (_.isEmpty(field.states)) { return; }
- // no state altering @readonly
- if (!_.any(field.states, function (modifiers) {
- return _(modifiers).chain().pluck(0).contains('readonly').value();
- })) { return; }
- }
-
- var f = {
- id: field_name,
- name: field_name,
- string: field.string,
- required: field.required
- };
-
- switch (field.type) {
- case 'many2many':
- case 'many2one':
- // push a copy for the bare many2one field, to allow importing
- // using name_search too - even if we default to exporting the XML ID
- var many2one_field = _.extend({}, f)
- parent.fields.push(many2one_field);
- f.name += '/id';
- break;
- case 'one2many':
- f.name += '/id';
- f.fields = [];
- // only fetch sub-fields to a depth of 2 levels
- if (level < 2) {
- self.ready.push(new instance.web.DataSet(self, field.relation).call(
- 'fields_get', [], function (fields) {
- self.graft_fields(fields, f, level+1);
- }));
- }
- break;
- }
- parent.fields.push(f);
- });
- },
- toggle_import_button: function (newstate) {
- instance.web.dialog(this.$el, 'widget')
- .find('.oe_import_dialog_button')
- .button('option', 'disabled', !newstate);
- },
- do_import: function() {
- if(!this.$el.find('#csvfile').val()) { return; }
- var lines_to_skip = parseInt(this.$el.find('#csv_skip').val(), 10);
- var with_headers = this.$el.find('#file_has_headers').prop('checked');
- if (!lines_to_skip && with_headers) {
- lines_to_skip = 1;
- }
- var indices = [], fields = [];
- this.$el.find(".sel_fields").each(function(index, element) {
- var val = element.value;
- if (!val) {
- return;
- }
- indices.push(index);
- fields.push(val);
- });
-
- jsonp(this.$el.find('#import_data'), {
- url: '/web/import/import_data',
- data: {
- model: this.model,
- meta: JSON.stringify({
- skip: lines_to_skip,
- indices: indices,
- fields: fields
- })
- }
- }, this.on_import_results);
- },
- on_autodetect_data: function() {
- if(!this.$el.find('#csvfile').val()) { return; }
- jsonp(this.$el.find('#import_data'), {
- url: '/web/import/detect_data'
- }, this.on_import_results);
- },
- on_import_results: function(results) {
- this.$el.find('#result').empty();
- var headers, result_node = this.$el.find("#result");
-
- if (results['error']) {
- result_node.append(QWeb.render('ImportView.error', {
- 'error': results['error']}));
- this.$el.find('fieldset').removeClass('oe_closed');
- return;
- }
- if (results['success']) {
- if (this.getParent().getParent().active_view == "list") {
- this.getParent().reload_content();
- }
- this.destroy();
- return;
- }
-
- if (results['records']) {
- var lines_to_skip = parseInt(this.$el.find('#csv_skip').val(), 10),
- with_headers = this.$el.find('#file_has_headers').prop('checked');
- headers = with_headers ? results.records[0] : null;
-
- result_node.append(QWeb.render('ImportView.result', {
- 'headers': headers,
- 'records': lines_to_skip ? results.records.slice(lines_to_skip)
- : with_headers ? results.records.slice(1)
- : results.records
- }));
- this.$el.find('fieldset').addClass('oe_closed');
- }
- this.$el.find('form').removeClass('oe_import_no_result');
-
- this.$el.delegate('.oe_m2o_drop_down_button', 'click', function () {
- $(this).prev('input').focus();
- });
-
- var self = this;
- this.ready.then(function () {
- var $fields = self.$el.find('.sel_fields').bind('blur', function () {
- if (this.value && !_(self.all_fields).contains(this.value)) {
- this.value = '';
- }
- }).autocomplete({
- minLength: 0,
- source: self.all_fields,
- change: self.on_check_field_values
- }).focus(function () {
- $(this).autocomplete('search');
- });
- // Column auto-detection
- _(headers).each(function (header, index) {
- var field_name = self.match_column_to_field(header);
- if (field_name) {
- $fields.eq(index).val(field_name);
- }
- });
- self.on_check_field_values();
- });
- },
- /**
- * Returns the name of the field (nested) matching the provided column name
- *
- * @param {String} name column name to look for
- * @param {Array} [fields] fields to look into for the provided name
- * @returns {String|undefined}
- */
- match_column_to_field: function (name, fields) {
- fields = fields || this.fields;
- var f;
- f = _(fields).detect(function (field) {
- return field.name === name
- });
- if (!f) {
- f = _(fields).detect(function (field) {
- // TODO: levenshtein between header and field.string
- return field.string.toLowerCase() === name.toLowerCase();
- });
- }
- if (f) { return f.name; }
-
- // if ``name`` is a path (o2m), we need to recurse through its .fields
- var index = name.indexOf('/');
- if (index === -1) { return undefined; }
- // Get the first path section, try to find the matching field
- var column_name = name.substring(0, index);
- f = _(fields).detect(function (field) {
- // field.name for o2m is $foo/id, so we want to match on id
- return field.id === column_name;
- });
- if (!f) {
- f = _(fields).detect(function (field) {
- return field.string.toLowerCase() === column_name.toLowerCase();
- });
- }
- if (!f) { return undefined; }
-
- // if we found a matching field for the first path section, recurse in
- // its own .fields to try and get the rest of the path matched
- var rest = this.match_column_to_field(
- name.substring(index+1), f.fields);
- if (!rest) { return undefined; }
- return f.id + '/' + rest;
- },
- /**
- * Looks through all the field selections, and tries to find if two
- * (or more) columns were matched to the same model field.
- *
- * Returns a map of the multiply-mapped fields to an array of offending
- * columns (not actually columns, but the inputs containing the same field
- * names).
- *
- * Also has the side-effect of marking the discovered inputs with the class
- * ``duplicate_fld``.
- *
- * @returns {Object<String, Array<String>>} map of duplicate field matches to same-valued inputs
- */
- find_duplicate_fields: function() {
- // Maps values to DOM nodes, in order to discover duplicates
- var values = {}, duplicates = {};
- this.$el.find(".sel_fields").each(function(index, element) {
- var value = element.value;
- var $el = $(element).removeClass('duplicate_fld');
- if (!value) { return; }
-
- if (!(value in values)) {
- values[value] = element;
- } else {
- var same_valued_field = values[value];
- if (value in duplicates) {
- duplicates[value].push(element);
- } else {
- duplicates[value] = [same_valued_field, element];
- }
- $el.add(same_valued_field).addClass('duplicate_fld');
- }
- });
- return duplicates;
- },
- on_check_field_values: function () {
- this.$el.find("#message, #msg").remove();
-
- var required_valid = this.check_required();
-
- var duplicates = this.find_duplicate_fields();
- if (_.isEmpty(duplicates)) {
- this.toggle_import_button(required_valid);
- } else {
- var $err = $('<div id="msg" style="color: red;">'+_t("Destination fields should only be selected once, some fields are selected more than once:")+'</div>').insertBefore(this.$el.find('#result'));
- var $dupes = $('<dl>').appendTo($err);
- _(duplicates).each(function(elements, value) {
- $('<dt>').text(value).appendTo($dupes);
- _(elements).each(function(element) {
- var cell = $(element).closest('td');
- $('<dd>').text(cell.parent().children().index(cell)).appendTo($dupes);
- });
- });
- this.toggle_import_button(false);
- }
-
- },
- check_required: function() {
- var self = this;
- if (!self.required_fields.length) { return true; }
-
- // Resolve field id based on column name, as there may be
- // several ways to provide the value for a given field and
- // thus satisfy the requirement.
- // (e.g. m2o_id or m2o_id/id columns may be provided)
- var resolve_field_id = function(column_name) {
- var f = _.detect(self.fields, function(field) {
- return field.name === column_name;
- });
- if (!f) { return column_name; };
- return f.id;
- };
-
- var selected_fields = _(this.$el.find('.sel_fields').get()).chain()
- .pluck('value')
- .compact()
- .map(resolve_field_id)
- .value();
-
- var missing_fields = _.difference(this.required_fields, selected_fields);
- if (missing_fields.length) {
- this.$el.find("#result").before('<div id="message" style="color:red">' + _t("*Required Fields are not selected :") + missing_fields + '.</div>');
- return false;
- }
- return true;
- },
- destroy: function() {
- this.$el.remove();
- this._super();
- }
-});
-};
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 08c9b96660e..7d328f012fe 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -321,7 +321,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
}
this.datarecord = record;
this._actualize_mode();
- this.set({ 'title' : record.id ? record.display_name : "New record" });
+ this.set({ 'title' : record.id ? record.display_name : "New" });
if (this.qweb) {
this.kill_current_form();
@@ -1399,6 +1399,10 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt
if (! page.__ic)
return;
page.__ic.on("change:effective_invisible", null, function() {
+ if (!page.__ic.get('effective_invisible')) {
+ $new_notebook.tabs('select', i);
+ return;
+ }
var current = $new_notebook.tabs("option", "selected");
if (! pages[current].__ic || ! pages[current].__ic.get("effective_invisible"))
return;
@@ -2400,10 +2404,6 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc
template: 'FieldTextHtml',
init: function() {
this._super.apply(this, arguments);
- if (this.field.type !== 'html' && ! this.options.safe) {
- throw new Error(_.str.sprintf(
- _t("Error with field %s, it is not allowed to use the widget 'html' with any other field type than 'html'"), this.string));
- }
},
initialize_content: function() {
var self = this;
@@ -2437,7 +2437,7 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc
},
render_value: function() {
if (! this.get("effective_readonly")) {
- this.$textarea.val(this.get('value'));
+ this.$textarea.val(this.get('value') || '');
this._updating_editor = true;
this.$cleditor.updateFrame();
this._updating_editor = false;
@@ -2712,8 +2712,10 @@ instance.web.form.CompletionFieldMixin = {
_create_context: function(name) {
var tmp = {};
var field = (this.options || {}).create_name_field;
- if (field !== false && (this.options || {}).quick_create !== false)
- tmp["default_" + field] = name || "name";
+ if (field === undefined)
+ field = "name";
+ if (field !== false && name && (this.options || {}).quick_create !== false)
+ tmp["default_" + field] = name;
return tmp;
},
};
@@ -2773,7 +2775,8 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
this.$drop_down = this.$el.find(".oe_m2o_drop_down_button");
this.$follow_button = $(".oe_m2o_cm_button", this.$el);
- this.$follow_button.click(function() {
+ this.$follow_button.click(function(ev) {
+ ev.preventDefault();
if (!self.get('value')) {
self.focus();
return;
@@ -2951,14 +2954,10 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
var lines = _.escape(str).split("\n");
var link = "";
var follow = "";
- if (! this.options.highlight_first_line) {
- link = lines.join("<br />");
- } else {
- link = lines[0];
- follow = _.rest(lines).join("<br />");
- if (follow)
- link += "<br />";
- }
+ link = lines[0];
+ follow = _.rest(lines).join("<br />");
+ if (follow)
+ link += "<br />";
var $link = this.$el.find('.oe_form_uri')
.unbind('click')
.html(link);
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js
index df61e9bd6bd..015cd1636f1 100644
--- a/addons/web/static/src/js/view_list.js
+++ b/addons/web/static/src/js/view_list.js
@@ -21,8 +21,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
// whether the view rows can be reordered (via vertical drag & drop)
'reorderable': true,
'action_buttons': true,
- // if true, the 'Import', 'Export', etc... buttons will be shown
- 'import_enabled': true,
},
/**
* Core class for list-type displays.
@@ -281,7 +279,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
self.reload_content();
});
- // Add button and Import link
+ // Add button
if (!this.$buttons) {
this.$buttons = $(QWeb.render("ListView.buttons", {'widget':self}));
if (this.options.$buttons) {
@@ -292,10 +290,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
this.$buttons.find('.oe_list_add')
.click(this.proxy('do_add_record'))
.prop('disabled', grouped);
- this.$buttons.on('click', '.oe_list_button_import', function() {
- self.on_sidebar_import();
- return false;
- });
}
// Pager
@@ -358,7 +352,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
this.sidebar = new instance.web.Sidebar(this);
this.sidebar.appendTo(this.options.$sidebar);
this.sidebar.add_items('other', _.compact([
- self.is_action_enabled('create') && { label: _t("Import"), callback: this.on_sidebar_import },
{ label: _t("Export"), callback: this.on_sidebar_export },
self.is_action_enabled('delete') && { label: _t('Delete'), callback: this.do_delete_selected }
]));
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index d0a5b1841bb..eab00d8b295 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -20,7 +20,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
},
start: function() {
this._super.apply(this, arguments);
- this.$el.on('click', '.oe_breadcrumb_item', this.on_breadcrumb_clicked);
+ this.$el.on('click', 'a.oe_breadcrumb_item', this.on_breadcrumb_clicked);
},
dialog_stop: function () {
if (this.dialog) {
@@ -95,7 +95,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
break;
}
}
- var subindex = $e.parent().find('.oe_breadcrumb_item[data-id=' + $e.data('id') + ']').index($e);
+ var subindex = $e.parent().find('a.oe_breadcrumb_item[data-id=' + $e.data('id') + ']').index($e);
this.select_breadcrumb(index, subindex);
},
select_breadcrumb: function(index, subindex) {
@@ -148,7 +148,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
for (var j = 0; j < tit.length; j += 1) {
var label = _.escape(tit[j]);
if (i === this.breadcrumbs.length - 1 && j === tit.length - 1) {
- titles.push(label);
+ titles.push(_.str.sprintf('<span class="oe_breadcrumb_item">%s</span>', label));
} else {
titles.push(_.str.sprintf('<a href="#" class="oe_breadcrumb_item" data-id="%s">%s</a>', item.id, label));
}
@@ -566,7 +566,8 @@ instance.web.ViewManager = instance.web.Widget.extend({
}
return controller.get('title');
});
- if (next && next.action && next.action.res_id && self.active_view === 'form' && self.model === next.action.res_model && id === next.action.res_id) {
+ if (next && next.action && next.action.res_id && self.dataset &&
+ self.active_view === 'form' && self.dataset.model === next.action.res_model && id === next.action.res_id) {
// If the current active view is a formview and the next item in the breadcrumbs
// is an action on same object (model / res_id), then we omit the current formview's title
titles.pop();
@@ -1270,9 +1271,6 @@ instance.web.View = instance.web.Widget.extend({
},
do_search: function(view) {
},
- on_sidebar_import: function() {
- new instance.web.DataImport(this, this.dataset).open();
- },
on_sidebar_export: function() {
new instance.web.DataExport(this, this.dataset).open();
},
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 9ec53a89863..b6b89a4f1ec 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -427,9 +427,9 @@
<div class="oe_view_manager">
<table class="oe_view_manager_header">
<col width="20%"/>
- <col width="25%"/>
- <col width="20%"/>
<col width="35%"/>
+ <col width="15%"/>
+ <col width="30%"/>
<tr class="oe_header_row oe_header_row_top">
<td colspan="2">
<h2 class="oe_view_title" t-if="widget.flags.display_title !== false">
@@ -653,9 +653,6 @@
<button type="button" class="oe_button oe_list_add oe_highlight">
<t t-esc="widget.options.addable"/>
</button>
- <span class="oe_alternative" t-if="widget.options.import_enabled">
- <span class="oe_fade">or</span> <a href="#" class="oe_bold oe_list_button_import">Import</a>
- </span>
</t>
</div>
<t t-name="ListView.pager">
@@ -699,9 +696,10 @@
<t t-jquery="button.oe_list_add" t-operation="after">
<button class="oe_button oe_list_save oe_highlight"
type="button">Save</button>
- </t>
- <t t-jquery="a.oe_list_button_import" t-operation="after">
- <a href="#" class="oe_bold oe_list_discard">Discard</a>
+ <span class="oe_alternative">
+ <span class="oe_fade">or</span>
+ <a href="#" class="oe_bold oe_list_discard">Discard</a>
+ </span>
</t>
</t>
<t t-extend="ListView.row">
@@ -1065,7 +1063,7 @@
</span>
</t>
<t t-name="FieldStatus">
- <ul t-att-class="'oe_form_field_status ' + (widget.options.clickable ? 'oe_form_steps_clickable' : 'oe_form_steps')" t-att-style="widget.node.attrs.style"/>
+ <ul t-att-class="'oe_form_field_status ' + (widget.options.clickable ? 'oe_form_status_clickable' : 'oe_form_status')" t-att-style="widget.node.attrs.style"/>
</t>
<t t-name="FieldStatus.content">
<t t-foreach="widget.selection" t-as="i">