tryton-sao 7.6.17 → 7.6.19

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.19 - 2026-04-16
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 7.6.18 - 2026-03-18
8
+ ---------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 7.6.17 - 2026-03-02
3
13
  ---------------------------
4
14
  * Bug fixes (see mercurial logs for details)
package/COPYRIGHT CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2012-2025 Nicolas Évrard.
1
+ Copyright (C) 2012-2026 Nicolas Évrard.
2
2
  Copyright (C) 2012-2026 Cédric Krier.
3
3
  Copyright (C) 2012-2014 Bertrand Chenal.
4
4
  Copyright (C) 2012-2026 B2CK SPRL.
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.6.17',
6
+ __version__: '7.6.19',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -416,7 +416,7 @@ var Sao = {
416
416
  navigator.userLanguage ||
417
417
  'en').replace('-', '_');
418
418
  }
419
- jQuery('html').attr('lang', lang);
419
+ jQuery('html').attr('lang', Sao.i18n.BC47(lang));
420
420
  Sao.i18n.setLocale(lang);
421
421
  moment.locale(lang.slice(0, 2));
422
422
  return jQuery.getJSON('locale/' + lang + '.json').then(function(data) {
@@ -3032,6 +3032,7 @@ var Sao = {
3032
3032
  if (service_window.closed) {
3033
3033
  window.clearInterval(timer);
3034
3034
  session.database = database;
3035
+ session.login = null;
3035
3036
  session.restore();
3036
3037
  if (session.session) {
3037
3038
  dfd.resolve(session);
@@ -3250,6 +3251,9 @@ var Sao = {
3250
3251
  });
3251
3252
  }).prependTo(dialog.footer);
3252
3253
  dialog.modal.find('.modal-dialog').removeClass('modal-sm');
3254
+ prm.fail(() => {
3255
+ session.login = null;
3256
+ });
3253
3257
  return dialog;
3254
3258
  },
3255
3259
  });
@@ -5436,6 +5440,7 @@ var Sao = {
5436
5440
  let [, thousandSeparator] = /^10(.)?000/.exec(format(10000));
5437
5441
  let [, decimalSign] = /^0(.)1$/.exec(format(0.1));
5438
5442
  return Number(string
5443
+ .replaceAll(' ', '')
5439
5444
  .replaceAll(thousandSeparator, '')
5440
5445
  .replace(decimalSign, '.'));
5441
5446
  }
@@ -5567,6 +5572,7 @@ var Sao = {
5567
5572
  }
5568
5573
  var factor = Number(field.factor || 1);
5569
5574
  digit -= Math.round(Math.log10(factor));
5575
+ digit = Math.max(digit, 0);
5570
5576
  return (value * factor).toLocaleString(
5571
5577
  Sao.i18n.BC47(Sao.i18n.getlang()), {
5572
5578
  useGrouping: true,
@@ -10404,10 +10410,7 @@ var Sao = {
10404
10410
  if (record2) {
10405
10411
  let to_update = Object.fromEntries(
10406
10412
  Object.entries(vals).filter(
10407
- ([k, v]) => {
10408
- !Object.prototype.hasOwnProperty.call(
10409
- vals_to_set, k)
10410
- }
10413
+ ([k, v]) => !Object.hasOwn(vals_to_set, k)
10411
10414
  ));
10412
10415
  record2.set_on_change(to_update);
10413
10416
  }
@@ -10986,6 +10989,8 @@ var Sao = {
10986
10989
  if (this.info_bar) {
10987
10990
  this.el.append(this.info_bar.el);
10988
10991
  }
10992
+
10993
+ this._chat = null;
10989
10994
  },
10990
10995
  set_menu: function(menu) {
10991
10996
  var previous;
@@ -11195,6 +11200,9 @@ var Sao = {
11195
11200
  tabs.trigger('ready');
11196
11201
  if (this._chat) {
11197
11202
  this._chat.unregister();
11203
+ let chat = this.sidebar_content.find('.chat');
11204
+ chat.remove();
11205
+ this._chat = null;
11198
11206
  }
11199
11207
  });
11200
11208
  },
@@ -11791,6 +11799,8 @@ var Sao = {
11791
11799
  }
11792
11800
  return set_cursor;
11793
11801
  });
11802
+ } else {
11803
+ this.refresh_resources(true);
11794
11804
  }
11795
11805
  return set_cursor;
11796
11806
  })
@@ -12254,6 +12264,8 @@ var Sao = {
12254
12264
  let chat = this.sidebar_content.find('.chat');
12255
12265
  if (chat.length) {
12256
12266
  chat.remove();
12267
+ this._chat.unregister()
12268
+ this._chat = null;
12257
12269
  } else {
12258
12270
  if (this.screen.current_reference) {
12259
12271
  this._chat = new Sao.Chat(this.screen.current_reference);
@@ -13135,8 +13147,14 @@ var Sao = {
13135
13147
  break;
13136
13148
  case 'selection':
13137
13149
  case 'multiselection':
13150
+ var selection = jQuery.extend([], field.selection);
13151
+ if (field.sort === undefined || field.sort) {
13152
+ selection.sort(function(a, b) {
13153
+ return a[1].localeCompare(b[1]);
13154
+ });
13155
+ }
13138
13156
  entry = new Sao.ScreenContainer.Selection(
13139
- field.selection, prefix + field.name);
13157
+ selection, prefix + field.name);
13140
13158
  input = entry.el;
13141
13159
  input.prop('size', field.selection.length);
13142
13160
  break;
@@ -13380,7 +13398,7 @@ var Sao = {
13380
13398
  'class': 'form-control input-sm',
13381
13399
  'type': 'number',
13382
13400
  'step': 'any',
13383
- 'lang': Sao.i18n.getlang(),
13401
+ 'lang': Sao.i18n.BC47(Sao.i18n.getlang()),
13384
13402
  }).appendTo(el);
13385
13403
  return entry;
13386
13404
  },
@@ -14762,7 +14780,7 @@ var Sao = {
14762
14780
  if (this.current_view &&
14763
14781
  ~['tree', 'graph', 'calendar'].indexOf(this.current_view.view_type) &&
14764
14782
  !this.group.parent) {
14765
- return this.search_filter();
14783
+ return this.search_filter(this.screen_container.get_text());
14766
14784
  }
14767
14785
  } else if (action == 'reload menu') {
14768
14786
  return Sao.Session.current_session.reload_context()
@@ -17229,7 +17247,7 @@ function eval_pyson(value){
17229
17247
  input_text.attr('type', 'text');
17230
17248
  input.attr('type', 'number');
17231
17249
  input.attr('step', 1);
17232
- input.attr('lang', Sao.i18n.getlang());
17250
+ input.attr('lang', Sao.i18n.BC47(Sao.i18n.getlang()));
17233
17251
 
17234
17252
  input.hide().on('focusout', function() {
17235
17253
  if (input[0].checkValidity()) {
@@ -21532,6 +21550,8 @@ function eval_pyson(value){
21532
21550
  'reset_width',
21533
21551
  [this.screen.model_name, window.screen.width],
21534
21552
  {});
21553
+ Sao.Session.current_session.cache.clear(
21554
+ `model.${this.screen.model_name}.fields_view_get`);
21535
21555
 
21536
21556
  for (let column of this.columns) {
21537
21557
  if (column.col.data('computed-width')) {
@@ -25004,7 +25024,7 @@ function eval_pyson(value){
25004
25024
  this.view.screen.context.calendar_scroll_time ||
25005
25025
  Sao.Time(6)).toString(),
25006
25026
  events: this.view.get_events.bind(this.view),
25007
- locale: Sao.i18n.getlang().slice(0, 2),
25027
+ locale: Sao.i18n.BC47(Sao.i18n.getlang()).toLowerCase(),
25008
25028
  isRTL: Sao.i18n.rtl,
25009
25029
  themeSystem: 'bootstrap3',
25010
25030
  bootstrapGlyphicons: {
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.17",
5
+ "version": "7.6.19",
6
6
  "homepage": "https://www.tryton.org/",
7
7
  "author": {
8
8
  "name": "Tryton"
package/src/common.js CHANGED
@@ -2087,6 +2087,7 @@
2087
2087
  let [, thousandSeparator] = /^10(.)?000/.exec(format(10000));
2088
2088
  let [, decimalSign] = /^0(.)1$/.exec(format(0.1));
2089
2089
  return Number(string
2090
+ .replaceAll(' ', '')
2090
2091
  .replaceAll(thousandSeparator, '')
2091
2092
  .replace(decimalSign, '.'));
2092
2093
  }
@@ -2218,6 +2219,7 @@
2218
2219
  }
2219
2220
  var factor = Number(field.factor || 1);
2220
2221
  digit -= Math.round(Math.log10(factor));
2222
+ digit = Math.max(digit, 0);
2221
2223
  return (value * factor).toLocaleString(
2222
2224
  Sao.i18n.BC47(Sao.i18n.getlang()), {
2223
2225
  useGrouping: true,
package/src/model.js CHANGED
@@ -2570,10 +2570,7 @@
2570
2570
  if (record2) {
2571
2571
  let to_update = Object.fromEntries(
2572
2572
  Object.entries(vals).filter(
2573
- ([k, v]) => {
2574
- !Object.prototype.hasOwnProperty.call(
2575
- vals_to_set, k)
2576
- }
2573
+ ([k, v]) => !Object.hasOwn(vals_to_set, k)
2577
2574
  ));
2578
2575
  record2.set_on_change(to_update);
2579
2576
  }
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.17',
6
+ __version__: '7.6.19',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -416,7 +416,7 @@ var Sao = {
416
416
  navigator.userLanguage ||
417
417
  'en').replace('-', '_');
418
418
  }
419
- jQuery('html').attr('lang', lang);
419
+ jQuery('html').attr('lang', Sao.i18n.BC47(lang));
420
420
  Sao.i18n.setLocale(lang);
421
421
  moment.locale(lang.slice(0, 2));
422
422
  return jQuery.getJSON('locale/' + lang + '.json').then(function(data) {
package/src/screen.js CHANGED
@@ -501,8 +501,14 @@
501
501
  break;
502
502
  case 'selection':
503
503
  case 'multiselection':
504
+ var selection = jQuery.extend([], field.selection);
505
+ if (field.sort === undefined || field.sort) {
506
+ selection.sort(function(a, b) {
507
+ return a[1].localeCompare(b[1]);
508
+ });
509
+ }
504
510
  entry = new Sao.ScreenContainer.Selection(
505
- field.selection, prefix + field.name);
511
+ selection, prefix + field.name);
506
512
  input = entry.el;
507
513
  input.prop('size', field.selection.length);
508
514
  break;
@@ -746,7 +752,7 @@
746
752
  'class': 'form-control input-sm',
747
753
  'type': 'number',
748
754
  'step': 'any',
749
- 'lang': Sao.i18n.getlang(),
755
+ 'lang': Sao.i18n.BC47(Sao.i18n.getlang()),
750
756
  }).appendTo(el);
751
757
  return entry;
752
758
  },
@@ -2128,7 +2134,7 @@
2128
2134
  if (this.current_view &&
2129
2135
  ~['tree', 'graph', 'calendar'].indexOf(this.current_view.view_type) &&
2130
2136
  !this.group.parent) {
2131
- return this.search_filter();
2137
+ return this.search_filter(this.screen_container.get_text());
2132
2138
  }
2133
2139
  } else if (action == 'reload menu') {
2134
2140
  return Sao.Session.current_session.reload_context()
package/src/session.js CHANGED
@@ -341,6 +341,7 @@
341
341
  if (service_window.closed) {
342
342
  window.clearInterval(timer);
343
343
  session.database = database;
344
+ session.login = null;
344
345
  session.restore();
345
346
  if (session.session) {
346
347
  dfd.resolve(session);
@@ -559,6 +560,9 @@
559
560
  });
560
561
  }).prependTo(dialog.footer);
561
562
  dialog.modal.find('.modal-dialog').removeClass('modal-sm');
563
+ prm.fail(() => {
564
+ session.login = null;
565
+ });
562
566
  return dialog;
563
567
  },
564
568
  });
package/src/tab.js CHANGED
@@ -141,6 +141,8 @@
141
141
  if (this.info_bar) {
142
142
  this.el.append(this.info_bar.el);
143
143
  }
144
+
145
+ this._chat = null;
144
146
  },
145
147
  set_menu: function(menu) {
146
148
  var previous;
@@ -350,6 +352,9 @@
350
352
  tabs.trigger('ready');
351
353
  if (this._chat) {
352
354
  this._chat.unregister();
355
+ let chat = this.sidebar_content.find('.chat');
356
+ chat.remove();
357
+ this._chat = null;
353
358
  }
354
359
  });
355
360
  },
@@ -946,6 +951,8 @@
946
951
  }
947
952
  return set_cursor;
948
953
  });
954
+ } else {
955
+ this.refresh_resources(true);
949
956
  }
950
957
  return set_cursor;
951
958
  })
@@ -1409,6 +1416,8 @@
1409
1416
  let chat = this.sidebar_content.find('.chat');
1410
1417
  if (chat.length) {
1411
1418
  chat.remove();
1419
+ this._chat.unregister()
1420
+ this._chat = null;
1412
1421
  } else {
1413
1422
  if (this.screen.current_reference) {
1414
1423
  this._chat = new Sao.Chat(this.screen.current_reference);
@@ -87,7 +87,7 @@
87
87
  this.view.screen.context.calendar_scroll_time ||
88
88
  Sao.Time(6)).toString(),
89
89
  events: this.view.get_events.bind(this.view),
90
- locale: Sao.i18n.getlang().slice(0, 2),
90
+ locale: Sao.i18n.BC47(Sao.i18n.getlang()).toLowerCase(),
91
91
  isRTL: Sao.i18n.rtl,
92
92
  themeSystem: 'bootstrap3',
93
93
  bootstrapGlyphicons: {
package/src/view/form.js CHANGED
@@ -2062,7 +2062,7 @@ function eval_pyson(value){
2062
2062
  input_text.attr('type', 'text');
2063
2063
  input.attr('type', 'number');
2064
2064
  input.attr('step', 1);
2065
- input.attr('lang', Sao.i18n.getlang());
2065
+ input.attr('lang', Sao.i18n.BC47(Sao.i18n.getlang()));
2066
2066
 
2067
2067
  input.hide().on('focusout', function() {
2068
2068
  if (input[0].checkValidity()) {
package/src/view/tree.js CHANGED
@@ -447,6 +447,8 @@
447
447
  'reset_width',
448
448
  [this.screen.model_name, window.screen.width],
449
449
  {});
450
+ Sao.Session.current_session.cache.clear(
451
+ `model.${this.screen.model_name}.fields_view_get`);
450
452
 
451
453
  for (let column of this.columns) {
452
454
  if (column.col.data('computed-width')) {