tryton-sao 6.2.12 → 6.2.14

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,3 +1,10 @@
1
+ Version 6.2.14 - 2022-11-05
2
+ ---------------------------
3
+ * Bug fixes (see mercurial logs for details)
4
+
5
+ Version 6.2.13 - 2022-10-17
6
+ * Bug fixes (see mercurial logs for details)
7
+
1
8
  Version 6.2.12 - 2022-08-17
2
9
  * Bug fixes (see mercurial logs for details)
3
10
 
@@ -505,8 +505,8 @@ var Sao = {};
505
505
  }
506
506
  function open_wizard(path) {
507
507
  var attributes = {};
508
- attributes.name = path[0];
509
- if (!attributes.name) {
508
+ attributes.action = path[0];
509
+ if (!attributes.action) {
510
510
  return;
511
511
  }
512
512
  try {
@@ -3160,7 +3160,7 @@ var Sao = {};
3160
3160
 
3161
3161
  Sao.common.date_format = function(format) {
3162
3162
  if (jQuery.isEmptyObject(format)) {
3163
- format = '%Y-%m-%d';
3163
+ format = '%x';
3164
3164
  if (Sao.Session.current_session) {
3165
3165
  var context = Sao.Session.current_session.context;
3166
3166
  if (context.locale && context.locale.date) {
@@ -11644,20 +11644,17 @@ var Sao = {};
11644
11644
  },
11645
11645
  _close_allowed: function() {
11646
11646
  var wizard = this.wizard;
11647
- var prm = jQuery.when();
11648
11647
  if ((wizard.state !== wizard.end_state) &&
11649
11648
  (wizard.end_state in wizard.states)) {
11650
- prm = wizard.response(
11649
+ wizard.response(
11651
11650
  wizard.states[wizard.end_state].attributes);
11652
11651
  }
11653
11652
  var dfd = jQuery.Deferred();
11654
- prm.always(function() {
11655
- if (wizard.state === wizard.end_state) {
11656
- dfd.resolve();
11657
- } else {
11658
- dfd.reject();
11659
- }
11660
- });
11653
+ if (wizard.state === wizard.end_state) {
11654
+ dfd.resolve();
11655
+ } else {
11656
+ dfd.reject();
11657
+ }
11661
11658
  return dfd.promise();
11662
11659
  }
11663
11660
  });
@@ -15722,7 +15719,6 @@ function eval_pyson(value){
15722
15719
  _input_format: '%Y-%m-%d',
15723
15720
  _format: Sao.common.format_date,
15724
15721
  _parse: Sao.common.parse_date,
15725
- _default_format: '%x',
15726
15722
  init: function(view, attributes) {
15727
15723
  Sao.View.Form.Date._super.init.call(this, view, attributes);
15728
15724
  this.el = jQuery('<div/>', {
@@ -15754,7 +15750,10 @@ function eval_pyson(value){
15754
15750
  value = this._parse(this._input_format, value);
15755
15751
  value = this._format(this.get_format(), value);
15756
15752
  this.date.val(value).change();
15757
- this.date.focus();
15753
+ if (!~navigator.userAgent.indexOf("Firefox")) {
15754
+ // Firefox triggers change when navigate by month/year
15755
+ this.date.focus();
15756
+ }
15758
15757
  }
15759
15758
  }.bind(this));
15760
15759
  if (this.input[0].type == this._input) {
@@ -15762,6 +15761,7 @@ function eval_pyson(value){
15762
15761
  'class': 'icon-input icon-secondary',
15763
15762
  'aria-label': Sao.i18n.gettext("Open the calendar"),
15764
15763
  'title': Sao.i18n.gettext("Open the calendar"),
15764
+ 'tabindex': -1,
15765
15765
  }).appendTo(group);
15766
15766
  this.input.appendTo(this.icon);
15767
15767
  Sao.common.ICONFACTORY.get_icon_img('tryton-date')
@@ -15801,7 +15801,8 @@ function eval_pyson(value){
15801
15801
  if (this.field && this.record) {
15802
15802
  return this.field.date_format(this.record);
15803
15803
  } else {
15804
- return this._default_format;
15804
+ return Sao.common.date_format(
15805
+ this.view.screen.context.date_format);
15805
15806
  }
15806
15807
  },
15807
15808
  get_value: function() {
@@ -15858,13 +15859,13 @@ function eval_pyson(value){
15858
15859
  _input_format: '%Y-%m-%dT%H:%M:%S',
15859
15860
  _format: Sao.common.format_datetime,
15860
15861
  _parse: Sao.common.parse_datetime,
15861
- _default_format: '%x %X',
15862
15862
  get_format: function() {
15863
15863
  if (this.field && this.record) {
15864
15864
  return (this.field.date_format(this.record) + ' ' +
15865
15865
  this.field.time_format(this.record));
15866
15866
  } else {
15867
- return this._default_format;
15867
+ return (Sao.common.date_format(
15868
+ this.view.screen.context.date_format) + ' %X');
15868
15869
  }
15869
15870
  },
15870
15871
  cast: function(value){
@@ -15879,7 +15880,6 @@ function eval_pyson(value){
15879
15880
  _input_format: '%H:%M:%S',
15880
15881
  _format: Sao.common.format_time,
15881
15882
  _parse: Sao.common.parse_time,
15882
- _default_format: '%X',
15883
15883
  init: function(view, attributes) {
15884
15884
  Sao.View.Form.Time._super.init.call(this, view, attributes);
15885
15885
  if (~navigator.userAgent.indexOf("Firefox")) {
@@ -15891,7 +15891,7 @@ function eval_pyson(value){
15891
15891
  if (this.field && this.record) {
15892
15892
  return this.field.time_format(this.record);
15893
15893
  } else {
15894
- return this._default_format;
15894
+ return '%X';
15895
15895
  }
15896
15896
  },
15897
15897
  cast: function(value){
@@ -17427,7 +17427,7 @@ function eval_pyson(value){
17427
17427
  size_limit = record.expr_eval(this.attributes.size);
17428
17428
  }
17429
17429
  if (this._readonly) {
17430
- if (size_limit === null) {
17430
+ if ((size_limit === null) || (size_limit === undefined)) {
17431
17431
  size_limit = this.screen.group.length;
17432
17432
  } else {
17433
17433
  size_limit = Math.min(
@@ -20687,12 +20687,19 @@ function eval_pyson(value){
20687
20687
  var redraw = function() {
20688
20688
  for (; i < rows.length; i++) {
20689
20689
  var row = rows[i];
20690
- var record = row.record,
20691
- column = row.tree.columns[0];
20692
- if (!record.is_loaded(column.attributes.name)) {
20690
+ var record = row.record;
20691
+ var field_name;
20692
+ for (var j=0; j < row.tree.columns.length; j++) {
20693
+ var column = row.tree.columns[j];
20694
+ if (column.type == 'field') {
20695
+ field_name = column.attributes.name;
20696
+ break;
20697
+ }
20698
+ }
20699
+ if (field_name && !record.is_loaded(field_name)) {
20693
20700
  // Prefetch the first field to prevent promises in
20694
20701
  // Cell.render
20695
- record.load(column.attributes.name).done(redraw);
20702
+ record.load(field_name).done(redraw);
20696
20703
  return;
20697
20704
  } else {
20698
20705
  row.redraw(selected, expanded);
@@ -21258,7 +21265,7 @@ function eval_pyson(value){
21258
21265
 
21259
21266
  var current_record = this.tree.screen.current_record;
21260
21267
  if ((this.record != current_record) &&
21261
- !current_record.validate(
21268
+ current_record && !current_record.validate(
21262
21269
  this.tree.get_fields(), false, false, true)) {
21263
21270
  return;
21264
21271
  }