IRC logs of #tryton for Monday, 2013-04-29

chat.freenode.net #tryton log beginning Mon Apr 29 00:00:03 CEST 2013
iamnoobQ: hi i had overided the 'create method' and inserted a code there that 'UPDATES' a column of a record (the column name is 'usedtag'). that record was selected by a Many2One field that has a domain of --> domain=[('usedtag', '=', None)] , now when i try to save the record. it gives me an error of -->> The value of the field "<my many2one field>" on "<some module>" is not valid according to its05:24
iamnoobdomain.          when i check the databse manually, i see that the UPDATE query was made, but i cant saved the record ... i just need it to save the record im editing...05:24
iamnoobhere is a pastebin of a [part of my module : -->http://pastebin.com/LZDC4pKZ05:30
udonoiamnoob: hi, what exactly is <my many2one field> in the error message? Is it "pendingupr"?07:24
udonoiamnoob: The field pendingupr will be saved, when the m2o relation field upr.pr.usedtag is None.07:26
iamnoobudono: on your 1st question, yes its pendingupr07:30
iamnoobudono: do you mean, it will only see records that have field.upr.pr.usedtag = None, and will on save records where  field.upr.pr.usedtag = None?07:31
iamnoobudono: do you mean, it will only see records that have field.upr.pr.usedtag = None, and will only save records where  field.upr.pr.usedtag = None?07:32
iamnoobudono: is it possible to override that rulling? because i really need to make the update Query on the field i have declared on the domain.. or is there any other way of doing this please?07:33
udonoiamnoob: so simply do not use the domain.07:37
udonoiamnoob: More clear: remove the domain and you will not get domain errors.07:38
iamnoobudono: umm,ok , well the reason i used domain is because it filters out the records that is shown when i select the records, thats the only reason i used domains.. is there another way to do it ?07:39
iamnoobudono: this makes my many2on field have the ability not to pick again the same records that has been used by another record.. hope you get what i want to express.. and thankyou for clearing it out to me.. the domain07:41
udonoiamnoob: which version of Tryton you use?07:41
iamnoobudono: im using 2.6.2 client and server07:43
iamnoobudono: im using 2.6.2 client and 2.6.4 server to be exact07:43
udonoiamnoob: yes, thanks.07:44
udonoiamnoob: the problem using domains is to understand it is on field level a forced "constraint" and not only a kind of rule searching records. In your case it could be, that your code reads the items correctly (upr.pr.usedtag is None). But it seems on save upr.pr.usedtag is no longer None. So the domain constraint prevents to save the record.07:51
udonoiamnoob: ... but domains are very flexble in Tryton. You can try to implement a domain with a conditional. Like http://hg.tryton.org/2.6/modules/account/file/e57abf64b3a1/tax.py#l56107:55
iamnoobudono: yes that exactly what happen, its just that i really need to save the record even having a domain,, hoping there another way (like the domain) to work only and searching records, but not restrict me from saving the records07:56
udonoiamnoob: you can use a selection field and just search the items.07:57
iamnoobudono you mean override the *def search_rec_name(cls, name, clause):* ?07:58
udonoiamnoob: no, just something like http://hg.tryton.org/2.6/modules/account/file/e57abf64b3a1/journal.py#l9407:59
iamnoobudono: i see, a combobox... then edit  the Type.seacrch([]) ?  on http://hg.tryton.org/2.6/modules/account/file/e57abf64b3a1/journal.py#l16808:03
udonoiamnoob: yes, maybe it is sufficient for the usability, to just select one out of a selection?08:07
iamnoobudono: it may do the job, do the problem will be for the end-users, they may have a hardtime finding the record they needed if there's already hundreds of records to select to.. anyway .. thanks udono.. i may not solve my problem but this gives me other stuffs to try out08:09
iamnoobis there any way i can activate the -->  def search_rec_name(cls, name, clause): when i click on the search record? rather than click the search record then input something on the filter box then enter for it to trigger>08:29
iamnoobQ: in a many2many field     is there any way i can activate the -->  def search_rec_name(cls, name, clause): when i click on the search record? rather than click the search record then input something on the filter box then enter for it to trigger>08:34
iamnoobmy goal is to filter the records right away , rather than show all the records when you click on the 'select records button' , i cant use domains on this part08:37
cedkiamnoob: there is a search entry next to the add button of m2m08:47
iamnoobcedk: anyway i can put a default value on that entry box?08:51
cedkiamnoob: no08:51
iamnoobcedk: is it possible to remove the restriction on the domain? i needed the domain to filter out the records, but its restricting me to save, because i Updated the field i used on the domain..  (via overriding the def create)08:55
cedkiamnoob: no08:56
iamnoobcedk: ok thanks08:57
cedkiamnoob: I think you try to do somethin that doesn't fit the Tryton's logic08:57
iamnoobcedk: yes it seems like that, i just need something to prevent the end users from re-using the same records again and again..08:58
cedkiamnoob: m2m records are unique08:59
iamnoobcedk: i see..09:02
cedkalbertca: you push to fast09:58
cedkbechamel: could you check http://codereview.tryton.org/837003/10:14
bechamelcedk: yes10:15
cedkbechamel: and also http://codereview.tryton.org/837002/10:17
cedkbechamel: I made some comments10:17
coepsHi, I have a general design question: when using multiple functionfields that kind of depend on each other i.e. like an amount, a tax-amount and a sum, is it possible (or advisable) to calculate the SUM as amount + taxamount, (both as well function fields)? all 3 funcitonfilels might be changed in the same on_change operation, so I am worried that the result might be inconsistent because of the order of execution. Do I have to worry?11:07
cedkcoeps: there is the special keywords "names" that will run once the method for many fields11:31
coepscdek: thank you, can you think of a module where names is used? I would like to see an example of the retrund dict: "containing for each names a dictionary with a value for each instance". Thats not quite clear, is it a dict with "name" [list of values] (one per instance)?11:58
cedkcoeps: Party.get_receivable_payable12:02

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!