[FIX] web: form: quick create: name is now required to avoid creating records with a void name
This commit is contained in:
parent
fb4db6c938
commit
130873f0f6
|
@ -3458,9 +3458,14 @@ instance.web.form.M2ODialog = instance.web.Dialog.extend({
|
||||||
this.$("p").text( text );
|
this.$("p").text( text );
|
||||||
this.$buttons.html(QWeb.render("M2ODialog.buttons"));
|
this.$buttons.html(QWeb.render("M2ODialog.buttons"));
|
||||||
this.$("input").val(this.getParent().last_query);
|
this.$("input").val(this.getParent().last_query);
|
||||||
this.$buttons.find(".oe_form_m2o_qc_button").click(function(){
|
this.$buttons.find(".oe_form_m2o_qc_button").click(function(e){
|
||||||
self.getParent()._quick_create(self.$("input").val());
|
if (self.$("input").val() != ''){
|
||||||
self.destroy();
|
self.getParent()._quick_create(self.$("input").val());
|
||||||
|
self.destroy();
|
||||||
|
} else{
|
||||||
|
e.preventDefault();
|
||||||
|
self.$("input").focus();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.$buttons.find(".oe_form_m2o_sc_button").click(function(){
|
this.$buttons.find(".oe_form_m2o_sc_button").click(function(){
|
||||||
self.getParent()._search_create_popup("form", undefined, self.getParent()._create_context(self.$("input").val()));
|
self.getParent()._search_create_popup("form", undefined, self.getParent()._create_context(self.$("input").val()));
|
||||||
|
|
Loading…
Reference in New Issue