summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_form.js
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2013-09-24 14:51:03 +0200
committerFabien Meghazi <fme@openerp.com>2013-09-24 14:51:03 +0200
commit3ddeaee79cecc404111192f4181a4247e93207f7 (patch)
treedf8d14ff5903e7d6f6f55d0ffbbb116dbcbd9740 /addons/web/static/src/js/view_form.js
parent18acfa505abd53d526f3288dbe2a9643d7112077 (diff)
parentbc0d066505a054389525cdf7601b35751ea3efbb (diff)
[MERGE] upstream
bzr revid: fme@openerp.com-20130814164422-l0h0ueue0fwk94uu bzr revid: chm@openerp.com-20130828165815-a901l9gx66lj0pj1 bzr revid: fme@openerp.com-20130924125103-65bngr3rnm6k7u3a
Diffstat (limited to 'addons/web/static/src/js/view_form.js')
-rw-r--r--addons/web/static/src/js/view_form.js23
1 files changed, 18 insertions, 5 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index d36ac353461..324896112cc 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -724,7 +724,10 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
self.trigger("save", result);
self.to_view_mode();
}).then(function(result) {
- self.ViewManager.ActionManager.__parentedParent.menu.do_reload_needaction();
+ var parent = self.ViewManager.ActionManager.getParent();
+ if(parent){
+ parent.menu.do_reload_needaction();
+ }
});
},
on_button_cancel: function(event) {
@@ -2997,8 +3000,11 @@ instance.web.form.FieldRadio = instance.web.form.AbstractField.extend(instance.w
})();
/**
- * A mixin containing some useful methods to handle completion inputs.
- */
+ A mixin containing some useful methods to handle completion inputs.
+
+ The widget containing this option can have these arguments in its widget options:
+ - no_quick_create: if true, it will disable the quick create
+*/
instance.web.form.CompletionFieldMixin = {
init: function() {
this.limit = 7;
@@ -3044,7 +3050,8 @@ instance.web.form.CompletionFieldMixin = {
}
// quick create
var raw_result = _(data.result).map(function(x) {return x[1];});
- if (search_val.length > 0 && !_.include(raw_result, search_val)) {
+ if (search_val.length > 0 && !_.include(raw_result, search_val) &&
+ ! (self.options && self.options.no_quick_create)) {
values.push({
label: _.str.sprintf(_t('Create "<strong>%s</strong>"'),
$('<span />').text(search_val).html()),
@@ -4053,7 +4060,13 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
else
return $.when();
}).done(function () {
- self.handle_button(name, id, callback);
+ if (!self.o2m.options.reload_on_button) {
+ self.handle_button(name, id, callback);
+ }else {
+ self.handle_button(name, id, function(){
+ self.o2m.view.reload();
+ });
+ }
});
},