tryton-sao 6.2.1 → 6.2.5

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,15 @@
1
+ Version 6.2.5 - 2022-02-16
2
+ * Bug fixes (see mercurial logs for details)
3
+
4
+ Version 6.2.4 - 2022-02-01
5
+ * Bug fixes (see mercurial logs for details)
6
+
7
+ Version 6.2.3 - 2022-01-15
8
+ * Bug fixes (see mercurial logs for details)
9
+
10
+ Version 6.2.2 - 2022-01-01
11
+ * Bug fixes (see mercurial logs for details)
12
+
1
13
  Version 6.2.1 - 2021-12-03
2
14
  * Bug fixes (see mercurial logs for details)
3
15
 
package/COPYRIGHT CHANGED
@@ -1,7 +1,7 @@
1
- Copyright (C) 2012-2021 Nicolas Évrard.
2
- Copyright (C) 2012-2021 Cédric Krier.
1
+ Copyright (C) 2012-2022 Nicolas Évrard.
2
+ Copyright (C) 2012-2022 Cédric Krier.
3
3
  Copyright (C) 2012-2014 Bertrand Chenal.
4
- Copyright (C) 2012-2021 B2CK SPRL.
4
+ Copyright (C) 2012-2022 B2CK SPRL.
5
5
  Copyright (C) 2019 Jitbit.
6
6
  Copyright (C) 2013 Thomas Park
7
7
  Copyright (C) 2020-2021 Maxime Richez
@@ -8687,6 +8687,9 @@ html[theme="default"] .input-group-sm > .form-control,
8687
8687
  html[theme="default"] .input-group-sm > .input-group-addon {
8688
8688
  padding: 0 5px;
8689
8689
  }
8690
+ html[theme="default"] .has-feedback .form-control {
8691
+ padding-right: 42.5px;
8692
+ }
8690
8693
  html[theme="default"] .input-group-addon {
8691
8694
  background-color: transparent;
8692
8695
  border: transparent;
@@ -9165,6 +9168,9 @@ button {
9165
9168
  overflow-y: hidden;
9166
9169
  text-overflow: ellipsis;
9167
9170
  }
9171
+ .input-group > .form-control-feedback {
9172
+ z-index: 3;
9173
+ }
9168
9174
  .navbar-inverse .close {
9169
9175
  color: #6dd1d4;
9170
9176
  }
@@ -9389,7 +9395,7 @@ button.list-group-item-selected.active:focus {
9389
9395
  .table-hover > tbody > tr.danger:hover > th {
9390
9396
  background-color: #ebcccc;
9391
9397
  }
9392
- html.accesskey *[accesskey] + span[data-accesskey]:after,
9398
+ html.accesskey *[accesskey] ~ span[data-accesskey]:after,
9393
9399
  html.accesskey *[accesskey]:after {
9394
9400
  background-color: #71bdc1;
9395
9401
  color: #fff;
@@ -9403,19 +9409,19 @@ html.accesskey *[accesskey]:after {
9403
9409
  html.accesskey input[accesskey][type="checkbox"]:after {
9404
9410
  background-color: initial;
9405
9411
  }
9406
- html.accesskey *[accesskey] + span[data-accesskey] {
9412
+ html.accesskey *[accesskey] ~ span[data-accesskey] {
9407
9413
  float: right;
9408
9414
  position: relative;
9409
9415
  }
9410
- html.accesskey *[accesskey] + span[data-accesskey]:after {
9416
+ html.accesskey *[accesskey] ~ span[data-accesskey]:after {
9411
9417
  content: attr(data-accesskey);
9412
9418
  }
9413
9419
  html.accesskey *[accesskey]:after {
9414
9420
  content: attr(accesskey);
9415
9421
  }
9416
- html.accesskey input[accesskey][type="checkbox"] + span[data-accesskey],
9417
- html.accesskey input[accesskey][type="checkbox"] + span[data-accesskey],
9418
- html.accesskey select[accesskey] + span[data-accesskey] {
9422
+ html.accesskey input[accesskey][type="checkbox"] ~ span[data-accesskey],
9423
+ html.accesskey input[accesskey][type="checkbox"] ~ span[data-accesskey],
9424
+ html.accesskey select[accesskey] ~ span[data-accesskey] {
9419
9425
  bottom: 1em;
9420
9426
  }
9421
9427
  .tab-form nav.toolbar,
@@ -1673,13 +1673,13 @@ var Sao = {};
1673
1673
 
1674
1674
  Sao.PYSON.Eval.eval_ = function(value, context) {
1675
1675
  var idx = value.v.indexOf('.');
1676
- if (idx >= 0) {
1676
+ if ((idx >= 0) && !(value.v in context)) {
1677
1677
  return Sao.PYSON.Eval.eval_({
1678
1678
  'v': value.v.substring(idx + 1),
1679
1679
  'd': value.d,
1680
1680
  }, context[value.v.substring(0, idx)] || {});
1681
1681
  }
1682
- if (value.v in context) {
1682
+ if ((value.v in context) && (context[value.v] !== undefined)) {
1683
1683
  return context[value.v];
1684
1684
  } else {
1685
1685
  return value.d;
@@ -8534,7 +8534,11 @@ var Sao = {};
8534
8534
  Object.keys(this._values).reduce(function(values, name) {
8535
8535
  var field = this.model.fields[name];
8536
8536
  if (field) {
8537
- values[name] = field.get(this);
8537
+ if (field instanceof Sao.field.Binary) {
8538
+ values[name] = field.get_size(this);
8539
+ } else {
8540
+ values[name] = field.get(this);
8541
+ }
8538
8542
  }
8539
8543
  return values;
8540
8544
  }.bind(this), {}));
@@ -8667,12 +8671,14 @@ var Sao = {};
8667
8671
  }
8668
8672
  return value;
8669
8673
  },
8674
+ _has_changed: function(previous, value) {
8675
+ // Use stringify to compare object instance like Number for Decimal
8676
+ return JSON.stringify(previous) != JSON.stringify(value);
8677
+ },
8670
8678
  set_client: function(record, value, force_change) {
8671
8679
  var previous_value = this.get(record);
8672
8680
  this.set(record, value);
8673
- // Use stringify to compare object instance like Number for Decimal
8674
- if (JSON.stringify(previous_value) !=
8675
- JSON.stringify(this.get(record))) {
8681
+ if (this._has_changed(previous_value, this.get(record))) {
8676
8682
  record._changed[this.name] = true;
8677
8683
  this.changed(record);
8678
8684
  record.validate(null, true, false, true);
@@ -9831,6 +9837,9 @@ var Sao = {};
9831
9837
 
9832
9838
  Sao.field.Binary = Sao.class_(Sao.field.Field, {
9833
9839
  _default: null,
9840
+ _has_changed: function(previous, value) {
9841
+ return previous != value;
9842
+ },
9834
9843
  get_size: function(record) {
9835
9844
  var data = record._values[this.name] || 0;
9836
9845
  if (data instanceof Uint8Array) {
@@ -11462,7 +11471,9 @@ var Sao = {};
11462
11471
  'disabled', this.screen.readonly);
11463
11472
 
11464
11473
  var msg = name + ' / ' + data[1];
11465
- if ((data[1] < data[2]) && (data[2] > this.screen.limit)) {
11474
+ if ((data[1] < data[2]) &&
11475
+ this.screen.limit !== null &&
11476
+ (data[2] > this.screen.limit)) {
11466
11477
  msg += Sao.i18n.gettext(' of ') + data[2];
11467
11478
  }
11468
11479
  this.status_label.text(msg).attr('title', msg);
@@ -12298,7 +12309,7 @@ var Sao = {};
12298
12309
  init: function(format, id) {
12299
12310
  this.format = format;
12300
12311
  Sao.ScreenContainer.BetweenDates._super.init.call(this, id);
12301
- this.from.on('dp.change', this._from_changed.bind(this));
12312
+ this.from.change(this._from_changed.bind(this));
12302
12313
  },
12303
12314
  _get_value: function(entry, value) {
12304
12315
  return entry.find('input[type=text]').val();
@@ -13397,7 +13408,9 @@ var Sao = {};
13397
13408
  if (props.selection instanceof Array) {
13398
13409
  continue;
13399
13410
  }
13411
+ props = jQuery.extend({}, props);
13400
13412
  props.selection = this.get_selection(props);
13413
+ fields[name] = props;
13401
13414
  }
13402
13415
 
13403
13416
  if ('arch' in view_tree) {
@@ -13639,6 +13652,7 @@ var Sao = {};
13639
13652
  return record.model.execute(attributes.name, [values],
13640
13653
  this.context).then(function(changes) {
13641
13654
  record.set_on_change(changes);
13655
+ record.group.changed();
13642
13656
  record.group.root_group.screens.forEach(
13643
13657
  function(screen) {
13644
13658
  screen.display();
@@ -14181,7 +14195,7 @@ function eval_pyson(value){
14181
14195
  widget.labelled.get(0).tagName)) {
14182
14196
  jQuery('<span/>', {
14183
14197
  'data-accesskey': accesskey,
14184
- }).insertAfter(widget.labelled);
14198
+ }).appendTo(widget.labelled.parent());
14185
14199
  }
14186
14200
  label.label_el.attr('for', widget.labelled.attr('id'));
14187
14201
  }
@@ -14997,14 +15011,12 @@ function eval_pyson(value){
14997
15011
  'aria-controls': this.collapsible.attr('id'),
14998
15012
  'aria-expanded': attributes.expandable == '1',
14999
15013
  }).appendTo(title);
15000
- link.append(jQuery('<div/>', {
15001
- 'class': 'btn btn-sm',
15002
- }).append(jQuery('<span/>', {
15003
- 'class': 'caret',
15004
- })));
15005
15014
  if (attributes.string) {
15006
15015
  link.text(attributes.string);
15007
15016
  }
15017
+ link.append(jQuery('<span/>', {
15018
+ 'class': 'caret',
15019
+ }));
15008
15020
  },
15009
15021
  add: function(widget) {
15010
15022
  this.body.empty();
@@ -15026,6 +15038,7 @@ function eval_pyson(value){
15026
15038
  this.el = jQuery('<button/>', {
15027
15039
  'class': this.class_ + ' btn btn-link',
15028
15040
  'name': attributes.name,
15041
+ 'type': 'button',
15029
15042
  });
15030
15043
  if (attributes.icon) {
15031
15044
  var img = jQuery('<img/>', {
@@ -19589,6 +19602,23 @@ function eval_pyson(value){
19589
19602
  this.table.append(this.tfoot);
19590
19603
  }
19591
19604
 
19605
+ if (this.children_field) {
19606
+ this.expander = jQuery('<span/>', {
19607
+ 'class': 'expander',
19608
+ }).append(jQuery('<img/>', {
19609
+ 'tabindex': 0,
19610
+ 'class': 'icon',
19611
+ }));
19612
+ this.update_expander('more');
19613
+ this.expander.on('click keypress',
19614
+ Sao.common.click_press(this.unfold.bind(this)));
19615
+ Sao.common.ICONFACTORY.get_icon_url(
19616
+ 'tryton-unfold-' + this.expander.action)
19617
+ .then(function(url) {
19618
+ this.expander.children().attr('src', url);
19619
+ }.bind(this));
19620
+ }
19621
+
19592
19622
  this.columns.forEach(function(column, i) {
19593
19623
  col = jQuery('<col/>', {
19594
19624
  'class': column.attributes.widget,
@@ -19596,23 +19626,6 @@ function eval_pyson(value){
19596
19626
  th = jQuery('<th/>', {
19597
19627
  'class': column.attributes.widget,
19598
19628
  });
19599
- if ((i === 0) && this.children_field) {
19600
- this.expander = jQuery('<img/>', {
19601
- 'tabindex': 0,
19602
- 'class': 'icon',
19603
- });
19604
- this.update_expander('more');
19605
- this.expander.on('click keypress',
19606
- Sao.common.click_press(this.unfold.bind(this)));
19607
- Sao.common.ICONFACTORY.get_icon_url(
19608
- 'tryton-unfold-' + this.expander.action)
19609
- .then(function(url) {
19610
- this.expander.attr('src', url);
19611
- }.bind(this));
19612
- th.append(jQuery('<span>', {
19613
- 'class': 'expander',
19614
- }).append(this.expander));
19615
- }
19616
19629
  var label = jQuery('<label/>')
19617
19630
  .text(column.attributes.string)
19618
19631
  .attr('title', column.attributes.string);
@@ -19703,7 +19716,7 @@ function eval_pyson(value){
19703
19716
  Sao.common.ICONFACTORY.get_icon_url(
19704
19717
  'tryton-unfold-' + this.expander.action)
19705
19718
  .then(function(url) {
19706
- this.expander.attr('src', url);
19719
+ this.expander.children().attr('src', url);
19707
19720
  }.bind(this));
19708
19721
  if (jQuery.isEmptyObject(this.selected_records)) {
19709
19722
  this.expander.css('visibility', 'hidden');
@@ -20145,8 +20158,8 @@ function eval_pyson(value){
20145
20158
  !column.col.hasClass('selection-state') &&
20146
20159
  !column.col.hasClass('favorite')) {
20147
20160
  var width, c_width;
20148
- if (column.width) {
20149
- width = c_width = column.width;
20161
+ if (column.attributes.width) {
20162
+ width = c_width = column.attributes.width;
20150
20163
  min_width.push(width + 'px');
20151
20164
  } else {
20152
20165
  width = {
@@ -20173,6 +20186,19 @@ function eval_pyson(value){
20173
20186
  column.col.show();
20174
20187
  }
20175
20188
  }.bind(this));
20189
+ if (this.children_field) {
20190
+ this.columns.every(function(column) {
20191
+ if (column.col.hasClass('draggable-handle') ||
20192
+ column.header.hasClass('invisible')) {
20193
+ return true;
20194
+ } else {
20195
+ if (this.expander.parent()[0] !== column.header[0]) {
20196
+ column.header.prepend(this.expander);
20197
+ }
20198
+ return false;
20199
+ }
20200
+ }.bind(this));
20201
+ }
20176
20202
  this.table.css('min-width', 'calc(' + min_width.join(' + ') + ')');
20177
20203
  this.scrollbar.css('min-width', this.table.css('min-width'));
20178
20204
  this.tbody.find('tr.more-row > td').attr(
@@ -20768,6 +20794,18 @@ function eval_pyson(value){
20768
20794
  this.select_column(event_.data.index);
20769
20795
  }.bind(this);
20770
20796
 
20797
+ if (this.children_field) {
20798
+ this.expander = jQuery('<span/>', {
20799
+ 'class': 'expander',
20800
+ }).append('<img/>', {
20801
+ 'tabindex': 0,
20802
+ 'class': 'icon',
20803
+ });
20804
+ this.expander.children().html('&nbsp;');
20805
+ this.expander.on('click keypress',
20806
+ Sao.common.click_press(this.toggle_row.bind(this)));
20807
+ }
20808
+
20771
20809
  for (var i = 0; i < this.tree.columns.length; i++) {
20772
20810
  var column = this.tree.columns[i];
20773
20811
  if (column instanceof Sao.View.Tree.ButtonColumn) {
@@ -20795,18 +20833,6 @@ function eval_pyson(value){
20795
20833
  'class': 'cell',
20796
20834
  });
20797
20835
  td.append(cell);
20798
- if ((i === 0) && this.children_field) {
20799
- this.expander = jQuery('<img/>', {
20800
- 'tabindex': 0,
20801
- 'class': 'icon',
20802
- });
20803
- this.expander.html('&nbsp;');
20804
- this.expander.on('click keypress',
20805
- Sao.common.click_press(this.toggle_row.bind(this)));
20806
- cell.append(jQuery('<span/>', {
20807
- 'class': 'expander'
20808
- }).append(this.expander));
20809
- }
20810
20836
  var j;
20811
20837
  if (column.prefixes) {
20812
20838
  for (j = 0; j < column.prefixes.length; j++) {
@@ -20919,6 +20945,21 @@ function eval_pyson(value){
20919
20945
  }
20920
20946
  }
20921
20947
  }
20948
+ if (this.children_field) {
20949
+ this.tree.columns.every(function(column, i) {
20950
+ if (column.col.hasClass('draggable-handle') ||
20951
+ column.header.hasClass('invisible')) {
20952
+ return true;
20953
+ } else {
20954
+ var td = this._get_column_td(i);
20955
+ var cell = td.find('.cell');
20956
+ if (this.expander.parent()[0] !== cell[0]) {
20957
+ cell.prepend(this.expander);
20958
+ }
20959
+ return false;
20960
+ }
20961
+ }.bind(this));
20962
+ }
20922
20963
  this._drawed_record = this.record.identity;
20923
20964
 
20924
20965
  var row_id_path = this.get_id_path();
@@ -20929,7 +20970,7 @@ function eval_pyson(value){
20929
20970
  if (Sao.i18n.rtl) {
20930
20971
  margin = 'margin-right';
20931
20972
  }
20932
- this.expander.css(margin, (depth - 1) + 'em');
20973
+ this.expander.children().css(margin, (depth - 1) + 'em');
20933
20974
 
20934
20975
  var update_expander = function() {
20935
20976
  var length = this.record.field_get_client(
@@ -20993,7 +21034,7 @@ function eval_pyson(value){
20993
21034
  }
20994
21035
  Sao.common.ICONFACTORY.get_icon_url(icon)
20995
21036
  .then(function(url) {
20996
- this.expander.attr('src', url);
21037
+ this.expander.children().attr('src', url);
20997
21038
  }.bind(this));
20998
21039
  },
20999
21040
  collapse_children: function() {
@@ -23245,7 +23286,7 @@ function eval_pyson(value){
23245
23286
  var ctx = {
23246
23287
  active_model: data.model || null,
23247
23288
  active_id: data.id || null,
23248
- active_ids: data.ids
23289
+ active_ids: data.ids || [],
23249
23290
  };
23250
23291
  ctx = jQuery.extend(ctx, session.context);
23251
23292
  ctx._user = session.user_id;
@@ -8687,6 +8687,9 @@ html[theme="default"] .input-group-sm > .form-control,
8687
8687
  html[theme="default"] .input-group-sm > .input-group-addon {
8688
8688
  padding: 0 5px;
8689
8689
  }
8690
+ html[theme="default"] .has-feedback .form-control {
8691
+ padding-right: 42.5px;
8692
+ }
8690
8693
  html[theme="default"] .input-group-addon {
8691
8694
  background-color: transparent;
8692
8695
  border: transparent;
@@ -9165,6 +9168,9 @@ button {
9165
9168
  overflow-y: hidden;
9166
9169
  text-overflow: ellipsis;
9167
9170
  }
9171
+ .input-group > .form-control-feedback {
9172
+ z-index: 3;
9173
+ }
9168
9174
  .navbar-inverse .close {
9169
9175
  color: #6dd1d4;
9170
9176
  }
@@ -9389,7 +9395,7 @@ button.list-group-item-selected.active:focus {
9389
9395
  .table-hover > tbody > tr.danger:hover > th {
9390
9396
  background-color: #ebcccc;
9391
9397
  }
9392
- html.accesskey *[accesskey] + span[data-accesskey]:after,
9398
+ html.accesskey *[accesskey] ~ span[data-accesskey]:after,
9393
9399
  html.accesskey *[accesskey]:after {
9394
9400
  background-color: #71bdc1;
9395
9401
  color: #fff;
@@ -9403,19 +9409,19 @@ html.accesskey *[accesskey]:after {
9403
9409
  html.accesskey input[accesskey][type="checkbox"]:after {
9404
9410
  background-color: initial;
9405
9411
  }
9406
- html.accesskey *[accesskey] + span[data-accesskey] {
9412
+ html.accesskey *[accesskey] ~ span[data-accesskey] {
9407
9413
  float: right;
9408
9414
  position: relative;
9409
9415
  }
9410
- html.accesskey *[accesskey] + span[data-accesskey]:after {
9416
+ html.accesskey *[accesskey] ~ span[data-accesskey]:after {
9411
9417
  content: attr(data-accesskey);
9412
9418
  }
9413
9419
  html.accesskey *[accesskey]:after {
9414
9420
  content: attr(accesskey);
9415
9421
  }
9416
- html.accesskey input[accesskey][type="checkbox"] + span[data-accesskey],
9417
- html.accesskey input[accesskey][type="checkbox"] + span[data-accesskey],
9418
- html.accesskey select[accesskey] + span[data-accesskey] {
9422
+ html.accesskey input[accesskey][type="checkbox"] ~ span[data-accesskey],
9423
+ html.accesskey input[accesskey][type="checkbox"] ~ span[data-accesskey],
9424
+ html.accesskey select[accesskey] ~ span[data-accesskey] {
9419
9425
  bottom: 1em;
9420
9426
  }
9421
9427
  .tab-form nav.toolbar,