tryton-sao 8.0.4 → 8.0.5

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,9 @@
1
1
 
2
+ Version 8.0.5 - 2026-06-18
3
+ --------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
2
7
  Version 8.0.4 - 2026-06-02
3
8
  --------------------------
4
9
  * Bug fixes (see mercurial logs for details)
@@ -9465,6 +9465,10 @@ html[theme="default"] .carousel-caption h6 {
9465
9465
  margin-bottom: -25px;
9466
9466
  width: 15px;
9467
9467
  }
9468
+ #user-preferences ul.notification-menu {
9469
+ background-color: #fff;
9470
+ color: #333333;
9471
+ }
9468
9472
  @media (min-width: 768px) {
9469
9473
  #user-preferences ul.notification-menu {
9470
9474
  width: 320px;
@@ -9477,6 +9481,7 @@ html[theme="default"] .carousel-caption h6 {
9477
9481
  background-color: #bceaeb;
9478
9482
  }
9479
9483
  #user-preferences ul.notification-menu > li.notification-item > a {
9484
+ color: #333333;
9480
9485
  display: flex;
9481
9486
  padding: 3px 10px;
9482
9487
  }
@@ -9503,6 +9508,9 @@ html[theme="default"] .carousel-caption h6 {
9503
9508
  text-align: center;
9504
9509
  background-color: #f5f5f5;
9505
9510
  }
9511
+ #user-preferences ul.notification-menu > li.divider {
9512
+ background-color: #e5e5e5;
9513
+ }
9506
9514
  .attachment-preview {
9507
9515
  border-bottom: 1px solid #eeeeee;
9508
9516
  display: flex;
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '8.0.4',
6
+ __version__: '8.0.5',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -93,7 +93,7 @@ var Sao = {
93
93
  let display = element.style.display;
94
94
  if (show) {
95
95
  if (display === 'none') {
96
- element.style.display = 'revert';
96
+ element.style.display = '';
97
97
  }
98
98
  } else {
99
99
  if (display !== 'none') {
@@ -14024,6 +14024,9 @@ var Sao = {
14024
14024
  });
14025
14025
  },
14026
14026
  get current_record() {
14027
+ if (this.__current_record && this.__current_record.destroyed) {
14028
+ this.__current_record = null;
14029
+ }
14027
14030
  return this.__current_record;
14028
14031
  },
14029
14032
  set current_record(record) {
@@ -15603,11 +15606,12 @@ function eval_pyson(value){
15603
15606
  });
15604
15607
  for (const e of fields) {
15605
15608
  const name = e[0];
15606
- promesses.push(record.load(name));
15609
+ if (!record.is_loaded(name)) {
15610
+ promesses.push(record.load(name));
15611
+ }
15607
15612
  }
15608
15613
  }
15609
- return jQuery.when.apply(jQuery,promesses)
15610
- .then(() => {
15614
+ let display = function() {
15611
15615
  let promesses = [];
15612
15616
  var record = this.record;
15613
15617
  for (const name in this.widgets) {
@@ -15645,7 +15649,13 @@ function eval_pyson(value){
15645
15649
  container.set_grid_template();
15646
15650
  }
15647
15651
  });
15648
- });
15652
+ }.bind(this);
15653
+ if (promesses.length) {
15654
+ return jQuery.when.apply(jQuery, promesses).then(
15655
+ () => display());
15656
+ } else {
15657
+ return display();
15658
+ }
15649
15659
  },
15650
15660
  set_value: function() {
15651
15661
  var record = this.record;
@@ -18747,7 +18757,11 @@ function eval_pyson(value){
18747
18757
  },
18748
18758
  set_readonly: function(readonly) {
18749
18759
  Sao.View.Form.One2Many._super.set_readonly.call(this, readonly);
18750
- this.prm.done(() => this._set_button_sensitive());
18760
+ if (this.prm.state() == 'pending') {
18761
+ this.prm.done(() => this._set_button_sensitive());
18762
+ } else {
18763
+ this._set_button_sensitive();
18764
+ }
18751
18765
  },
18752
18766
  _set_button_sensitive: function() {
18753
18767
  var size_limit, o2m_size;
@@ -18851,7 +18865,7 @@ function eval_pyson(value){
18851
18865
  display: function() {
18852
18866
  Sao.View.Form.One2Many._super.display.call(this);
18853
18867
 
18854
- return this.prm.then(() => {
18868
+ let display = function() {
18855
18869
  this._set_button_sensitive();
18856
18870
 
18857
18871
  var record = this.record;
@@ -18898,7 +18912,13 @@ function eval_pyson(value){
18898
18912
  .css('max-height', this.attributes.height + 'px');
18899
18913
  }
18900
18914
  return this.screen.display();
18901
- });
18915
+ }.bind(this);
18916
+
18917
+ if (this.prm.state() == 'pending') {
18918
+ return this.prm.then(() => display());
18919
+ } else {
18920
+ return display();
18921
+ }
18902
18922
  },
18903
18923
  focus: function() {
18904
18924
  if (this.attributes.add_remove) {
@@ -19175,7 +19195,11 @@ function eval_pyson(value){
19175
19195
  }
19176
19196
  var message = name + ' / ' + Sao.common.humanize(size);
19177
19197
  this.badge.text(message).attr('title', message);
19178
- this.prm.done(() => this._set_button_sensitive());
19198
+ if (this.prm.state() == 'pending') {
19199
+ this.prm.done(() => this._set_button_sensitive());
19200
+ } else {
19201
+ this._set_button_sensitive();
19202
+ }
19179
19203
  },
19180
19204
  validate: function() {
19181
19205
  var prm = jQuery.Deferred();
@@ -19423,7 +19447,7 @@ function eval_pyson(value){
19423
19447
  display: function() {
19424
19448
  Sao.View.Form.Many2Many._super.display.call(this);
19425
19449
 
19426
- return this.prm.then(() => {
19450
+ let display = function() {
19427
19451
  var record = this.record;
19428
19452
  var field = this.field;
19429
19453
 
@@ -19445,7 +19469,13 @@ function eval_pyson(value){
19445
19469
  .css('max-height', this.attributes.height + 'px');
19446
19470
  }
19447
19471
  return this.screen.display();
19448
- });
19472
+ }.bind(this);
19473
+
19474
+ if (this.prm.state() == 'pending') {
19475
+ return this.prm.then(() => display());
19476
+ } else {
19477
+ return display();
19478
+ }
19449
19479
  },
19450
19480
  focus: function() {
19451
19481
  this.entry.focus();
@@ -22695,6 +22725,13 @@ function eval_pyson(value){
22695
22725
  this.display_size = this.group.length;
22696
22726
  this.display();
22697
22727
  }
22728
+ if (reset_view) {
22729
+ let current_path = this.record.get_path(this.group);
22730
+ current_path = current_path.map(function(e) {
22731
+ return e[1];
22732
+ });
22733
+ this.display([current_path]);
22734
+ }
22698
22735
  if (path.length > 1) {
22699
22736
  prm = this.rows[path[0]].expand_to_path(
22700
22737
  path.slice(1),
@@ -25583,6 +25620,12 @@ function eval_pyson(value){
25583
25620
  return this.group.slice();
25584
25621
  },
25585
25622
  set_cursor: function(new_, reset_view) {
25623
+ if (!this.record) {
25624
+ return;
25625
+ }
25626
+ if (reset_view) {
25627
+ this.display([this.record.id]);
25628
+ }
25586
25629
  if (new_) {
25587
25630
  this.el.animate({
25588
25631
  scrollTop: this.el[0].scrollHeight
@@ -28599,15 +28642,16 @@ function eval_pyson(value){
28599
28642
  },
28600
28643
  _fill_with: function(template) {
28601
28644
  var prm;
28645
+ let context = this.record.get_context();
28602
28646
  if (template) {
28603
28647
  prm = Sao.rpc({
28604
28648
  'method': 'model.ir.email.template.get',
28605
- 'params': [template, this.record.id, {}],
28649
+ 'params': [template, this.record.id, context],
28606
28650
  }, this.record.model.session);
28607
28651
  } else {
28608
28652
  prm = Sao.rpc({
28609
28653
  'method': 'model.ir.email.template.get_default',
28610
- 'params': [this.record.model.name, this.record.id, {}],
28654
+ 'params': [this.record.model.name, this.record.id, context],
28611
28655
  }, this.record.model.session);
28612
28656
  }
28613
28657
  prm.then(values => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tryton-sao",
3
3
  "title": "sao",
4
4
  "description": "Tryton webclient",
5
- "version": "8.0.4",
5
+ "version": "8.0.5",
6
6
  "homepage": "https://www.tryton.org/",
7
7
  "author": {
8
8
  "name": "Tryton"
package/src/sao.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '8.0.4',
6
+ __version__: '8.0.5',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -93,7 +93,7 @@ var Sao = {
93
93
  let display = element.style.display;
94
94
  if (show) {
95
95
  if (display === 'none') {
96
- element.style.display = 'revert';
96
+ element.style.display = '';
97
97
  }
98
98
  } else {
99
99
  if (display !== 'none') {
package/src/sao.less CHANGED
@@ -441,6 +441,9 @@ html[theme="default"] {
441
441
  }
442
442
 
443
443
  ul.notification-menu {
444
+ background-color: @body-bg;
445
+ color: @text-color;
446
+
444
447
  @media (min-width: @grid-float-breakpoint) {
445
448
  width: 320px;
446
449
  }
@@ -453,6 +456,7 @@ html[theme="default"] {
453
456
  }
454
457
 
455
458
  > a {
459
+ color: @text-color;
456
460
  display: flex;
457
461
  padding: 3px 10px;
458
462
 
@@ -489,6 +493,10 @@ html[theme="default"] {
489
493
  }
490
494
  }
491
495
  }
496
+
497
+ > li.divider {
498
+ background-color: @dropdown-divider-bg;
499
+ }
492
500
  }
493
501
  }
494
502
 
package/src/screen.js CHANGED
@@ -1356,6 +1356,9 @@
1356
1356
  });
1357
1357
  },
1358
1358
  get current_record() {
1359
+ if (this.__current_record && this.__current_record.destroyed) {
1360
+ this.__current_record = null;
1361
+ }
1359
1362
  return this.__current_record;
1360
1363
  },
1361
1364
  set current_record(record) {
package/src/view/form.js CHANGED
@@ -378,11 +378,12 @@ function eval_pyson(value){
378
378
  });
379
379
  for (const e of fields) {
380
380
  const name = e[0];
381
- promesses.push(record.load(name));
381
+ if (!record.is_loaded(name)) {
382
+ promesses.push(record.load(name));
383
+ }
382
384
  }
383
385
  }
384
- return jQuery.when.apply(jQuery,promesses)
385
- .then(() => {
386
+ let display = function() {
386
387
  let promesses = [];
387
388
  var record = this.record;
388
389
  for (const name in this.widgets) {
@@ -420,7 +421,13 @@ function eval_pyson(value){
420
421
  container.set_grid_template();
421
422
  }
422
423
  });
423
- });
424
+ }.bind(this);
425
+ if (promesses.length) {
426
+ return jQuery.when.apply(jQuery, promesses).then(
427
+ () => display());
428
+ } else {
429
+ return display();
430
+ }
424
431
  },
425
432
  set_value: function() {
426
433
  var record = this.record;
@@ -3522,7 +3529,11 @@ function eval_pyson(value){
3522
3529
  },
3523
3530
  set_readonly: function(readonly) {
3524
3531
  Sao.View.Form.One2Many._super.set_readonly.call(this, readonly);
3525
- this.prm.done(() => this._set_button_sensitive());
3532
+ if (this.prm.state() == 'pending') {
3533
+ this.prm.done(() => this._set_button_sensitive());
3534
+ } else {
3535
+ this._set_button_sensitive();
3536
+ }
3526
3537
  },
3527
3538
  _set_button_sensitive: function() {
3528
3539
  var size_limit, o2m_size;
@@ -3626,7 +3637,7 @@ function eval_pyson(value){
3626
3637
  display: function() {
3627
3638
  Sao.View.Form.One2Many._super.display.call(this);
3628
3639
 
3629
- return this.prm.then(() => {
3640
+ let display = function() {
3630
3641
  this._set_button_sensitive();
3631
3642
 
3632
3643
  var record = this.record;
@@ -3673,7 +3684,13 @@ function eval_pyson(value){
3673
3684
  .css('max-height', this.attributes.height + 'px');
3674
3685
  }
3675
3686
  return this.screen.display();
3676
- });
3687
+ }.bind(this);
3688
+
3689
+ if (this.prm.state() == 'pending') {
3690
+ return this.prm.then(() => display());
3691
+ } else {
3692
+ return display();
3693
+ }
3677
3694
  },
3678
3695
  focus: function() {
3679
3696
  if (this.attributes.add_remove) {
@@ -3950,7 +3967,11 @@ function eval_pyson(value){
3950
3967
  }
3951
3968
  var message = name + ' / ' + Sao.common.humanize(size);
3952
3969
  this.badge.text(message).attr('title', message);
3953
- this.prm.done(() => this._set_button_sensitive());
3970
+ if (this.prm.state() == 'pending') {
3971
+ this.prm.done(() => this._set_button_sensitive());
3972
+ } else {
3973
+ this._set_button_sensitive();
3974
+ }
3954
3975
  },
3955
3976
  validate: function() {
3956
3977
  var prm = jQuery.Deferred();
@@ -4198,7 +4219,7 @@ function eval_pyson(value){
4198
4219
  display: function() {
4199
4220
  Sao.View.Form.Many2Many._super.display.call(this);
4200
4221
 
4201
- return this.prm.then(() => {
4222
+ let display = function() {
4202
4223
  var record = this.record;
4203
4224
  var field = this.field;
4204
4225
 
@@ -4220,7 +4241,13 @@ function eval_pyson(value){
4220
4241
  .css('max-height', this.attributes.height + 'px');
4221
4242
  }
4222
4243
  return this.screen.display();
4223
- });
4244
+ }.bind(this);
4245
+
4246
+ if (this.prm.state() == 'pending') {
4247
+ return this.prm.then(() => display());
4248
+ } else {
4249
+ return display();
4250
+ }
4224
4251
  },
4225
4252
  focus: function() {
4226
4253
  this.entry.focus();
@@ -115,6 +115,12 @@
115
115
  return this.group.slice();
116
116
  },
117
117
  set_cursor: function(new_, reset_view) {
118
+ if (!this.record) {
119
+ return;
120
+ }
121
+ if (reset_view) {
122
+ this.display([this.record.id]);
123
+ }
118
124
  if (new_) {
119
125
  this.el.animate({
120
126
  scrollTop: this.el[0].scrollHeight
package/src/view/tree.js CHANGED
@@ -1557,6 +1557,13 @@
1557
1557
  this.display_size = this.group.length;
1558
1558
  this.display();
1559
1559
  }
1560
+ if (reset_view) {
1561
+ let current_path = this.record.get_path(this.group);
1562
+ current_path = current_path.map(function(e) {
1563
+ return e[1];
1564
+ });
1565
+ this.display([current_path]);
1566
+ }
1560
1567
  if (path.length > 1) {
1561
1568
  prm = this.rows[path[0]].expand_to_path(
1562
1569
  path.slice(1),
package/src/window.js CHANGED
@@ -2699,15 +2699,16 @@
2699
2699
  },
2700
2700
  _fill_with: function(template) {
2701
2701
  var prm;
2702
+ let context = this.record.get_context();
2702
2703
  if (template) {
2703
2704
  prm = Sao.rpc({
2704
2705
  'method': 'model.ir.email.template.get',
2705
- 'params': [template, this.record.id, {}],
2706
+ 'params': [template, this.record.id, context],
2706
2707
  }, this.record.model.session);
2707
2708
  } else {
2708
2709
  prm = Sao.rpc({
2709
2710
  'method': 'model.ir.email.template.get_default',
2710
- 'params': [this.record.model.name, this.record.id, {}],
2711
+ 'params': [this.record.model.name, this.record.id, context],
2711
2712
  }, this.record.model.session);
2712
2713
  }
2713
2714
  prm.then(values => {