summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2014-10-16 16:04:39 +0200
committerChristophe Simonis <chs@odoo.com>2014-10-16 16:04:39 +0200
commit52fee2811d658031a34257b911b1d2b40bfa0c04 (patch)
tree61a625efad5e5ffe237e712bf1db2a840b71cb4a /addons/web/static/src
parent904adc8b51abd3a0fc29c979884f845d6641da3c (diff)
parent2b192bef2242c71d0ff3a45b9efb9e717fd364c4 (diff)
[MERGE] forward port of branch 8.0 up to 2b192be
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/css/base.css8
-rw-r--r--addons/web/static/src/css/base.sass5
-rw-r--r--addons/web/static/src/js/openerpframework.js28
-rw-r--r--addons/web/static/src/js/view_form.js27
-rw-r--r--addons/web/static/src/js/views.js12
-rw-r--r--addons/web/static/src/xml/base.xml5
6 files changed, 39 insertions, 46 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index 1fdae301b99..23fb4ed2f09 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -8,6 +8,7 @@
font-weight: normal;
font-style: normal;
}
+
@font-face {
font-family: "EntypoRegular";
src: url("/web/static/src/font/entypo-webfont.eot") format("eot");
@@ -18,6 +19,7 @@
font-weight: normal;
font-style: normal;
}
+
#oe_main_menu_navbar {
min-height: 34px;
z-index: 1001;
@@ -741,11 +743,6 @@
text-decoration: none;
}
.openerp .oe_dropdown_arrow:after {
- width: 0;
- height: 0;
- display: inline-block;
- content: "&darr";
- text-indent: -99999px;
vertical-align: top;
margin-top: 8px;
margin-left: 3px;
@@ -3025,6 +3022,7 @@
top: 0px;
}
}
+
.kitten-mode-activated {
background-size: cover;
background-attachment: fixed;
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index 13be06043da..a8efd0f29cb 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -645,11 +645,6 @@ $sheet-padding: 16px
&:hover
text-decoration: none
.oe_dropdown_arrow:after
- width: 0
- height: 0
- display: inline-block
- content: "&darr"
- text-indent: -99999px
vertical-align: top
margin-top: 8px
//margin-left set at 3px to avoid a strange overflow
diff --git a/addons/web/static/src/js/openerpframework.js b/addons/web/static/src/js/openerpframework.js
index 77be9fd6ba8..fd13bea49cb 100644
--- a/addons/web/static/src/js/openerpframework.js
+++ b/addons/web/static/src/js/openerpframework.js
@@ -258,24 +258,24 @@ openerp.ParentedMixin = {
current object is destroyed.
*/
alive: function(promise, reject) {
- var def = $.Deferred();
var self = this;
- promise.done(function() {
- if (! self.isDestroyed()) {
- if (! reject)
+ return $.Deferred(function (def) {
+ promise.then(function () {
+ if (!self.isDestroyed()) {
def.resolve.apply(def, arguments);
- else
- def.reject();
- }
- }).fail(function() {
- if (! self.isDestroyed()) {
- if (! reject)
+ }
+ }, function () {
+ if (!self.isDestroyed()) {
def.reject.apply(def, arguments);
- else
+ }
+ }).always(function () {
+ if (reject) {
+ // noop if def already resolved or rejected
def.reject();
- }
- });
- return def.promise();
+ }
+ // otherwise leave promise in limbo
+ });
+ }).promise();
},
/**
* Inform the object it should destroy itself, releasing any
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index aca6f2c1c12..ce5fab9a8a2 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -42,15 +42,15 @@ instance.web.form.FieldManagerMixin = {
Gives new values for the fields contained in the view. The new values could not be setted
right after the call to this method. Setting new values can trigger on_changes.
- @param (dict) values A dictonnary with key = field name and value = new value.
- @return (Deferred) Is resolved after all the values are setted.
+ @param {Object} values A dictonary with key = field name and value = new value.
+ @return {$.Deferred} Is resolved after all the values are setted.
*/
set_values: function(values) {},
/**
Computes an OpenERP domain.
- @param (list) expression An OpenERP domain.
- @return (boolean) The computed value of the domain.
+ @param {Array} expression An OpenERP domain.
+ @return {boolean} The computed value of the domain.
*/
compute_domain: function(expression) {},
/**
@@ -58,7 +58,7 @@ instance.web.form.FieldManagerMixin = {
the field are only supposed to use this context to evualuate their own, they should not
extend it.
- @return (CompoundContext) An OpenERP context.
+ @return {CompoundContext} An OpenERP context.
*/
build_eval_context: function() {},
};
@@ -120,6 +120,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
this.is_initialized = $.Deferred();
this.mutating_mutex = new $.Mutex();
this.save_list = [];
+ this.render_value_defs = [];
this.reload_mutex = new $.Mutex();
this.__clicked_inside = false;
this.__blur_timeout = null;
@@ -675,6 +676,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
} else if (mode === "create") {
mode = "edit";
}
+ this.render_value_defs = [];
this.set({actual_mode: mode});
},
check_actual_mode: function(source, options) {
@@ -726,12 +728,15 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
});
},
on_button_cancel: function(event) {
+ var self = this;
if (this.can_be_discarded()) {
if (this.get('actual_mode') === 'create') {
this.trigger('history_back');
} else {
this.to_view_mode();
- this.trigger('load_record', this.datarecord);
+ $.when.apply(null, this.render_value_defs).then(function(){
+ self.trigger('load_record', self.datarecord);
+ });
}
}
this.trigger('on_button_cancel');
@@ -2241,7 +2246,10 @@ instance.web.form.ReinitializeWidgetMixin = {
instance.web.form.ReinitializeFieldMixin = _.extend({}, instance.web.form.ReinitializeWidgetMixin, {
reinitialize: function() {
instance.web.form.ReinitializeWidgetMixin.reinitialize.call(this);
- this.render_value();
+ var res = this.render_value();
+ if (this.view && this.view.render_value_defs){
+ this.view.render_value_defs.push(res);
+ }
},
});
@@ -4710,9 +4718,8 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
self.render_tag(data);
}
if (! values || values.length > 0) {
- this._display_orderer.add(self.get_render_data(values)).done(handle_names);
- }
- else{
+ return this._display_orderer.add(self.get_render_data(values)).done(handle_names);
+ } else {
handle_names([]);
}
},
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index 6dc20e91548..248436357ad 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -412,7 +412,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
}
var widget = executor.widget();
if (executor.action.target === 'new') {
- var pre_dialog = this.dialog;
+ var pre_dialog = (this.dialog && !this.dialog.isDestroyed()) ? this.dialog : null;
if (pre_dialog){
// prevent previous dialog to consider itself closed,
// right now, as we're opening a new one (prevents
@@ -1552,15 +1552,7 @@ instance.web.View = instance.web.Widget.extend({
do_switch_view: function() {
this.trigger.apply(this, ['switch_mode'].concat(_.toArray(arguments)));
},
- /**
- * Cancels the switch to the current view, switches to the previous one
- *
- * @param {Object} [options]
- * @param {Boolean} [options.created=false] resource was created
- * @param {String} [options.default=null] view to switch to if no previous view
- */
-
- do_search: function(view) {
+ do_search: function(domain, context, group_by) {
},
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 cf785a5b2cf..f99a96b649b 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -585,7 +585,7 @@
</t>
<t t-name="ViewPager">
<div class="oe_pager_value">
- <t t-raw="__content__"/>
+ <t t-raw="0"/>
</div>
<ul class="oe_pager_group">
<!--
@@ -614,6 +614,7 @@
<button class="oe_dropdown_toggle oe_dropdown_arrow" t-if="section.name != 'buttons'">
<t t-if="section.name == 'files'" t-raw="widget.items[section.name].length || ''"/>
<t t-esc="section.label"/>
+ <i class="fa fa-caret-down"/>
</button>
<t t-if="section.name == 'buttons'" t-foreach="widget.items[section.name]" t-as="item" t-att-class="item.classname">
<button t-att-title="item.title or ''" t-att-data-section="section.name" t-att-data-index="item_index" t-att-href="item.url"
@@ -1382,7 +1383,7 @@
method="post" enctype="multipart/form-data" t-att-action="fileupload_action || '/web/binary/upload'">
<input type="hidden" name="session_id" value="" t-if="widget.session.override_session"/>
<input type="hidden" name="callback" t-att-value="fileupload_id"/>
- <t t-raw="__content__"/>
+ <t t-raw="0"/>
<input type="file" class="oe_form_binary_file" name="ufile" t-if="widget.widget!='image'"/>
<input type="file" class="oe_form_binary_file" name="ufile" accept="image/*" t-if="widget.widget=='image'"/>
</form>