Tryton - Issues

 

Issue4005

Title Add filter to xxx2Many fields
Priority feature Status resolved
Superseder Nosy List ced, pokoli, reviewbot, roundup-bot
Type feature request Components trytond
Assigned To pokoli Keywords review
Reviews 32001002
View: 32001002

Created on 2014-06-17.12:45:29 by pokoli, last changed by roundup-bot.

Messages
New changeset b16a085824ce by Sergi Almacellas Abellana in branch 'default':
Add filter to xxx2Many fields
http://hg.tryton.org/trytond/rev/b16a085824ce
review32001002 updated at https://codereview.tryton.org/32001002/#ps320001
review32001002 updated at https://codereview.tryton.org/32001002/#ps300001
review32001002 updated at https://codereview.tryton.org/32001002/#ps280001
review32001002 updated at https://codereview.tryton.org/32001002/#ps260001
review32001002 updated at https://codereview.tryton.org/32001002/#ps220001
review32001002 updated at https://codereview.tryton.org/32001002/#ps200001
review32001002 updated at https://codereview.tryton.org/32001002/#ps180001
review32001002 updated at https://codereview.tryton.org/32001002/#ps120001
review32001002 updated at https://codereview.tryton.org/32001002/#ps100001
msg31620 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-02-01.10:51:34
Ok, lets keep it simple and forget about the PYSON filter. I updated the review.
review32001002 updated at https://codereview.tryton.org/32001002/#ps80001
msg31613 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-01-31.23:40:04
I want to raise some concern about having filter as pyson. I think it will lead to records that are never shown because they will be filtered out by the dynamic filter. The client could not enforce a correct behaviour at this level. Also such feature has a very high cost on read which is the most used mode (in contrary to the domain validation).
So I'm in favour to implement as a static domain.
review32001002 updated at https://codereview.tryton.org/32001002/#ps60001
msg31610 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-01-31.17:59:01
I remove sao and tryton client as they are no more necessary as explained on: 

https://tryton-rietveld.appspot.com/33051002/diff/1/tryton/gui/window/view_form/model/field.py#newcode764

This is implemented on latest version of trytond review.
review32001002 updated at https://codereview.tryton.org/32001002/#ps40001
review32001002 updated at https://codereview.tryton.org/32001002/#ps20001
review33051002 updated at https://codereview.tryton.org/33051002/#ps1
review33041002 updated at https://codereview.tryton.org/33041002/#ps1
review32001002 updated at https://codereview.tryton.org/32001002/#ps1
msg31505 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-01-26.15:46:26
Here is review32001002 for trytond, review33041002 for sao and review33051002
 for tryton.
msg17227 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2014-06-17.14:12:34
On 17 Jun 13:28, Sergi Almacellas Abellana wrote:
> The filter attribute will be the `add_remove` one or a new attribute must be added?

A new one. `add_remove` is exactly the opposite.

> Also domain inversion must be done.

That's why I said the client must use the combination of domain and
filter.
msg17226 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2014-06-17.13:28:49
Sounds good to me. 

The filter attribute will be the `add_remove` one or a new attribute must be added?

Also domain inversion must be done.
msg17225 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2014-06-17.13:09:48
But let's convert it into a feature request.
I think something could be done by adding a filter attribute to xxx2Many that will be used in the getter and appended to the domain by the client when doing search.
msg17224 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2014-06-17.13:07:14
Understood, so I will use Function fields on our use case, as we need to show two diferent One2Many fields based on a filter.
msg17223 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2014-06-17.12:49:29
The current code is the expected behavior.
The domain on xxx2many is a constraint not a filter.
msg17222 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2014-06-17.12:45:28
The domain is not taken in account in [1] and [2] and the xxx2Many fields return incorrect values because they doesn't filer by domain. 

I attached a review that adds a test for this use case. 

Both test fails with a validation domain, because the second field (which have a domain) return the invalid values for the current model. 

[1] http://hg.tryton.org/trytond/file/c427c593baf0/trytond/model/fields/one2many.py#l78
[2] http://hg.tryton.org/trytond/file/c427c593baf0/trytond/model/fields/many2many.py#l61
History
Date User Action Args
2017-03-30 09:40:47roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg32908
2017-03-22 10:01:55reviewbotsetmessages: + msg32657
2017-03-17 09:34:02reviewbotsetmessages: + msg32566
2017-03-08 10:07:00reviewbotsetmessages: + msg32342
2017-02-28 11:08:29reviewbotsetmessages: + msg32230
2017-02-28 09:36:35reviewbotsetmessages: + msg32226
2017-02-21 10:39:01reviewbotsetmessages: + msg32090
2017-02-15 11:08:55reviewbotsetmessages: + msg31937
2017-02-02 12:45:28reviewbotsetmessages: + msg31679
2017-02-01 11:19:02reviewbotsetmessages: + msg31621

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