[FIX] quick create: do not add the id in the form if the form is readonly (eg: clicking on save button will make the form uneditable)

bzr revid: mat@openerp.com-20140307141257-rvusvzm6oq3tel51
This commit is contained in:
Martin Trigaux 2014-03-07 15:12:57 +01:00
parent cb3791d83d
commit 618c8b9100
1 changed files with 2 additions and 1 deletions

View File

@ -2977,7 +2977,8 @@ instance.web.form.CompletionFieldMixin = {
if (self.options.quick_create === undefined || self.options.quick_create) {
new instance.web.DataSet(this, this.field.relation, self.build_context())
.name_create(name).done(function(data) {
self.add_id(data[0]);
if (!self.get('effective_readonly'))
self.add_id(data[0]);
}).fail(function(error, event) {
event.preventDefault();
slow_create();