tryton-sao 6.0.33 → 6.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG CHANGED
@@ -1,4 +1,14 @@
1
1
 
2
+ Version 6.0.35 - 2024-01-01
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 6.0.34 - 2023-12-16
8
+ ---------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 6.0.33 - 2023-12-01
3
13
  ---------------------------
4
14
  * Bug fixes (see mercurial logs for details)
@@ -3028,12 +3028,14 @@ var Sao = {};
3028
3028
 
3029
3029
  Sao.common.scrollIntoViewIfNeeded = function(element) {
3030
3030
  element = element[0];
3031
- var rect = element.getBoundingClientRect();
3032
- if (rect.bottom > window.innerHeight) {
3033
- element.scrollIntoView(false);
3034
- }
3035
- if (rect.top < 0) {
3036
- element.scrollIntoView();
3031
+ if (element) {
3032
+ var rect = element.getBoundingClientRect();
3033
+ if (rect.bottom > window.innerHeight) {
3034
+ element.scrollIntoView(false);
3035
+ }
3036
+ if (rect.top < 0) {
3037
+ element.scrollIntoView();
3038
+ }
3037
3039
  }
3038
3040
  };
3039
3041
 
@@ -3697,8 +3699,12 @@ var Sao = {};
3697
3699
  }
3698
3700
  }.bind(this));
3699
3701
  prm.fail(function() {
3702
+ var selection = [];
3703
+ if (this.nullable_widget) {
3704
+ selection.push([null, '']);
3705
+ }
3700
3706
  this._last_domain = null;
3701
- this.selection = [];
3707
+ this.selection = selection;
3702
3708
  if (callback) {
3703
3709
  callback(this.selection, this.help);
3704
3710
  }
@@ -3744,6 +3750,9 @@ var Sao = {};
3744
3750
  if (!this.attributes.relation) {
3745
3751
  return jQuery.when([]);
3746
3752
  }
3753
+ if (value === null) {
3754
+ return jQuery.when([null, '']);
3755
+ }
3747
3756
  for (var i = 0, len = this.inactive_selection.length; i < len; i++) {
3748
3757
  if (value == this.inactive_selection[i][0]) {
3749
3758
  return jQuery.when(this.inactive_selection[i]);
@@ -7966,6 +7975,7 @@ var Sao = {};
7966
7975
  }
7967
7976
  if (this.model.fields[name] instanceof Sao.field.One2Many) {
7968
7977
  later[name] = value;
7978
+ continue;
7969
7979
  }
7970
7980
  if ((this.model.fields[name] instanceof Sao.field.Many2One) ||
7971
7981
  (this.model.fields[name] instanceof Sao.field.Reference)) {
@@ -7980,6 +7990,7 @@ var Sao = {};
7980
7990
  value = later[name];
7981
7991
  this.model.fields[name].set(this, value);
7982
7992
  this._loaded[name] = true;
7993
+ fieldnames.push(name);
7983
7994
  }
7984
7995
  if (validate) {
7985
7996
  this.validate(fieldnames, true, false, false);
@@ -17869,8 +17880,12 @@ function eval_pyson(value){
17869
17880
  var callback = function(result) {
17870
17881
  if (result) {
17871
17882
  screen.current_record.save().done(function() {
17883
+ var added = 'id' in this.screen.current_record.modified_fields;
17872
17884
  // Force a reload on next display
17873
17885
  this.screen.current_record.cancel();
17886
+ if (added) {
17887
+ this.screen.current_record.modified_fields.id = true;
17888
+ }
17874
17889
  }.bind(this));
17875
17890
  }
17876
17891
  }.bind(this);
@@ -18303,10 +18318,15 @@ function eval_pyson(value){
18303
18318
  });
18304
18319
  url = window.URL.createObjectURL(blob);
18305
18320
  }
18306
- this.object.attr('data', url);
18307
- this.object.get(0).onload = function() {
18321
+ // duplicate object to force refresh on buggy browsers
18322
+ var object = this.object.clone();
18323
+ object.attr('data', url);
18324
+ object.get(0).onload = function() {
18308
18325
  window.URL.revokeObjectURL(url);
18309
18326
  };
18327
+ object.attr('data', url);
18328
+ this.object.replaceWith(object);
18329
+ this.object = object;
18310
18330
  }.bind(this));
18311
18331
  },
18312
18332
  });