tryton-sao 7.6.13 → 7.6.15

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.6.15 - 2026-02-01
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 7.6.14 - 2026-01-15
8
+ ---------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 7.6.13 - 2025-12-20
3
13
  ---------------------------
4
14
  * Bug fixes (see mercurial logs for details)
package/COPYRIGHT CHANGED
@@ -1,7 +1,7 @@
1
1
  Copyright (C) 2012-2025 Nicolas Évrard.
2
- Copyright (C) 2012-2025 Cédric Krier.
2
+ Copyright (C) 2012-2026 Cédric Krier.
3
3
  Copyright (C) 2012-2014 Bertrand Chenal.
4
- Copyright (C) 2012-2025 B2CK SPRL.
4
+ Copyright (C) 2012-2026 B2CK SPRL.
5
5
  Copyright (C) 2019 Jitbit.
6
6
  Copyright (C) 2013 Thomas Park
7
7
  Copyright (C) 2020-2021 Maxime Richez
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.6.12',
6
+ __version__: '7.6.15',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -8304,11 +8304,14 @@ var Sao = {
8304
8304
  } else {
8305
8305
  cmp = function(a, b) { return a < b; };
8306
8306
  }
8307
+ let max_id = Math.max(0, ...this.map((r) => r.id));
8307
8308
  for (const record of this) {
8308
8309
  if (record.get_loaded([field]) || changed || record.id < 0) {
8310
+ let prev_id = null;
8309
8311
  if (prev) {
8310
8312
  prev.load(field, false);
8311
8313
  index = prev.field_get(field);
8314
+ prev_id = prev.id >= 0 ? prev.id : max_id++;
8312
8315
  } else {
8313
8316
  index = null;
8314
8317
  }
@@ -8319,7 +8322,7 @@ var Sao = {
8319
8322
  update = true;
8320
8323
  } else if (prev) {
8321
8324
  if (record.id >= 0) {
8322
- update = cmp(record.id, prev.id);
8325
+ update = cmp(record.id, prev_id);
8323
8326
  } else if (position === 0) {
8324
8327
  update = true;
8325
8328
  }
@@ -8327,7 +8330,7 @@ var Sao = {
8327
8330
  } else if (value === index) {
8328
8331
  if (prev) {
8329
8332
  if (record.id >= 0) {
8330
- update = cmp(record.id, prev.id);
8333
+ update = cmp(record.id, prev_id);
8331
8334
  } else if (position === 0) {
8332
8335
  update = true;
8333
8336
  }
@@ -23581,11 +23584,14 @@ function eval_pyson(value){
23581
23584
  cell.text(value);
23582
23585
  }
23583
23586
  };
23587
+ let prm = jQuery.when();
23584
23588
  if (!record.is_loaded(this.attributes.name)) {
23585
- record.load(this.attributes.name, true, false).done(render);
23586
- } else {
23587
- render();
23589
+ prm = prm.then(() => record.load(this.attributes.name, true, false));
23588
23590
  }
23591
+ if (this.icon && (this.icon in record.model.fields)) {
23592
+ prm = prm.then(() => record.load(this.icon, true, false));
23593
+ }
23594
+ prm.done(render);
23589
23595
  return cell;
23590
23596
  },
23591
23597
  clicked: function(event) {
@@ -23808,6 +23814,7 @@ function eval_pyson(value){
23808
23814
  view_ids.shift();
23809
23815
  }
23810
23816
  cell.click(event => {
23817
+ event.preventDefault();
23811
23818
  event.stopPropagation();
23812
23819
  var params = {};
23813
23820
  params.model = this.attributes.relation;
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.6.13",
5
+ "version": "7.6.15",
6
6
  "homepage": "https://www.tryton.org/",
7
7
  "author": {
8
8
  "name": "Tryton"
package/src/model.js CHANGED
@@ -513,11 +513,14 @@
513
513
  } else {
514
514
  cmp = function(a, b) { return a < b; };
515
515
  }
516
+ let max_id = Math.max(0, ...this.map((r) => r.id));
516
517
  for (const record of this) {
517
518
  if (record.get_loaded([field]) || changed || record.id < 0) {
519
+ let prev_id = null;
518
520
  if (prev) {
519
521
  prev.load(field, false);
520
522
  index = prev.field_get(field);
523
+ prev_id = prev.id >= 0 ? prev.id : max_id++;
521
524
  } else {
522
525
  index = null;
523
526
  }
@@ -528,7 +531,7 @@
528
531
  update = true;
529
532
  } else if (prev) {
530
533
  if (record.id >= 0) {
531
- update = cmp(record.id, prev.id);
534
+ update = cmp(record.id, prev_id);
532
535
  } else if (position === 0) {
533
536
  update = true;
534
537
  }
@@ -536,7 +539,7 @@
536
539
  } else if (value === index) {
537
540
  if (prev) {
538
541
  if (record.id >= 0) {
539
- update = cmp(record.id, prev.id);
542
+ update = cmp(record.id, prev_id);
540
543
  } else if (position === 0) {
541
544
  update = true;
542
545
  }
package/src/sao.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.6.12',
6
+ __version__: '7.6.15',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
package/src/view/tree.js CHANGED
@@ -2537,11 +2537,14 @@
2537
2537
  cell.text(value);
2538
2538
  }
2539
2539
  };
2540
+ let prm = jQuery.when();
2540
2541
  if (!record.is_loaded(this.attributes.name)) {
2541
- record.load(this.attributes.name, true, false).done(render);
2542
- } else {
2543
- render();
2542
+ prm = prm.then(() => record.load(this.attributes.name, true, false));
2544
2543
  }
2544
+ if (this.icon && (this.icon in record.model.fields)) {
2545
+ prm = prm.then(() => record.load(this.icon, true, false));
2546
+ }
2547
+ prm.done(render);
2545
2548
  return cell;
2546
2549
  },
2547
2550
  clicked: function(event) {
@@ -2764,6 +2767,7 @@
2764
2767
  view_ids.shift();
2765
2768
  }
2766
2769
  cell.click(event => {
2770
+ event.preventDefault();
2767
2771
  event.stopPropagation();
2768
2772
  var params = {};
2769
2773
  params.model = this.attributes.relation;