tryton-sao 7.2.6 → 7.2.8

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 7.2.8 - 2024-10-05
3
+ --------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 7.2.7 - 2024-09-16
8
+ --------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 7.2.6 - 2024-09-01
3
13
  --------------------------
4
14
  * Bug fixes (see mercurial logs for details)
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.2.6',
6
+ __version__: '7.2.8',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -8271,12 +8271,16 @@ var Sao = {
8271
8271
  }
8272
8272
  return prm;
8273
8273
  },
8274
- reload: function(fields) {
8274
+ reload: function(fields, async=true) {
8275
8275
  if (this.id < 0) {
8276
- return jQuery.when();
8276
+ return async? jQuery.when() : null;
8277
8277
  }
8278
8278
  if (!fields) {
8279
- return this.load('*');
8279
+ return this.load('*', async);
8280
+ } else if (!async) {
8281
+ for (let field of fields) {
8282
+ this.load(field, async);
8283
+ }
8280
8284
  } else {
8281
8285
  var prms = fields.map(field => this.load(field));
8282
8286
  return jQuery.when.apply(jQuery, prms);
@@ -8463,7 +8467,9 @@ var Sao = {
8463
8467
  id: id
8464
8468
  };
8465
8469
  for (const fname of fnames_to_fetch) {
8466
- default_values[fname] = null;
8470
+ if (fname != 'id') {
8471
+ default_values[fname] = null;
8472
+ }
8467
8473
  }
8468
8474
  failed_values.push(default_values);
8469
8475
  }
@@ -8968,6 +8974,7 @@ var Sao = {
8968
8974
  return result;
8969
8975
  };
8970
8976
  if (sync) {
8977
+ this._check_load(fields, false);
8971
8978
  return validate_fields();
8972
8979
  } else {
8973
8980
  return this._check_load(fields).then(validate_fields);
@@ -8991,9 +8998,9 @@ var Sao = {
8991
8998
  this.links_counts = {};
8992
8999
  this.exception = false;
8993
9000
  },
8994
- _check_load: function(fields) {
9001
+ _check_load: function(fields, async=true) {
8995
9002
  if (!this.get_loaded(fields)) {
8996
- return this.reload(fields);
9003
+ return this.reload(fields, async);
8997
9004
  }
8998
9005
  return jQuery.when();
8999
9006
  },
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tryton-sao",
3
3
  "title": "sao",
4
4
  "description": "Tryton webclient",
5
- "version": "7.2.6",
5
+ "version": "7.2.8",
6
6
  "homepage": "http://www.tryton.org/",
7
7
  "author": {
8
8
  "name": "Tryton"
package/src/model.js CHANGED
@@ -633,12 +633,16 @@
633
633
  }
634
634
  return prm;
635
635
  },
636
- reload: function(fields) {
636
+ reload: function(fields, async=true) {
637
637
  if (this.id < 0) {
638
- return jQuery.when();
638
+ return async? jQuery.when() : null;
639
639
  }
640
640
  if (!fields) {
641
- return this.load('*');
641
+ return this.load('*', async);
642
+ } else if (!async) {
643
+ for (let field of fields) {
644
+ this.load(field, async);
645
+ }
642
646
  } else {
643
647
  var prms = fields.map(field => this.load(field));
644
648
  return jQuery.when.apply(jQuery, prms);
@@ -825,7 +829,9 @@
825
829
  id: id
826
830
  };
827
831
  for (const fname of fnames_to_fetch) {
828
- default_values[fname] = null;
832
+ if (fname != 'id') {
833
+ default_values[fname] = null;
834
+ }
829
835
  }
830
836
  failed_values.push(default_values);
831
837
  }
@@ -1330,6 +1336,7 @@
1330
1336
  return result;
1331
1337
  };
1332
1338
  if (sync) {
1339
+ this._check_load(fields, false);
1333
1340
  return validate_fields();
1334
1341
  } else {
1335
1342
  return this._check_load(fields).then(validate_fields);
@@ -1353,9 +1360,9 @@
1353
1360
  this.links_counts = {};
1354
1361
  this.exception = false;
1355
1362
  },
1356
- _check_load: function(fields) {
1363
+ _check_load: function(fields, async=true) {
1357
1364
  if (!this.get_loaded(fields)) {
1358
- return this.reload(fields);
1365
+ return this.reload(fields, async);
1359
1366
  }
1360
1367
  return jQuery.when();
1361
1368
  },
package/src/sao.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.2.6',
6
+ __version__: '7.2.8',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9