IRC logs of #tryton for Friday, 2018-01-26 #tryton log beginning Fri Jan 26 00:00:02 CET 2018
-!- cdchapman(~perturbed@ has joined #tryton01:32
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton02:27
-!- swayf( has joined #tryton02:30
-!- swayf( has joined #tryton03:36
-!- swayf( has joined #tryton04:41
-!- thaneor( has joined #tryton04:48
-!- swayf( has joined #tryton05:45
-!- swayf( has joined #tryton06:51
-!- _2cadz(~2cadz@ has joined #tryton06:55
-!- swayf( has joined #tryton07:55
-!- tbruyere( has joined #tryton08:10
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:12
-!- Timitos( has joined #tryton08:33
-!- zmijunkie( has joined #tryton08:57
-!- swayf( has joined #tryton09:01
-!- mrichez( has joined #tryton09:02
-!- rpit( has joined #tryton09:05
-!- tbruyere( has joined #tryton09:46
-!- tbruyere( has joined #tryton09:48
pokolicedk: do you want some help for ?10:04
-!- swayf( has joined #tryton10:06
cedkpokoli: not particulary10:09
-!- fmorato( has joined #tryton10:40
-!- Telesight( has joined #tryton11:18
-!- csotelo(~csotelo@ has joined #tryton11:25
-!- nicoe( has joined #tryton11:32
-!- yangoon( has joined #tryton12:04
-!- swayf( has joined #tryton12:06
-!- swayf( has joined #tryton12:07
csotelohello dear community, I have an iddue with button, Button end_rounding on my module mymodule.health_nursing still having the health_nursing.health_nursing behavior, I mean, it is not been updated from 'invisible': ~Eval('state').in_(['draft']), to 'invisible': Eval('state').in_(['draft', 'done']),12:08
csoteloany suggest?12:08
-!- swayf_( has joined #tryton12:10
pokolicsotelo: you are missing the __name__ attribute on the class to indicate which model you are modifing12:10
pokolicsotelo: and when inheriting from an exsiting model is not required to have a subclass of ModelSQL nor ModelView12:11
pokolicsotelo: just simply use the trytond.pool.PoolMeta as metaclass for the class12:11
-!- Artem(b0430418@gateway/web/freenode/ip. has joined #tryton12:13
csotelopokoli, I just copy the class name and method in order on reduce code12:28
csoteloI mean, the text "__name__ = 'gnuhealth.patient.rounding'" is ok, just taknen off for the class definition12:29
csotelosorry for12:29
csotelotaken off for the paste bin12:30
csoteloby the way, about the PoolMeta12:30
csotelothe 2to3 do something like "class Surgery(metaclass=PoolMeta)"12:30
csotelogoing back my issue, all is working, just the button is invisible status is not being updated12:32
csotelooriginal behavior related to health module, 'invisible': ~Eval('state').in_(['draft']),, then since I have added a new selection, I need to change the behavior12:33
csoteloun fortunatly, it wasent done12:34
csoteloand no works as I spected12:34
pokolicsotelo: are you using the lastest gnuhealth version? (which only works on python3)12:35
csotelopokoli, yes!12:35
pokolipokoli: then the metaclass sintax you posted is correct12:36
pokolicsotelo: have you added your model on and registered with the correct module name?12:36
csoteloas told you, all is ok, my module have been updated and is working as expected, except  I just not got the button behavior12:37
csoteloI wil paste my whole model12:39
csoteloit is weird12:44
pokolicsotelo: I don't see any issue on it12:45
csotelothat is why I think is wird12:46
pokolicsotelo: Have you restarted the server and the client?12:46
csotelocls._buttons.update is not updating button12:46
csoteloyes, both of the12:46
csotelofirst I have updated the module, then the server, then client12:46
-!- csotelo(~csotelo@ has joined #tryton13:18
-!- catonano(~user@ has joined #tryton13:21
fmoratoHe was missing the ~ before Eval13:46
-!- andrespoliti( has joined #tryton14:07
andrespolitihi, is there a way of hiding an action button according to a domain?14:07
-!- _2cadz(~2cadz@ has joined #tryton14:12
pokoliandrespoliti: you can use the invisible definition with a PYSON to define the conditin14:16
-!- csotelo_at_work(~csotelo@ has joined #tryton14:16
pokoliandrespoliti: it's used on all base modules to hide transition buttons on non applicable states14:16
andrespolitii mean to hide an action in the Launch Action14:17
andrespolitinot a button in the form14:17
-!- Guest98556( has joined #tryton14:31
andrespolitipokoli: is there a way of doing that?14:41
cedkandrespoliti: no, action are always available14:43
cedkandrespoliti: otherwise you must use a button14:43
-!- csotelo_at_work(~csotelo@ has joined #tryton14:49
csotelo_at_workdear comunity14:49
csotelo_at_workwhich is the table for manage button states?14:49
cedkcsotelo_at_work: there is no table, it is in the Model code14:51
csotelo_at_workI see cedk14:52
fmoratocsotelo_at_work: you were missing the ~ before Eval in your previous question.14:52
csotelo_at_workI have a part of code that I could make work14:52
csotelo_at_workit is related to cls._buttons.update method, it is working well on just a part,14:53
csotelo_at_workbut on one button it is no changing behavior14:53
fmoratocsotelo_at_work: In the code you shared earlier it should be ~Eval() instead of Eval()14:55
csotelo_at_workfmorato, I need this behavior 'end_rounding': { 'invisible': Eval('state').in_([None, 'draft', 'done'])}14:56
csotelo_at_workI mean , button "end_rounding" must be invisible when state is : None, draft or done14:56
csotelo_at_worksince I have added a new state named 'posted'14:56
csotelo_at_workit is for patient rounding on gnu health14:57
fmoratocsotelo_at_work: put a '~' before Eval14:57
csotelo_at_workfmorato, no.. the behavior doesnt chage15:06
csotelo_at_workI would like to fidn a way to know how it is been understanding on tryton15:06
csotelo_at_workin order to kow why the button is no changing behavior15:06
fmoratocsotelo_at_work: You should then read the PYSON docs and implementation.15:12
-!- hedererjs( has joined #tryton15:19
-!- csotelo_at_work(~csotelo@ has joined #tryton15:29
csotelo_at_worksorry, my connection gets broken15:29
csotelo_at_workI was telling you that I owuld like to find a way to debug button behaviors, since I couldnt way the reason on why the button state update is not being override /updated on my class setup15:30
csotelo_at_workany suggest?15:40
csotelo_at_workcould be a bug?15:46
csotelo_at_workis there a way to manage dirctly on some place, like database table?15:46
pokolicsotelo_at_work: no, states are managed on code in order to be overriden15:49
csotelo_at_workpokoli, any way to debug or follow it? since it looks if the update is no overwritting the bustton state15:51
csotelo_at_workjust for a test, I have donde something like 'invisible': Eval('state').in_(['draft']), having the state == 'posted'15:54
csotelo_at_workthen, my button must not be invisible, however it is still invisible15:55
csotelo_at_workaccording this rule15:56
pokolicsotelo_at_work: you can debug when the client is evaluating it16:07
csotelo_at_workthmm the only feedback here that I have is that update is no overwritting button :(16:08
-!- udono(~udono@ has joined #tryton16:14
-!- meigallodixital( has joined #tryton16:37
-!- thaneor( has joined #tryton16:51
-!- csotelo_at_work(~csotelo@ has joined #tryton16:53
csotelo_at_workI guess here [] is the button update, right?16:55
csotelo_at_workprobably doing prints  could fin de issue16:56
_2cadzHi, is there a possiblility to define a domain like this in field definition :  [('id', 'in', Eval('user', {}).get('companies', []))]  ?17:21
_2cadz'user' is not a field but the current user.17:21
pokoli_2cadz: you have the current user company in the context. That should be Eval('context', {}).get('company', -1)17:23
_2cadzpokoli: Yes I know, but I would like to have the list of companies that the current user can choose as current companies.17:32
pokoli_2cadz: we usually manage this by access rules (and there you have the user)17:32
cedk_2cadz: put them in the context17:33
-!- fmorato( has joined #tryton17:39
-!- swayf( has joined #tryton17:46
_2cadzcedk: how i can make that ? is there an example somewhere ?18:00
cedk_2cadz: in res/ User has an attribute to define field that must be in the context18:08
_2cadzcedk: you talk about : _context_fields ?18:16
-!- cdchapman(~perturbed@ has joined #tryton18:20
cedk_2cadz: yes18:23
_2cadzcedk: Thanks.18:25
csotelo_at_workpokoli, I couldnt find the way on solve or find how to solve, could be useful share my tryton.cfg?18:31
-!- zmijunkie( has joined #tryton18:59
-!- cdchapman(~perturbed@ has joined #tryton19:52
fmoratoI've noticed that there is a multiselection widget. How can I have a multiselection field?19:59
-!- swayf( has joined #tryton20:07
-!- zmijunkie( has joined #tryton20:51
-!- zmijunkie( has joined #tryton21:09
-!- cdchapman(~perturbed@ has joined #tryton21:45
-!- semarie_(~semarie@unaffiliated/semarie) has joined #tryton22:01
-!- cdchapman(~perturbed@ has joined #tryton22:55
-!- mariomop(~quassel@ has joined #tryton22:59
-!- catonano(~user@ has joined #tryton23:19
-!- cdchapman(~perturbed@ has joined #tryton23:27
-!- NeonKing(~Neonking@ has joined #tryton23:37
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:45

Generated by 2.11.0 by Marius Gedminas - find it at!