tryton-sao 6.2.4 → 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,12 @@
1
+ Version 6.2.7 - 2022-04-15
2
+ * Bug fixes (see mercurial logs for details)
3
+
4
+ Version 6.2.6 - 2022-03-01
5
+ * Bug fixes (see mercurial logs for details)
6
+
7
+ Version 6.2.5 - 2022-02-16
8
+ * Bug fixes (see mercurial logs for details)
9
+
1
10
  Version 6.2.4 - 2022-02-01
2
11
  * Bug fixes (see mercurial logs for details)
3
12
 
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));
@@ -9185,27 +9189,16 @@ var Sao = {};
9185
9189
  set: function(record, value) {
9186
9190
  var rec_name = (
9187
9191
  record._values[this.name + '.'] || {}).rec_name || '';
9188
- var store_rec_name = function(rec_name) {
9189
- Sao.setdefault(
9190
- record._values, this.name + '.', {})
9191
- .rec_name = rec_name[0].rec_name;
9192
- };
9193
9192
  if (!rec_name && (value >= 0) && (value !== null)) {
9194
9193
  var model_name = record.model.fields[this.name].description
9195
9194
  .relation;
9196
- Sao.rpc({
9195
+ rec_name = Sao.rpc({
9197
9196
  'method': 'model.' + model_name + '.read',
9198
9197
  'params': [[value], ['rec_name'], record.get_context()]
9199
- }, record.model.session).done(store_rec_name.bind(this)).done(
9200
- function() {
9201
- record.group.root_group.screens.forEach(
9202
- function(screen) {
9203
- screen.display();
9204
- });
9205
- });
9206
- } else {
9207
- store_rec_name.call(this, [{'rec_name': rec_name}]);
9198
+ }, record.model.session, false)[0].rec_name;
9208
9199
  }
9200
+ Sao.setdefault(
9201
+ record._values, this.name + '.', {}).rec_name = rec_name;
9209
9202
  record._values[this.name] = value;
9210
9203
  },
9211
9204
  set_client: function(record, value, force_change) {
@@ -9756,26 +9749,21 @@ var Sao = {};
9756
9749
  }
9757
9750
  var rec_name = (
9758
9751
  record._values[this.name + '.'] || {}).rec_name || '';
9759
- var store_rec_name = function(rec_name) {
9760
- Sao.setdefault(
9761
- record._values, this.name + '.', {}).rec_name = rec_name;
9762
- }.bind(this);
9763
9752
  if (ref_model && ref_id !== null && ref_id >= 0) {
9764
9753
  if (!rec_name && ref_id >= 0) {
9765
- Sao.rpc({
9754
+ rec_name = Sao.rpc({
9766
9755
  'method': 'model.' + ref_model + '.read',
9767
9756
  'params': [[ref_id], ['rec_name'], record.get_context()]
9768
- }, record.model.session).done(function(result) {
9769
- store_rec_name(result[0].rec_name);
9770
- });
9757
+ }, record.model.session, false)[0].rec_name;
9771
9758
  }
9772
9759
  } else if (ref_model) {
9773
9760
  rec_name = '';
9774
9761
  } else {
9775
9762
  rec_name = ref_id;
9776
9763
  }
9764
+ Sao.setdefault(
9765
+ record._values, this.name + '.', {}).rec_name = rec_name;
9777
9766
  record._values[this.name] = [ref_model, ref_id];
9778
- store_rec_name(rec_name);
9779
9767
  },
9780
9768
  get_on_change_value: function(record) {
9781
9769
  if ((record.group.parent_name == this.name) &&
@@ -10241,10 +10229,16 @@ var Sao = {};
10241
10229
  this.buttons[item.id].click(item, function(event) {
10242
10230
  var item = event.data;
10243
10231
  var button = this.buttons[item.id];
10244
- 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);
10245
10239
  (this[item.id](this) || jQuery.when())
10246
10240
  .always(function() {
10247
- button.prop('disabled', false);
10241
+ button.data('disabled', false);
10248
10242
  });
10249
10243
  }.bind(this));
10250
10244
  };
@@ -10687,13 +10681,14 @@ var Sao = {};
10687
10681
  menu.children().length);
10688
10682
  }
10689
10683
 
10690
- if (menu_action[0] == 'print') {
10691
- 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) {
10692
10688
  menu.append(jQuery('<li/>', {
10693
10689
  'role': 'separator',
10694
10690
  'class': 'divider',
10695
10691
  }));
10696
- button._can_be_sensitive = true;
10697
10692
  }
10698
10693
  toolbars.exports.forEach(function(export_) {
10699
10694
  var item = jQuery('<li/>', {
@@ -12370,11 +12365,11 @@ var Sao = {};
12370
12365
  var value = this._parse(this.format, date.val());
12371
12366
  value = this._format(this.format, value);
12372
12367
  date.val(value);
12373
- });
12368
+ }.bind(this));
12374
12369
  mousetrap.bind('=', function(e, combo) {
12375
12370
  e.preventDefault();
12376
12371
  date.val(this._format(this.format, moment()));
12377
- });
12372
+ }.bind(this));
12378
12373
 
12379
12374
  Sao.common.DATE_OPERATORS.forEach(function(operator) {
12380
12375
  mousetrap.bind(operator[0], function(e, combo) {
@@ -13652,6 +13647,7 @@ var Sao = {};
13652
13647
  return record.model.execute(attributes.name, [values],
13653
13648
  this.context).then(function(changes) {
13654
13649
  record.set_on_change(changes);
13650
+ record.group.changed();
13655
13651
  record.group.root_group.screens.forEach(
13656
13652
  function(screen) {
13657
13653
  screen.display();
@@ -15037,6 +15033,7 @@ function eval_pyson(value){
15037
15033
  this.el = jQuery('<button/>', {
15038
15034
  'class': this.class_ + ' btn btn-link',
15039
15035
  'name': attributes.name,
15036
+ 'type': 'button',
15040
15037
  });
15041
15038
  if (attributes.icon) {
15042
15039
  var img = jQuery('<img/>', {
@@ -21455,9 +21452,13 @@ function eval_pyson(value){
21455
21452
  }.bind(this));
21456
21453
  }
21457
21454
  } else {
21458
- this._get_column_td(next_column, next_row)
21459
- .trigger('click')
21460
- .find(':input,[tabindex=0]').focus();
21455
+ prm.then(function() {
21456
+ this._get_column_td(
21457
+ next_column, next_row)
21458
+ .trigger('click')
21459
+ .find(':input,[tabindex=0]')
21460
+ .focus();
21461
+ }.bind(this));
21461
21462
  }
21462
21463
  }
21463
21464
  }.bind(this));