tryton-sao 7.0.12 → 7.0.13

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,9 @@
1
1
 
2
+ Version 7.0.13 - 2024-07-01
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
2
7
  Version 7.0.12 - 2024-06-15
3
8
  ---------------------------
4
9
  * Bug fixes (see mercurial logs for details)
@@ -9950,10 +9950,14 @@ img.icon {
9950
9950
  min-height: 150px;
9951
9951
  max-height: 300px;
9952
9952
  }
9953
- .form .form-text textarea,
9954
- .form .form-richtext textarea,
9955
- .form .form-text .richtext,
9956
- .form .form-richtext .richtext {
9953
+ .form .form-text .input-group,
9954
+ .form .form-richtext .input-group {
9955
+ width: 100%;
9956
+ }
9957
+ .form .form-text .input-group textarea,
9958
+ .form .form-richtext .input-group textarea,
9959
+ .form .form-text .input-group .richtext,
9960
+ .form .form-richtext .input-group .richtext {
9957
9961
  height: 100%;
9958
9962
  line-height: 2.5ex;
9959
9963
  min-height: 12.5ex;
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.0.12',
6
+ __version__: '7.0.13',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -11713,7 +11713,7 @@ var Sao = {
11713
11713
  this.refresh_resources(true);
11714
11714
  });
11715
11715
  for (const file of files) {
11716
- Sao.common.get_file_data(file, window_.add_data);
11716
+ Sao.common.get_file_data(file, window_.add_data.bind(window_));
11717
11717
  }
11718
11718
  jQuery.when.apply(jQuery, uris).then(function() {
11719
11719
  function empty(value) {
@@ -12977,9 +12977,7 @@ var Sao = {
12977
12977
  this.views = [];
12978
12978
  this.views_preload = attributes.views_preload || {};
12979
12979
  this.exclude_field = attributes.exclude_field;
12980
- this.new_group(attributes.context || {});
12981
12980
  this.current_view = null;
12982
- this.current_record = null;
12983
12981
  this.domain = attributes.domain || [];
12984
12982
  this.context_domain = attributes.context_domain;
12985
12983
  this.size_limit = null;
@@ -12991,11 +12989,14 @@ var Sao = {
12991
12989
  this._current_domain = [];
12992
12990
  this.offset = 0;
12993
12991
  this.order = this.default_order = attributes.order;
12992
+ this.readonly = this.attributes.readonly || false;
12994
12993
  var access = Sao.common.MODELACCESS.get(model_name);
12995
12994
  if (!(access.write || access.create)) {
12996
- this.attributes.readonly = true;
12995
+ this.readonly = true;
12997
12996
  }
12998
12997
  this.search_count = 0;
12998
+ this.new_group(attributes.context || {});
12999
+ this.current_record = null;
12999
13000
  this.screen_container = new Sao.ScreenContainer(
13000
13001
  attributes.tab_domain);
13001
13002
  this.breadcrumb = attributes.breadcrumb || [];
@@ -13038,7 +13039,10 @@ var Sao = {
13038
13039
  var readonly_records = this.selected_records.some(function(r) {
13039
13040
  return r.readonly;
13040
13041
  });
13041
- return this.attributes.readonly || readonly_records;
13042
+ return this.__readonly || readonly_records;
13043
+ },
13044
+ set readonly(value) {
13045
+ this.__readonly = value;
13042
13046
  },
13043
13047
  get deletable() {
13044
13048
  return this.selected_records.every(function(r) {
@@ -13411,7 +13415,7 @@ var Sao = {
13411
13415
  context = this.context;
13412
13416
  }
13413
13417
  var group = new Sao.Group(this.model, context, []);
13414
- group.readonly = this.attributes.readonly;
13418
+ group.readonly = this.__readonly;
13415
13419
  this.set_group(group);
13416
13420
  },
13417
13421
  record_modified: function(display=true) {
@@ -20888,7 +20892,7 @@ function eval_pyson(value){
20888
20892
 
20889
20893
  var tbody = this.tbody;
20890
20894
  var current_record = this.record;
20891
- if (jQuery.isEmptyObject(selected)) {
20895
+ if (jQuery.isEmptyObject(selected) && current_record) {
20892
20896
  selected = this.get_selected_paths();
20893
20897
  if (this.selection.prop('checked') &&
20894
20898
  !this.selection.prop('indeterminate')) {
@@ -20897,16 +20901,12 @@ function eval_pyson(value){
20897
20901
  selected.push([record.id]);
20898
20902
  }
20899
20903
  } else {
20900
- if (current_record) {
20901
- var current_path = current_record.get_path(this.group);
20902
- current_path = current_path.map(function(e) {
20903
- return e[1];
20904
- });
20905
- if (!Sao.common.contains(selected, current_path)) {
20906
- selected = [current_path];
20907
- }
20908
- } else if (!current_record) {
20909
- selected = [];
20904
+ var current_path = current_record.get_path(this.group);
20905
+ current_path = current_path.map(function(e) {
20906
+ return e[1];
20907
+ });
20908
+ if (!Sao.common.contains(selected, current_path)) {
20909
+ selected = [current_path];
20910
20910
  }
20911
20911
  }
20912
20912
  }
@@ -21486,7 +21486,7 @@ function eval_pyson(value){
21486
21486
  if (this.editable && new_) {
21487
21487
  td.trigger('click');
21488
21488
  }
21489
- td.find(':input,[tabindex=0]').focus();
21489
+ Sao.common.find_focusable_child(td).focus();
21490
21490
  }
21491
21491
  }
21492
21492
  };
@@ -24116,13 +24116,18 @@ function eval_pyson(value){
24116
24116
  var last_datetime = Sao.DateTime(this.end);
24117
24117
  var dtstart = this.attributes.dtstart;
24118
24118
  var dtend = this.attributes.dtend || dtstart;
24119
- return ['OR',
24119
+ return [
24120
+ [dtstart, '!=', null],
24121
+ [dtend, '!=', null],
24122
+ ['OR',
24120
24123
  ['AND', [dtstart, '>=', first_datetime],
24121
24124
  [dtstart, '<', last_datetime]],
24122
24125
  ['AND', [dtend, '>=', first_datetime],
24123
24126
  [dtend, '<', last_datetime]],
24124
24127
  ['AND', [dtstart, '<', first_datetime],
24125
- [dtend, '>', last_datetime]]];
24128
+ [dtend, '>', last_datetime]],
24129
+ ],
24130
+ ];
24126
24131
  },
24127
24132
  get_displayed_period: function(){
24128
24133
  var DatesPeriod = [];
@@ -24762,7 +24767,7 @@ function eval_pyson(value){
24762
24767
  }
24763
24768
  });
24764
24769
 
24765
- var readonly = this.screen.readonly || this.screen.group.readonly;
24770
+ var readonly = this.screen.group.readonly;
24766
24771
 
24767
24772
  this.but_ok = null;
24768
24773
  this.but_new = null;
@@ -24989,7 +24994,7 @@ function eval_pyson(value){
24989
24994
  var name = '_';
24990
24995
  var access = Sao.common.MODELACCESS.get(this.screen.model_name);
24991
24996
  var deletable = this.screen.deletable;
24992
- var readonly = this.screen.readonly || this.screen.group.readonly;
24997
+ var readonly = this.screen.group.readonly;
24993
24998
  if (position >= 1) {
24994
24999
  name = position;
24995
25000
  if (this.domain) {
@@ -24997,10 +25002,12 @@ function eval_pyson(value){
24997
25002
  }
24998
25003
  this.but_next.prop('disabled', position >= size);
24999
25004
  this.but_previous.prop('disabled', position <= 1);
25000
- if (access.delete && !readonly && deletable) {
25001
- this.but_del.prop('disabled', false);
25002
- this.but_undel.prop('disabled', false);
25003
- }
25005
+ this.but_del.prop(
25006
+ 'disabled',
25007
+ readonly ||
25008
+ !access.delete ||
25009
+ !deletable);
25010
+ this.but_undel.prop('disabled', readonly);
25004
25011
  } else {
25005
25012
  this.but_del.prop('disabled', true);
25006
25013
  this.but_undel.prop('disabled', true);
@@ -25073,7 +25080,7 @@ function eval_pyson(value){
25073
25080
  response: function(response_id) {
25074
25081
  var result;
25075
25082
  this.screen.current_view.set_value();
25076
- var readonly = this.screen.readonly || this.screen.group.readonly;
25083
+ var readonly = this.screen.group.readonly;
25077
25084
  if (~['RESPONSE_OK', 'RESPONSE_ACCEPT'].indexOf(response_id) &&
25078
25085
  !readonly &&
25079
25086
  this.screen.current_record) {
@@ -9950,10 +9950,14 @@ img.icon {
9950
9950
  min-height: 150px;
9951
9951
  max-height: 300px;
9952
9952
  }
9953
- .form .form-text textarea,
9954
- .form .form-richtext textarea,
9955
- .form .form-text .richtext,
9956
- .form .form-richtext .richtext {
9953
+ .form .form-text .input-group,
9954
+ .form .form-richtext .input-group {
9955
+ width: 100%;
9956
+ }
9957
+ .form .form-text .input-group textarea,
9958
+ .form .form-richtext .input-group textarea,
9959
+ .form .form-text .input-group .richtext,
9960
+ .form .form-richtext .input-group .richtext {
9957
9961
  height: 100%;
9958
9962
  line-height: 2.5ex;
9959
9963
  min-height: 12.5ex;