[MERGE] forward port of branch 8.0 up to 0aab81c
This commit is contained in:
@@ -3554,7 +3554,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||
reinit_value: function(val) {
|
||||
this.internal_set_value(val);
|
||||
this.floating = false;
|
||||
if (this.is_started)
|
||||
if (this.is_started && !this.no_rerender)
|
||||
this.render_value();
|
||||
},
|
||||
initialize_field: function() {
|
||||
@@ -3805,7 +3805,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||
}
|
||||
if (! no_recurse) {
|
||||
var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context());
|
||||
this.alive(dataset.name_get([self.get("value")])).done(function(data) {
|
||||
var def = this.alive(dataset.name_get([self.get("value")])).done(function(data) {
|
||||
if (!data[0]) {
|
||||
self.do_warn(_t("Render"), _t("No value found for the field "+self.field.string+" for value "+self.get("value")));
|
||||
return;
|
||||
@@ -3818,6 +3818,9 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||
self.display_value["" + self.get("value")] = self.display_value_backup["" + self.get("value")];
|
||||
self.render_value(true);
|
||||
});
|
||||
if (this.view && this.view.render_value_defs){
|
||||
this.view.render_value_defs.push(def);
|
||||
}
|
||||
}
|
||||
},
|
||||
display_string: function(str) {
|
||||
@@ -4293,7 +4296,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
|
||||
this.dataset.index = 0;
|
||||
}
|
||||
this.trigger_on_change();
|
||||
if (this.is_started) {
|
||||
if (this.is_started && !this.no_rerender) {
|
||||
return self.reload_current_view();
|
||||
} else {
|
||||
return $.when();
|
||||
@@ -4437,12 +4440,19 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
||||
return true;
|
||||
}
|
||||
var r;
|
||||
return _.every(this.records.records, function(record){
|
||||
if (_.isEmpty(this.records.records)){
|
||||
return true;
|
||||
}
|
||||
current_values = {};
|
||||
_.each(this.editor.form.fields, function(field){
|
||||
field._inhibit_on_change_flag = true;
|
||||
field.no_rerender = true;
|
||||
current_values[field.name] = field.get('value');
|
||||
});
|
||||
var valid = _.every(this.records.records, function(record){
|
||||
r = record;
|
||||
_.each(self.editor.form.fields, function(field){
|
||||
field._inhibit_on_change_flag = true;
|
||||
field.set_value(r.attributes[field.name]);
|
||||
field._inhibit_on_change_flag = false;
|
||||
});
|
||||
return _.every(self.editor.form.fields, function(field){
|
||||
field.process_modifiers();
|
||||
@@ -4450,6 +4460,12 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
||||
return field.is_valid();
|
||||
});
|
||||
});
|
||||
_.each(this.editor.form.fields, function(field){
|
||||
field.set('value', current_values[field.name]);
|
||||
field._inhibit_on_change_flag = false;
|
||||
field.no_rerender = false;
|
||||
});
|
||||
return valid;
|
||||
},
|
||||
do_add_record: function () {
|
||||
if (this.editable()) {
|
||||
|
||||
@@ -231,8 +231,9 @@
|
||||
this.records.add(record, {
|
||||
at: this.prepends_on_create() ? 0 : null});
|
||||
}
|
||||
|
||||
return this.ensure_saved().then(function () {
|
||||
return this.ensure_saved().then(function(){
|
||||
return $.when.apply(null, self.editor.form.render_value_defs);
|
||||
}).then(function () {
|
||||
var $recordRow = self.groups.get_row_for(record);
|
||||
var cells = self.get_cells_for($recordRow);
|
||||
var fields = {};
|
||||
|
||||
@@ -222,27 +222,25 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
|
||||
var local_context = {
|
||||
active_model: self.dataset.model,
|
||||
active_id: id,
|
||||
active_ids: [id]};
|
||||
active_ids: [id]
|
||||
};
|
||||
var ctx = instance.web.pyeval.eval(
|
||||
'context', new instance.web.CompoundContext(
|
||||
this.dataset.get_context(), local_context));
|
||||
return this.rpc('/web/treeview/action', {
|
||||
id: id,
|
||||
model: this.dataset.model,
|
||||
context: instance.web.pyeval.eval(
|
||||
'context', new instance.web.CompoundContext(
|
||||
this.dataset.get_context(), local_context))
|
||||
context: ctx
|
||||
}).then(function (actions) {
|
||||
if (!actions.length) { return; }
|
||||
var action = actions[0][2];
|
||||
var c = new instance.web.CompoundContext(local_context);
|
||||
var c = new instance.web.CompoundContext(local_context).set_eval_context(ctx);
|
||||
if (action.context) {
|
||||
c.add(action.context);
|
||||
}
|
||||
return instance.web.pyeval.eval_domains_and_contexts({
|
||||
contexts: [c], domains: []
|
||||
}).then(function (res) {
|
||||
action.context = res.context;
|
||||
return self.do_action(action);
|
||||
}, null);
|
||||
}, null);
|
||||
action.context = c;
|
||||
return self.do_action(action);
|
||||
});
|
||||
},
|
||||
|
||||
// show & hide the contents
|
||||
|
||||
@@ -215,6 +215,15 @@
|
||||
<input t-if="!widget.db_list" name="backup_db" class="required" type="text" autofocus="autofocus"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="backup_format">Backup format:</label></td>
|
||||
<td class="oe_form_field oe_form_field_selection">
|
||||
<select name="backup_format">
|
||||
<option value="zip">zip (includes filestore)</option>
|
||||
<option value="dump">pg_dump custom format (without filestore)</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="backup_pwd">Master Password:</label></td>
|
||||
<td><input type="password" name="backup_pwd" class="required" /></td>
|
||||
|
||||
Reference in New Issue
Block a user