tryton-sao 6.0.72 → 6.0.74

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,14 @@
1
1
 
2
+ Version 6.0.74 - 2026-03-02
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 6.0.73 - 2026-02-18
8
+ ---------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 6.0.72 - 2026-02-01
3
13
  ---------------------------
4
14
  * Bug fixes (see mercurial logs for details)
@@ -1204,13 +1204,13 @@ var Sao = {};
1204
1204
  var modalZIndex = 1040;
1205
1205
  jQuery('.modal.in').each(function(index) {
1206
1206
  var $modal = jQuery(this);
1207
- modalZIndex++;
1207
+ modalZIndex += 10;
1208
1208
  $modal.css('zIndex', modalZIndex);
1209
- $modal.next('.modal-backdrop.in').addClass('hidden')
1210
- .css('zIndex', modalZIndex - 1);
1209
+ $modal.prev('.modal-backdrop.in').addClass('hidden')
1210
+ .css('zIndex', modalZIndex - 5);
1211
1211
  });
1212
1212
  jQuery('.modal.in:visible:last').focus()
1213
- .next('.modal-backdrop.in').removeClass('hidden');
1213
+ .prev('.modal-backdrop.in').removeClass('hidden');
1214
1214
  }
1215
1215
 
1216
1216
  }());
@@ -3039,16 +3039,59 @@ var Sao = {};
3039
3039
  };
3040
3040
 
3041
3041
  Sao.common.scrollIntoViewIfNeeded = function(element) {
3042
- element = element[0];
3043
- if (element) {
3044
- var rect = element.getBoundingClientRect();
3045
- if (rect.bottom > window.innerHeight) {
3046
- element.scrollIntoView(false);
3042
+ function isScrollable(el) {
3043
+ let style = getComputedStyle(el);
3044
+ return /(auto|scroll|overlay)/.test(
3045
+ style.overflow + style.overflowY + style.overflowX
3046
+ );
3047
+ }
3048
+
3049
+ function getScrollableAncestors(el) {
3050
+ let ancestors = [];
3051
+ let parent = el.parentElement;
3052
+ while (parent && parent !== document.body) {
3053
+ if (isScrollable(parent)) {
3054
+ ancestors.push(parent);
3055
+ }
3056
+ parent = parent.parentElement;
3047
3057
  }
3048
- if (rect.top < 0) {
3049
- element.scrollIntoView();
3058
+ ancestors.push(window);
3059
+ return ancestors;
3060
+ }
3061
+
3062
+ function scrollIntoViewWithin(el, container) {
3063
+ let rect = el.getBoundingClientRect();
3064
+
3065
+ if (container === window) {
3066
+ if (rect.top < 0 || rect.bottom > window.innerHeight) {
3067
+ el.scrollIntoView({
3068
+ block: 'center',
3069
+ });
3070
+ }
3071
+ } else {
3072
+ let container_rect = container.getBoundingClientRect();
3073
+ let top_ = rect.top - container_rect.top;
3074
+ let bottom = top_ + rect.height;
3075
+
3076
+ let target_top = container.scrollTop;
3077
+
3078
+ if (top_ < 0) {
3079
+ target_top += top_ - container.clientHeight / 2;
3080
+ } else if (bottom > container.clientHeight) {
3081
+ target_top += bottom - container.clientHeight / 2
3082
+ }
3083
+ container.scrollTo({
3084
+ top: Math.max(0, target_top),
3085
+ });
3050
3086
  }
3051
3087
  }
3088
+
3089
+ element.each(function() {
3090
+ let ancestors = getScrollableAncestors(this);
3091
+ for (let ancestor of ancestors) {
3092
+ scrollIntoViewWithin(this, ancestor);
3093
+ }
3094
+ });
3052
3095
  };
3053
3096
 
3054
3097
  // Handle click and Return press event
@@ -9678,11 +9721,6 @@ var Sao = {};
9678
9721
  }
9679
9722
  return result;
9680
9723
  },
9681
- get_removed_ids: function(record) {
9682
- return record._values[this.name].record_removed.map(function(r) {
9683
- return r.id;
9684
- });
9685
- },
9686
9724
  get_domain: function(record) {
9687
9725
  var domains = this.get_domains(record);
9688
9726
  var attr_domain = domains[1];
@@ -10890,6 +10928,8 @@ var Sao = {};
10890
10928
  switch_: function() {
10891
10929
  return this.modified_save().then(function() {
10892
10930
  return this.screen.switch_view();
10931
+ }.bind(this), function(result) {
10932
+ return result ? this.screen.switch_view() : null;
10893
10933
  }.bind(this));
10894
10934
  },
10895
10935
  reload: function(test_modified) {
@@ -11060,10 +11100,12 @@ var Sao = {};
11060
11100
  revision = revisions[revisions.length - 1][0];
11061
11101
  }
11062
11102
  if (revision != this.screen.context._datetime) {
11063
- this.screen.clear();
11064
11103
  // Update group context that will be propagated by
11065
11104
  // recreating new group
11066
11105
  this.screen.group._context._datetime = revision;
11106
+ // clear after updating the datetime such that the tab
11107
+ // compute already the right URL
11108
+ this.screen.clear();
11067
11109
  if (this.screen.current_view.view_type != 'form') {
11068
11110
  this.screen.search_filter(
11069
11111
  this.screen.screen_container
@@ -17513,8 +17555,6 @@ function eval_pyson(value){
17513
17555
  var context = this.field.get_search_context(this.record);
17514
17556
  domain = [domain,
17515
17557
  this.record.expr_eval(this.attributes.add_remove)];
17516
- var removed_ids = this.field.get_removed_ids(this.record);
17517
- domain = ['OR', domain, ['id', 'in', removed_ids]];
17518
17558
  var text = this.wid_text.val();
17519
17559
 
17520
17560
  var sequence = this._sequence();
@@ -17767,8 +17807,6 @@ function eval_pyson(value){
17767
17807
  var domain = this.field.get_domain(this.record);
17768
17808
  domain = [domain,
17769
17809
  this.record.expr_eval(this.attributes.add_remove)];
17770
- var removed_ids = this.field.get_removed_ids(this.record);
17771
- domain = ['OR', domain, ['id', 'in', removed_ids]];
17772
17810
  return Sao.common.update_completion(
17773
17811
  this.wid_text, this.record, this.field, model, domain);
17774
17812
  },