tryton-sao 7.6.0 → 7.6.1

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 7.6.1 - 2025-05-15
3
+ --------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
2
7
  Version 7.6.0 - 2025-04-28
3
8
  --------------------------
4
9
  * Bug fixes (see mercurial logs for details)
@@ -9951,6 +9951,7 @@ img.icon {
9951
9951
  text-align: end;
9952
9952
  }
9953
9953
  .treeview > table.tree > thead > tr:first-child {
9954
+ background-color: #fff;
9954
9955
  position: sticky;
9955
9956
  top: 0;
9956
9957
  z-index: 100;
@@ -9958,20 +9959,17 @@ img.icon {
9958
9959
  .treeview > table.tree > thead > tr:first-child th {
9959
9960
  border: 1px solid transparent;
9960
9961
  border-bottom: 2px solid #ddd;
9961
- background-color: #fff;
9962
9962
  }
9963
9963
  .treeview > table.tree > thead > tr:first-child:hover th {
9964
9964
  border: 1px solid #ddd;
9965
9965
  border-bottom-width: 2px;
9966
9966
  }
9967
9967
  .treeview > table.tree > tfoot > tr {
9968
+ background-color: #fff;
9968
9969
  bottom: 0;
9969
9970
  position: sticky;
9970
9971
  z-index: 100;
9971
9972
  }
9972
- .treeview > table.tree > tfoot > tr th {
9973
- background-color: #fff;
9974
- }
9975
9973
  .treeview > table.tree > tfoot > tr th > label {
9976
9974
  display: none;
9977
9975
  }
@@ -10408,12 +10406,14 @@ img.icon {
10408
10406
  .form .form-richtext,
10409
10407
  .board .form-richtext {
10410
10408
  display: flex;
10409
+ flex-direction: column;
10411
10410
  }
10412
10411
  .form .form-text .input-group,
10413
10412
  .board .form-text .input-group,
10414
10413
  .form .form-richtext .input-group,
10415
10414
  .board .form-richtext .input-group {
10416
10415
  display: flex;
10416
+ height: 100%;
10417
10417
  width: 100%;
10418
10418
  }
10419
10419
  .form .form-text .input-group textarea,
@@ -10429,6 +10429,7 @@ img.icon {
10429
10429
  min-height: 12.5ex;
10430
10430
  overflow: auto;
10431
10431
  resize: vertical;
10432
+ width: 100%;
10432
10433
  }
10433
10434
  .form .form-text .input-group > span,
10434
10435
  .board .form-text .input-group > span,
@@ -10440,6 +10441,10 @@ img.icon {
10440
10441
  .board .form-richtext > .btn-toolbar {
10441
10442
  min-width: 450px;
10442
10443
  }
10444
+ .form .form-richtext > .panel-body,
10445
+ .board .form-richtext > .panel-body {
10446
+ flex-grow: 2;
10447
+ }
10443
10448
  .form .form-separator label,
10444
10449
  .board .form-separator label {
10445
10450
  margin-top: 10px;
@@ -10464,6 +10469,7 @@ img.icon {
10464
10469
  max-width: 100%;
10465
10470
  min-height: 50vh;
10466
10471
  height: 100%;
10472
+ width: 100%;
10467
10473
  }
10468
10474
  @media screen and (max-width: 767px) {
10469
10475
  .form .form-document object,
@@ -9125,6 +9125,9 @@ var Sao = {
9125
9125
  }
9126
9126
  },
9127
9127
  get_loaded: function(fields) {
9128
+ if (this.id < 0) {
9129
+ return true;
9130
+ }
9128
9131
  if (!fields) {
9129
9132
  fields = Object.keys(this.model.fields);
9130
9133
  }
@@ -10272,6 +10275,7 @@ var Sao = {
10272
10275
  }
10273
10276
 
10274
10277
  if (value && (value.add || value.update)) {
10278
+ let vals_to_set = {};
10275
10279
  // First set already added fields to prevent triggering a
10276
10280
  // second on_change call
10277
10281
  if (value.update) {
@@ -10281,9 +10285,9 @@ var Sao = {
10281
10285
  }
10282
10286
  const record2 = group.get(vals.id);
10283
10287
  if (record2) {
10284
- var vals_to_set = {};
10285
10288
  for (var key in vals) {
10286
- if (!Object.prototype.hasOwnProperty.call(new_field_names, key)) {
10289
+ if (!Object.prototype.hasOwnProperty.call(
10290
+ new_field_names, key)) {
10287
10291
  vals_to_set[key] = vals[key];
10288
10292
  }
10289
10293
  }
@@ -10319,7 +10323,10 @@ var Sao = {
10319
10323
  if (record2) {
10320
10324
  let to_update = Object.fromEntries(
10321
10325
  Object.entries(vals).filter(
10322
- ([k, v]) => !Object.prototype.hasOwnProperty.call(vals_to_set, k)
10326
+ ([k, v]) => {
10327
+ !Object.prototype.hasOwnProperty.call(
10328
+ vals_to_set, k)
10329
+ }
10323
10330
  ));
10324
10331
  record2.set_on_change(to_update);
10325
10332
  }
@@ -11623,15 +11630,20 @@ var Sao = {
11623
11630
  case 'ok':
11624
11631
  return this.save();
11625
11632
  case 'ko':
11626
- var record_id = this.screen.current_record.id;
11633
+ var record_id = null;
11634
+ if (this.screen.current_record) {
11635
+ record_id = this.screen.current_record.id;
11636
+ }
11627
11637
  return this.reload(false).then(() => {
11628
- if (record_id < 0) {
11629
- return jQuery.Deferred().reject(true);
11630
- }
11631
- else if (this.screen.current_record) {
11632
- if (record_id !=
11633
- this.screen.current_record.id) {
11634
- return jQuery.Deferred().reject();
11638
+ if (record_id !== null) {
11639
+ if (record_id < 0) {
11640
+ return jQuery.Deferred().reject(true);
11641
+ }
11642
+ else if (this.screen.current_record) {
11643
+ if (record_id !=
11644
+ this.screen.current_record.id) {
11645
+ return jQuery.Deferred().reject();
11646
+ }
11635
11647
  }
11636
11648
  }
11637
11649
  });
@@ -16488,7 +16500,8 @@ function eval_pyson(value){
16488
16500
  class_: 'form',
16489
16501
  init: function(languages, widget) {
16490
16502
  var dialog = new Sao.Dialog(
16491
- Sao.i18n.gettext('Translate'), this.class_, 'md');
16503
+ Sao.i18n.gettext('Translate'), this.class_,
16504
+ widget.expand? 'lg' : 'md');
16492
16505
  this.languages = languages;
16493
16506
  this.read(widget, dialog);
16494
16507
  jQuery('<button/>', {
@@ -16579,10 +16592,10 @@ function eval_pyson(value){
16579
16592
  input.uniqueId();
16580
16593
  row.append(jQuery('<label/>', {
16581
16594
  'for': input.attr('id'),
16582
- 'class': 'col-sm-3 control-label',
16595
+ 'class': 'col-sm-2 control-label',
16583
16596
  }).append(' ' + lang.name));
16584
16597
  row.append(jQuery('<div/>', {
16585
- 'class': 'col-sm-9 input-group',
16598
+ 'class': 'col-sm-10 input-group',
16586
16599
  }).append(input)
16587
16600
  .append(jQuery('<span/>', {
16588
16601
  'class': 'input-group-addon',
@@ -17654,9 +17667,11 @@ function eval_pyson(value){
17654
17667
  jQuery('<div/>', {
17655
17668
  'class': 'richtext mousetrap',
17656
17669
  'contenteditable': true
17670
+ }).appendTo(jQuery('<div/>', {
17671
+ 'class': 'input-group',
17657
17672
  }).appendTo(jQuery('<div/>', {
17658
17673
  'class': 'panel-body'
17659
- }).appendTo(widget));
17674
+ }).appendTo(widget)));
17660
17675
  return widget;
17661
17676
  },
17662
17677
  translate_widget_set_readonly: function(el, value) {
@@ -22020,6 +22035,8 @@ function eval_pyson(value){
22020
22035
  column.col.show();
22021
22036
  }
22022
22037
  }
22038
+ this.table.find('thead > tr > th .resizer').show();
22039
+ this.table.find('thead > tr > th:visible:last .resizer').hide();
22023
22040
  if (this.children_field) {
22024
22041
  this.columns.every(column => {
22025
22042
  if (column.col.hasClass('draggable-handle') ||
@@ -22075,7 +22092,8 @@ function eval_pyson(value){
22075
22092
  'type': 'button',
22076
22093
  'title': Sao.i18n.gettext("More"),
22077
22094
  }).text(Sao.i18n.gettext('More')
22078
- ).click(() => {
22095
+ ).one('click', () => {
22096
+ this.tbody.find('tr.more-row').remove();
22079
22097
  var height = this.table.height();
22080
22098
  this.display_size += Sao.config.display_size;
22081
22099
  this.display();
@@ -25980,7 +25998,9 @@ function eval_pyson(value){
25980
25998
  }
25981
25999
  }
25982
26000
  let message = name + '/' + Sao.common.humanize(size);
25983
- this.label.text(message).attr('title', message);
26001
+ if (this.label) {
26002
+ this.label.text(message).attr('title', message);
26003
+ }
25984
26004
  this._set_button_sensitive();
25985
26005
  },
25986
26006
  record_modified: function() {
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.0",
5
+ "version": "7.6.1",
6
6
  "homepage": "https://www.tryton.org/",
7
7
  "author": {
8
8
  "name": "Tryton"
package/src/model.js CHANGED
@@ -1367,6 +1367,9 @@
1367
1367
  }
1368
1368
  },
1369
1369
  get_loaded: function(fields) {
1370
+ if (this.id < 0) {
1371
+ return true;
1372
+ }
1370
1373
  if (!fields) {
1371
1374
  fields = Object.keys(this.model.fields);
1372
1375
  }
@@ -2514,6 +2517,7 @@
2514
2517
  }
2515
2518
 
2516
2519
  if (value && (value.add || value.update)) {
2520
+ let vals_to_set = {};
2517
2521
  // First set already added fields to prevent triggering a
2518
2522
  // second on_change call
2519
2523
  if (value.update) {
@@ -2523,9 +2527,9 @@
2523
2527
  }
2524
2528
  const record2 = group.get(vals.id);
2525
2529
  if (record2) {
2526
- var vals_to_set = {};
2527
2530
  for (var key in vals) {
2528
- if (!Object.prototype.hasOwnProperty.call(new_field_names, key)) {
2531
+ if (!Object.prototype.hasOwnProperty.call(
2532
+ new_field_names, key)) {
2529
2533
  vals_to_set[key] = vals[key];
2530
2534
  }
2531
2535
  }
@@ -2561,7 +2565,10 @@
2561
2565
  if (record2) {
2562
2566
  let to_update = Object.fromEntries(
2563
2567
  Object.entries(vals).filter(
2564
- ([k, v]) => !Object.prototype.hasOwnProperty.call(vals_to_set, k)
2568
+ ([k, v]) => {
2569
+ !Object.prototype.hasOwnProperty.call(
2570
+ vals_to_set, k)
2571
+ }
2565
2572
  ));
2566
2573
  record2.set_on_change(to_update);
2567
2574
  }
package/src/sao.less CHANGED
@@ -814,6 +814,7 @@ img.icon {
814
814
  }
815
815
  }
816
816
  > thead > tr:first-child {
817
+ background-color: @body-bg;
817
818
  position: sticky;
818
819
  top: 0;
819
820
  z-index: 100;
@@ -821,7 +822,6 @@ img.icon {
821
822
  th {
822
823
  border: 1px solid transparent;
823
824
  border-bottom: 2px solid @table-border-color;
824
- background-color: @body-bg;
825
825
  }
826
826
 
827
827
  &:hover th {
@@ -830,12 +830,12 @@ img.icon {
830
830
  }
831
831
  }
832
832
  > tfoot > tr {
833
+ background-color: @body-bg;
833
834
  bottom: 0;
834
835
  position: sticky;
835
836
  z-index: 100;
836
837
 
837
838
  th {
838
- background-color: @body-bg;
839
839
  & > label {
840
840
  display: none;
841
841
  }
@@ -1131,9 +1131,11 @@ img.icon {
1131
1131
  }
1132
1132
  .form-text, .form-richtext {
1133
1133
  display: flex;
1134
+ flex-direction: column;
1134
1135
 
1135
1136
  .input-group {
1136
1137
  display: flex;
1138
+ height: 100%;
1137
1139
  width: 100%;
1138
1140
 
1139
1141
  textarea, .richtext {
@@ -1142,6 +1144,7 @@ img.icon {
1142
1144
  min-height: 12.5ex;
1143
1145
  overflow: auto;
1144
1146
  resize: vertical;
1147
+ width: 100%;
1145
1148
  }
1146
1149
 
1147
1150
  > span {
@@ -1153,6 +1156,9 @@ img.icon {
1153
1156
  > .btn-toolbar {
1154
1157
  min-width: 450px;
1155
1158
  }
1159
+ > .panel-body {
1160
+ flex-grow: 2;
1161
+ }
1156
1162
  }
1157
1163
  .form-separator {
1158
1164
  label {
@@ -1177,6 +1183,7 @@ img.icon {
1177
1183
  max-width: 100%;
1178
1184
  min-height: 50vh;
1179
1185
  height: 100%;
1186
+ width: 100%;
1180
1187
  @media screen and (max-width: @screen-xs-max) {
1181
1188
  min-height: 25vh;
1182
1189
  }
package/src/tab.js CHANGED
@@ -861,15 +861,20 @@
861
861
  case 'ok':
862
862
  return this.save();
863
863
  case 'ko':
864
- var record_id = this.screen.current_record.id;
864
+ var record_id = null;
865
+ if (this.screen.current_record) {
866
+ record_id = this.screen.current_record.id;
867
+ }
865
868
  return this.reload(false).then(() => {
866
- if (record_id < 0) {
867
- return jQuery.Deferred().reject(true);
868
- }
869
- else if (this.screen.current_record) {
870
- if (record_id !=
871
- this.screen.current_record.id) {
872
- return jQuery.Deferred().reject();
869
+ if (record_id !== null) {
870
+ if (record_id < 0) {
871
+ return jQuery.Deferred().reject(true);
872
+ }
873
+ else if (this.screen.current_record) {
874
+ if (record_id !=
875
+ this.screen.current_record.id) {
876
+ return jQuery.Deferred().reject();
877
+ }
873
878
  }
874
879
  }
875
880
  });
package/src/view/form.js CHANGED
@@ -1423,7 +1423,8 @@ function eval_pyson(value){
1423
1423
  class_: 'form',
1424
1424
  init: function(languages, widget) {
1425
1425
  var dialog = new Sao.Dialog(
1426
- Sao.i18n.gettext('Translate'), this.class_, 'md');
1426
+ Sao.i18n.gettext('Translate'), this.class_,
1427
+ widget.expand? 'lg' : 'md');
1427
1428
  this.languages = languages;
1428
1429
  this.read(widget, dialog);
1429
1430
  jQuery('<button/>', {
@@ -1514,10 +1515,10 @@ function eval_pyson(value){
1514
1515
  input.uniqueId();
1515
1516
  row.append(jQuery('<label/>', {
1516
1517
  'for': input.attr('id'),
1517
- 'class': 'col-sm-3 control-label',
1518
+ 'class': 'col-sm-2 control-label',
1518
1519
  }).append(' ' + lang.name));
1519
1520
  row.append(jQuery('<div/>', {
1520
- 'class': 'col-sm-9 input-group',
1521
+ 'class': 'col-sm-10 input-group',
1521
1522
  }).append(input)
1522
1523
  .append(jQuery('<span/>', {
1523
1524
  'class': 'input-group-addon',
@@ -2589,9 +2590,11 @@ function eval_pyson(value){
2589
2590
  jQuery('<div/>', {
2590
2591
  'class': 'richtext mousetrap',
2591
2592
  'contenteditable': true
2593
+ }).appendTo(jQuery('<div/>', {
2594
+ 'class': 'input-group',
2592
2595
  }).appendTo(jQuery('<div/>', {
2593
2596
  'class': 'panel-body'
2594
- }).appendTo(widget));
2597
+ }).appendTo(widget)));
2595
2598
  return widget;
2596
2599
  },
2597
2600
  translate_widget_set_readonly: function(el, value) {
package/src/view/tree.js CHANGED
@@ -1063,6 +1063,8 @@
1063
1063
  column.col.show();
1064
1064
  }
1065
1065
  }
1066
+ this.table.find('thead > tr > th .resizer').show();
1067
+ this.table.find('thead > tr > th:visible:last .resizer').hide();
1066
1068
  if (this.children_field) {
1067
1069
  this.columns.every(column => {
1068
1070
  if (column.col.hasClass('draggable-handle') ||
@@ -1118,7 +1120,8 @@
1118
1120
  'type': 'button',
1119
1121
  'title': Sao.i18n.gettext("More"),
1120
1122
  }).text(Sao.i18n.gettext('More')
1121
- ).click(() => {
1123
+ ).one('click', () => {
1124
+ this.tbody.find('tr.more-row').remove();
1122
1125
  var height = this.table.height();
1123
1126
  this.display_size += Sao.config.display_size;
1124
1127
  this.display();
package/src/window.js CHANGED
@@ -416,7 +416,9 @@
416
416
  }
417
417
  }
418
418
  let message = name + '/' + Sao.common.humanize(size);
419
- this.label.text(message).attr('title', message);
419
+ if (this.label) {
420
+ this.label.text(message).attr('title', message);
421
+ }
420
422
  this._set_button_sensitive();
421
423
  },
422
424
  record_modified: function() {