Tryton Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(89)

Issue 60441002: tryton-env: Fix domain inversion of child_of mixing M2O and Reference fields

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 weeks ago by nicoe
Modified:
1 week ago
Reviewers:
ced, reviewbot
Visibility:
Public.

Description

Domain inversion on Reference field does not work when using the dotted notation with a M2O field using child_of or parent_of. To solve this we correctly compute the localization of child_of leaves when using the dotted notation (which renders the inverse_leaf function useless). But we must also ensure that the selection used by reference fields restrict the choice to the right models. issue7869

Patch Set 1 #

Total comments: 18

Patch Set 2 : Add SelectionMixin support for Reference field + fixes #

Total comments: 20

Patch Set 3 : Fix remarks #

Total comments: 15

Patch Set 4 : Fix remarks #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+250 lines, -21 lines) Patch
M sao/src/common.js View 1 2 3 5 chunks +75 lines, -7 lines 4 comments Download
M sao/src/model.js View 1 2 3 3 chunks +13 lines, -4 lines 0 comments Download
M sao/tests/sao.js View 1 2 3 2 chunks +68 lines, -0 lines 0 comments Download
M tryton/tryton/common/__init__.py View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M tryton/tryton/common/domain_inversion.py View 1 2 3 5 chunks +70 lines, -0 lines 0 comments Download
M tryton/tryton/common/selection.py View 1 2 3 2 chunks +13 lines, -6 lines 0 comments Download
M tryton/tryton/gui/window/view_form/model/field.py View 1 2 3 3 chunks +9 lines, -3 lines 0 comments Download

Messages

Total messages: 17
nicoe
4 weeks ago (2018-11-20 17:01:17 UTC) #1
reviewbot
https://codereview.tryton.org/60441002/diff/1/tryton/tryton/common/__init__.py#newcode3 tryton/tryton/common/__init__.py:3: F403 'from common import *' used; unable to detect undefined names https://codereview.tryton.org/60441002/diff/1/tryton/tryton/common/__init__.py#newcode4 tryton/tryton/common/__init__.py:4: ...
4 weeks ago (2018-11-20 17:14:35 UTC) #2
ced
I would prefer that the removal of inverse_leaf is done in a separate issue. As ...
4 weeks ago (2018-11-20 17:54:32 UTC) #3
nicoe
Add SelectionMixin support for Reference field + fixes
3 weeks, 4 days ago (2018-11-23 10:06:25 UTC) #4
reviewbot
https://codereview.tryton.org/60441002/diff/20001/tryton/tryton/common/__init__.py#newcode3 tryton/tryton/common/__init__.py:3: F403 'from common import *' used; unable to detect undefined names https://codereview.tryton.org/60441002/diff/20001/tryton/tryton/common/__init__.py#newcode4 tryton/tryton/common/__init__.py:4: ...
3 weeks, 4 days ago (2018-11-23 10:13:14 UTC) #5
ced
https://codereview.tryton.org/60441002/diff/20001/tryton/tryton/common/domain_inversion.py File tryton/tryton/common/domain_inversion.py (right): https://codereview.tryton.org/60441002/diff/20001/tryton/tryton/common/domain_inversion.py#newcode170 tryton/tryton/common/domain_inversion.py:170: if domain[0].count('.') and len(domain) > 3: This part of ...
3 weeks, 1 day ago (2018-11-26 22:07:55 UTC) #6
ced
The description could be more verbose about what is happening, why it is changed, what ...
3 weeks, 1 day ago (2018-11-26 22:08:40 UTC) #7
nicoe
https://codereview.tryton.org/60441002/diff/1/sao/CHANGELOG File sao/CHANGELOG (right): https://codereview.tryton.org/60441002/diff/1/sao/CHANGELOG#newcode1 sao/CHANGELOG:1: * Fix domain inversion of child_of mixing M2O and ...
3 weeks ago (2018-11-27 16:52:57 UTC) #8
ced
https://codereview.tryton.org/60441002/diff/20001/tryton/tryton/common/selection.py File tryton/tryton/common/selection.py (left): https://codereview.tryton.org/60441002/diff/20001/tryton/tryton/common/selection.py#oldcode62 tryton/tryton/common/selection.py:62: self.filter_selection(domain, record, field) On 2018/11/27 16:52:56, nicoe wrote: > ...
3 weeks ago (2018-11-27 17:15:43 UTC) #9
nicoe
https://codereview.tryton.org/60441002/diff/20001/tryton/tryton/common/selection.py File tryton/tryton/common/selection.py (left): https://codereview.tryton.org/60441002/diff/20001/tryton/tryton/common/selection.py#oldcode62 tryton/tryton/common/selection.py:62: self.filter_selection(domain, record, field) On 2018/11/27 17:15:43, ced wrote: > ...
3 weeks ago (2018-11-27 17:46:03 UTC) #10
nicoe
Fix remarks
3 weeks ago (2018-11-27 17:46:53 UTC) #11
reviewbot
https://codereview.tryton.org/60441002/diff/40001/tryton/tryton/common/__init__.py#newcode3 tryton/tryton/common/__init__.py:3: F403 'from common import *' used; unable to detect undefined names https://codereview.tryton.org/60441002/diff/40001/tryton/tryton/common/__init__.py#newcode4 tryton/tryton/common/__init__.py:4: ...
3 weeks ago (2018-11-27 17:52:06 UTC) #12
ced
https://codereview.tryton.org/60441002/diff/40001/sao/src/common.js File sao/src/common.js (right): https://codereview.tryton.org/60441002/diff/40001/sao/src/common.js#newcode2178 sao/src/common.js:2178: prepare_reference_domain: function(domain, field_name) { field_name should be named reference ...
1 week, 6 days ago (2018-12-05 09:39:36 UTC) #13
nicoe
Fix remarks
1 week, 4 days ago (2018-12-07 16:26:29 UTC) #14
nicoe
https://codereview.tryton.org/60441002/diff/40001/sao/src/common.js File sao/src/common.js (right): https://codereview.tryton.org/60441002/diff/40001/sao/src/common.js#newcode2178 sao/src/common.js:2178: prepare_reference_domain: function(domain, field_name) { On 2018/12/05 09:39:36, ced wrote: ...
1 week, 4 days ago (2018-12-07 16:26:41 UTC) #15
reviewbot
https://codereview.tryton.org/60441002/diff/60001/tryton/tryton/common/__init__.py#newcode3 tryton/tryton/common/__init__.py:3: F403 'from common import *' used; unable to detect undefined names https://codereview.tryton.org/60441002/diff/60001/tryton/tryton/common/__init__.py#newcode4 tryton/tryton/common/__init__.py:4: ...
1 week, 4 days ago (2018-12-07 16:50:33 UTC) #16
ced
1 week ago (2018-12-11 10:05:08 UTC) #17
https://codereview.tryton.org/60441002/diff/60001/sao/src/common.js
File sao/src/common.js (right):

https://codereview.tryton.org/60441002/diff/60001/sao/src/common.js#newcode2263
sao/src/common.js:2263: extract_reference_models: function(domain, field_name) {
Idem both reference function should be together.

https://codereview.tryton.org/60441002/diff/60001/sao/src/common.js#newcode2280
sao/src/common.js:2280: m = new_models[i];
could be declared here.

https://codereview.tryton.org/60441002/diff/60001/sao/src/common.js#newcode2280
sao/src/common.js:2280: m = new_models[i];
m is a little too short, better "model"

https://codereview.tryton.org/60441002/diff/60001/sao/src/common.js#newcode2281
sao/src/common.js:2281: if (!models.includes(new_models[i])) {
should use 'm'
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 0147766