tryton-sao 6.2.6 → 6.2.7

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,6 @@
1
+ Version 6.2.7 - 2022-04-15
2
+ * Bug fixes (see mercurial logs for details)
3
+
1
4
  Version 6.2.6 - 2022-03-01
2
5
  * Bug fixes (see mercurial logs for details)
3
6
 
package/Gruntfile.js CHANGED
@@ -135,6 +135,7 @@ module.exports = function(grunt) {
135
135
  },
136
136
  qunit: {
137
137
  options: {
138
+ timeout: 300000,
138
139
  puppeteer: {
139
140
  headless: true,
140
141
  args: [
@@ -1251,7 +1251,7 @@ var Sao = {};
1251
1251
  name = data.error[1][0];
1252
1252
  msg = data.error[1][1];
1253
1253
  description = data.error[1][2];
1254
- Sao.common.userwarning.run(msg, description)
1254
+ Sao.common.userwarning.run(description, msg)
1255
1255
  .then(function(result) {
1256
1256
  if (!~['always', 'ok'].indexOf(result)) {
1257
1257
  dfd.reject();
@@ -2182,10 +2182,14 @@ var Sao = {};
2182
2182
  });
2183
2183
 
2184
2184
  Sao.PYSON.In.eval_ = function(value, context) {
2185
- if (value.v.indexOf) {
2186
- return Boolean(~value.v.indexOf(value.k));
2185
+ if (value.v) {
2186
+ if (value.v.indexOf) {
2187
+ return Boolean(~value.v.indexOf(value.k));
2188
+ } else {
2189
+ return !!value.v[value.k];
2190
+ }
2187
2191
  } else {
2188
- return !!value.v[value.k];
2192
+ return false;
2189
2193
  }
2190
2194
  };
2191
2195
  Sao.PYSON.In.init_from_object = function(obj) {
@@ -6135,8 +6139,8 @@ var Sao = {};
6135
6139
  dialog.body.append(jQuery('<div/>', {
6136
6140
  'class': 'checkbox',
6137
6141
  }).append(jQuery('<label/>')
6138
- .append(always)
6139
- .text(Sao.i18n.gettext('Always ignore this warning.')))
6142
+ .text(Sao.i18n.gettext("Always ignore this warning."))
6143
+ .prepend(always))
6140
6144
  );
6141
6145
  dialog.body.append(jQuery('<p/>')
6142
6146
  .text(Sao.i18n.gettext('Do you want to proceed?')));
@@ -7783,7 +7787,7 @@ var Sao = {};
7783
7787
  return;
7784
7788
  }
7785
7789
  }
7786
- if (this.group.prm.state() == 'pending') {
7790
+ if (async && this.group.prm.state() == 'pending') {
7787
7791
  return this.group.prm.then(function() {
7788
7792
  return this.load(name);
7789
7793
  }.bind(this));
@@ -10225,10 +10229,16 @@ var Sao = {};
10225
10229
  this.buttons[item.id].click(item, function(event) {
10226
10230
  var item = event.data;
10227
10231
  var button = this.buttons[item.id];
10228
- button.prop('disabled', true);
10232
+ // Use data instead of disabled prop because the action may
10233
+ // actually disable the button.
10234
+ if (button.data('disabled')) {
10235
+ event.preventDefault();
10236
+ return;
10237
+ }
10238
+ button.data('disabled', true);
10229
10239
  (this[item.id](this) || jQuery.when())
10230
10240
  .always(function() {
10231
- button.prop('disabled', false);
10241
+ button.data('disabled', false);
10232
10242
  });
10233
10243
  }.bind(this));
10234
10244
  };
@@ -10671,13 +10681,14 @@ var Sao = {};
10671
10681
  menu.children().length);
10672
10682
  }
10673
10683
 
10674
- if (menu_action[0] == 'print') {
10675
- if (toolbars.exports.length && toolbars.print.length) {
10684
+ if ((menu_action[0] == 'print') &&
10685
+ toolbars.exports.length) {
10686
+ button._can_be_sensitive = true;
10687
+ if (toolbars.print.length) {
10676
10688
  menu.append(jQuery('<li/>', {
10677
10689
  'role': 'separator',
10678
10690
  'class': 'divider',
10679
10691
  }));
10680
- button._can_be_sensitive = true;
10681
10692
  }
10682
10693
  toolbars.exports.forEach(function(export_) {
10683
10694
  var item = jQuery('<li/>', {
@@ -12354,11 +12365,11 @@ var Sao = {};
12354
12365
  var value = this._parse(this.format, date.val());
12355
12366
  value = this._format(this.format, value);
12356
12367
  date.val(value);
12357
- });
12368
+ }.bind(this));
12358
12369
  mousetrap.bind('=', function(e, combo) {
12359
12370
  e.preventDefault();
12360
12371
  date.val(this._format(this.format, moment()));
12361
- });
12372
+ }.bind(this));
12362
12373
 
12363
12374
  Sao.common.DATE_OPERATORS.forEach(function(operator) {
12364
12375
  mousetrap.bind(operator[0], function(e, combo) {