IRC logs of #tryton for Saturday, 2010-04-17 #tryton log beginning Sat Apr 17 00:00:02 CEST 2010
-!- tekoholic( has joined #tryton04:07
-!- tekoholic( has joined #tryton04:43
-!- yangoon( has joined #tryton05:19
-!- tekoholic(~quassel@ has joined #tryton05:46
-!- fhoahf55593( has joined #tryton05:56
-!- fhoahf55593( has left #tryton05:56
-!- udono( has joined #tryton06:56
-!- tekoholic( has joined #tryton08:23
-!- sharkcz( has joined #tryton08:42
-!- udono( has joined #tryton09:04
-!- tekoholic( has joined #tryton09:08
-!- enlightx(~enlightx@ has joined #tryton09:24
-!- Timitos(~timitos@ has joined #tryton09:39
-!- enlightx(~enlightx@ has joined #tryton11:36
-!- enlightx(~enlightx@ has joined #tryton12:25
-!- FWiesing( has joined #tryton12:28
-!- ikks_(~ikks@ has joined #tryton13:37
-!- woakas( has joined #tryton15:16
-!- onisemus(~4e5d357a@gateway/web/freenode/x-cbtizwshmpozlqrs) has joined #tryton16:21
onisemushello tryton channel16:21
onisemusneed your help16:22
onisemushow to dynamically populate fields.selection based on the value of another field?16:23
onisemushmmm very quiet16:27
Timitosonisemus: your answer is not very precise. please give us more details16:35
onisemusok timitos16:36
onisemussay i have fields named  1.item type and  2.items16:39
onisemusboth fields are fields.selection16:39
onisemusif i select 1.item type:   metal16:40
onisemusthen 2.items will filter the selection to:   'gold', 'aluminum', 'copper', 'silver'16:41
onisemusany thought timitos?16:42
Timitosi think that only selections are not enough for something like this. you should use a parent-child relation like on product.category.16:45
onisemusthe main question timitos is:  how to modify fields.selection dynamically16:46
Timitosthen you can create 2 fields. ony with a domain = [('parent', '=', False)] and a second field with [['parent', '=', NAME_OF_1ST_FIELD)]16:46
Timitosonisemus: you can use a normal many2one field for this an use in the view the selection widget16:46
onisemusunfortunately, 'domain' is not working on fields.Selection field16:46
onisemustried that trick already timitos, many2one -> xml' widget=selection16:47
onisemusthe thing is, for this given application, its nicer to use dropdown list (combo box) instead of lookup (many2one)16:48
onisemusso is there a way to tweak the content of list inside the loaded fields.selection16:49
Timitosonisemus: it should be possible with a domain on the 2. selection field. but the domain maybe needs to be a hardcoded domain.16:51
Timitosonisemus: i do not understand why many2one should not work for this16:51
onisemusbut got to be 'dynamic'16:51
onisemusme too, but you can try yourself, if you have time16:52
Timitosonisemus: it must be possible with a domain on a many2one that is set to selection widget. if this is not working it is a bug. either in trytons code or your code16:55
onisemuscould be a bug then, as for my code, i just followed the doku or samples16:56
Timitosonisemus: can you paste me your code?16:57
onisemusits a straight forward:   @model  fields.many2one         @xml  widget=selection16:57
Timitosonisemus: the interesting part is the domain16:59
Timitosonisemus: which version of tryton are you running?17:00
Timitosonisemus: is there an error message when you use the selection widget for the many2one?17:09
onisemusthere is no error.  but the list returns all (unfiltered)17:10
Timitosonisemus: how is the domain looking?17:12
Timitosonisemus: i can confirm this. you should file a issue17:18
onisemusso its a bug timitos?17:19
Timitosonisemus: yes17:19
onisemusthanks a lot timitos for your time17:19
onisemusjust wondering if there is other way to manipulate the list of fields.selection17:19
onisemusnot via domain17:20
Timitosonisemus: i do not see any other solution for your problem. the domain is the correct tool for something like this.17:21
onisemusi agree this is supposed to be the right trigger, i just want to confirm maybe i am not aware of some hacks17:22
Timitosi there are some i do not know about them ;-)17:22
Timitosonisemus: maybe the issue is already solved in 1.5. i did not test it with the trunk version17:22
onisemusperhaps on lower level, through objects as in standard pygtk  combobox.clear(), combobox.append()17:23
onisemuscalled via onchange_  ;)17:23
Timitosonisemus: this is framework layer. not the right place to solve such problems17:24
onisemuscan wait to fix, while maybe this is not yet addressed issue even on 1.517:26
Timitosonisemus: why not use many2one first and switch to selection widget after fix release?17:26
Timitosps: do not forget to file the issue17:27
Timitosonisemus: 1.6 should be released next week.17:28
onisemusyep most likely will do for the time being, just hate to be trapped and do nothing ;)17:30
Timitosi need to go now. cu17:30
onisemusagain thanks a lot timitos17:30
Timitosyou are welcome17:31
-!- gremly( has joined #tryton18:45
-!- ikks_(~ikks@ has joined #tryton23:50

Generated by 2.11.0 by Marius Gedminas - find it at!