Tryton - Issues

 

Issue7869

Title Domain inversion for child_of does not work when the domain use a reference field.
Priority bug Status resolved
Superseder Nosy List ced, nicoe, reviewbot, roundup-bot
Type behavior Components sao, tryton
Assigned To nicoe Keywords review
Reviews 60441002
View: 60441002

Created on 2018-11-19.19:13:44 by nicoe, last changed by roundup-bot.

Messages
New changeset f5b886023a10 by Nicolas Évrard in branch '5.0':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/tryton/rev/f5b886023a10

New changeset e77b88fe6393 by Nicolas Évrard in branch '4.8':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/tryton/rev/e77b88fe6393

New changeset 6f6696faf11f by Nicolas Évrard in branch '4.6':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/tryton/rev/6f6696faf11f

New changeset 51d941caacfd by Nicolas Évrard in branch '4.4':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/tryton/rev/51d941caacfd

New changeset c1e5655f02d9 by Nicolas Évrard in branch '4.2':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/tryton/rev/c1e5655f02d9
New changeset 1e0aeb0854b5 by Nicolas Évrard in branch '5.0':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/sao/rev/1e0aeb0854b5

New changeset 0a6b11e441ba by Cédric Krier in branch '5.0':
Replace Array.includes by ~Array.indexOf
https://hg.tryton.org/sao/rev/0a6b11e441ba

New changeset 1226c9bd3976 by Nicolas Évrard in branch '4.8':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/sao/rev/1226c9bd3976

New changeset 915611c29b72 by Cédric Krier in branch '4.8':
Replace Array.includes by ~Array.indexOf
https://hg.tryton.org/sao/rev/915611c29b72

New changeset 71661984d777 by Nicolas Évrard in branch '4.6':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/sao/rev/71661984d777

New changeset 91c40fb2d2c8 by Cédric Krier in branch '4.6':
Replace Array.includes by ~Array.indexOf
https://hg.tryton.org/sao/rev/91c40fb2d2c8

New changeset 358b0841e2c4 by Nicolas Évrard in branch '4.4':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/sao/rev/358b0841e2c4

New changeset efcfa0428588 by Cédric Krier in branch '4.4':
Replace Array.includes by ~Array.indexOf
https://hg.tryton.org/sao/rev/efcfa0428588

New changeset 300ee33f86e1 by Nicolas Évrard in branch '4.2':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/sao/rev/300ee33f86e1

New changeset 67a35c93d3de by Cédric Krier in branch '4.2':
Replace Array.includes by ~Array.indexOf
https://hg.tryton.org/sao/rev/67a35c93d3de
New changeset 4cfecba15a5e by Cédric Krier in branch 'default':
Replace Array.includes by ~Array.indexOf
https://hg.tryton.org/tryton-env/rev/4cfecba15a5e
New changeset 01cdf2301b04 by Cédric Krier in branch 'default':
Replace Array.includes by ~Array.indexOf
https://hg.tryton.org/sao/rev/01cdf2301b04
msg45429 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-12-21.13:28:40
Array.includes can not be used as it is not supported by IE nor phanthomjs. More over as it is a fix that should be back-ported, I do not think it is right to use polyfill.
New changeset 88ea15d0dead by Nicolas ?vrard in branch 'default':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/tryton-env/rev/88ea15d0dead
New changeset 065511721170 by Nicolas ?vrard in branch 'default':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/tryton/rev/065511721170
New changeset 95501e406c46 by Nicolas ?vrard in branch 'default':
Fix domain inversion of child_of mixing M2O and Reference fields
https://hg.tryton.org/sao/rev/95501e406c46
review60441002 updated at https://codereview.tryton.org/60441002/#ps80001
review60441002 updated at https://codereview.tryton.org/60441002/#ps60001
review60441002 updated at https://codereview.tryton.org/60441002/#ps40001
review60441002 updated at https://codereview.tryton.org/60441002/#ps20001
New review60441002 at https://codereview.tryton.org/60441002/#ps1
msg44929 (view) Author: [hidden] (nicoe) (Tryton committer) (Tryton translator) Date: 2018-11-19.19:13:43
We stumbled upon a domain on timesheet.line writen like this:

[[u'work.origin.parent', u'child_of', [663], u'project.work']]

When the domain inversion for the field 'work' is triggered it results in the following domain:

[[u'project.work', u'child_of', [663]]]

Which can not work.

The solution is to check in inverse_leaf the number of dots in case of inversion of a child_of.
If there's more than one dot than we just need to remove the local part otherwise we keep it.

Reference field must also be modified to support to take into account the child_of case and prepare the domain in domain_get.
History
Date User Action Args
2018-12-30 19:10:57roundup-botsetmessages: + msg45634
2018-12-30 19:10:31roundup-botsetmessages: + msg45633
2018-12-21 19:55:29roundup-botsetmessages: + msg45450
2018-12-21 19:55:26roundup-botsetstatus: in-progress -> resolved
messages: + msg45449
2018-12-21 13:28:41cedsetstatus: resolved -> in-progress
nosy: + ced
messages: + msg45429
2018-12-20 18:46:35roundup-botsetmessages: + msg45417
2018-12-20 18:46:33roundup-botsetmessages: + msg45416
2018-12-20 18:46:30roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg45415
2018-12-19 19:08:25reviewbotsetmessages: + msg45401
2018-12-07 17:47:24reviewbotsetmessages: + msg45195

Showing 10 items. Show all history (warning: this could be VERY long)