IRC logs of #tryton for Tuesday, 2021-04-20

chat.freenode.net #tryton log beginning Tue Apr 20 12:00:01 AM CEST 2021
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:20
-!- thaneor(~ldlc6@r167-61-166-60.dialup.adsl.anteldata.net.uy) has joined #tryton00:51
-!- thaneor1(~acer8@r167-61-166-60.dialup.adsl.anteldata.net.uy) has joined #tryton00:51
-!- yangoon(~mathiasb@p5dd08a70.dip0.t-ipconnect.de) has joined #tryton01:29
-!- springwurm(~springwur@5.104.149.54) has joined #tryton05:10
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton05:13
-!- Timitos(~kpreisler@2001:a61:482:eb01:762b:62ff:fe84:ed7e) has joined #tryton05:30
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton06:33
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:44
mrichezhi, back with my access rules... i notice we can duplicate a model having a readonly field. In my case, i need to set a field readonly for a specific group, so the advice was to use field access rules..07:15
mrichezThen i define a field with write access = False (same as setting a field readonly) to a specific group... in this case, i cannot duplicate a record07:16
mrichezshould we consider to allow duplicate a record with a field with write access = False (this field will be empty) or how could i set a field readonly depending on a group otherwise than with access rules ? Thanks for help.07:18
mrichezYou can reproduce easily this behaviour in demo: now you can duplicate a party. Then you define a field access rule on field name on party (all access, except "write") then you cannot duplicate a party07:20
-!- ludo2(~Thunderbi@2001:912:1480:380::1) has joined #tryton07:24
pokolimrichez: which is the error raised when duplicating?07:24
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton07:25
mrichezpokoli: you are not allowed to access "Model.field_name"07:26
pokolimrichez: I guess the error is raised in this line: https://hg.tryton.org/trytond/file/226f75c85e92/trytond/model/modelstorage.py#l17707:29
mrichezpokoli: could we adapt the behavior ?07:30
pokolimrichez: Not sure but it seems there is something to improve here07:31
mrichezpokoli: would be nice...07:31
pokolibecause you are not directly writing the field but copy sends all fields to ensure the new record has the same values thant the previous one07:31
mrichezpokoli: i think fields without write access should be set to None...07:32
pokolimrichez: I think we should keep the other record value07:33
mrichezpokoli: or default value07:33
pokolimrichez: and if you need to clear it you can always do by overriding the copy method07:33
mrichezpokoli: ok07:33
mrichezpokoli: so this check is useless ?07:34
mrichezpokoli: should i open a discuss or create a feature ?07:38
pokolimrichez: no, it's not useless because it should be enforced when creating new recorsd07:40
pokolimrichez: but probably the check should be skipped when copying07:41
cedkI do not think it is right to skip access check when copying07:43
cedkif the user can not create the exact same record manually, he should not be allowed to do so with copy07:43
cedkalso not setting value for field without access will result in an different copied record07:47
cedkthe only case I think this could be done is if the current value is the default value07:47
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton07:51
mrichezcedk: back with my case... my field is a boolean field which is only writable by admin once model is validated... duplicating a record with current value is like giving an access to this field to unauthorized user07:52
pokolimrichez: you should clear the value when copying, so the default value is set07:53
pokolibut IIUC this will also crash ash the user is not allowed to write on this field07:53
mrichezpokoli: ok, so back to problem07:54
nicoeAbout https://drone.tryton.org/tryton/trytond/644, I don't think there is anything to do in trunk but those failure (due to dict not being ordered back in python3.5) will be burden. Maybe we should use sort in the assert07:54
pokolinicoe: IIRC we agreed on disabling failing tests on 3.5 because this is no longer supported07:55
nicoepokoli: OK07:56
cedkwe agree when the cause is external tools07:57
cedkI would not like to have trytond tests disabled07:57
cedknicoe: I think the test should be improved also on trunk because it should not rely on internal design like the order a dict is filled07:59
cedknicoe: maybe the easiest way is to convert domain list to set08:17
mrichezcedk: which is the difference between create access and write access ? Duplicate is creating a new record, no ? So field write access should not be checked...09:04
cedkmrichez: create access on field is only for relation field like One2Many09:12
cedkmrichez: otherwise it is always write access that is needed09:12
mrichezcedk: ok09:15
cedkmaybe we should add a note about that in the doc09:23
mrichezcedk: ok, so to resolve my problem i could create a wizard (custo) to copy all fields of a model except those not writable09:39
cedkmrichez: I think your access on field should not be static09:43
cedkmrichez: for me it looks like it depends on a kind of state09:43
mrichezcedk: it's the field which define the "state"... validated or not...09:48
mrichezcedk: would be easier if readonly states could depends on group with a pyson eval09:50
cedkmrichez: it can using the context and Id10:16
mrichezcedk: so i'll try this way10:44
-!- mariomop(~quassel@181.29.189.235) has joined #tryton11:04
mrichezi noticed reviewbot was not updating my bugs ? i add to add review manually... problem ?11:57
pokolimrichez: You should do it manually: https://bugs.tryton.org/issue1029311:58
mrichezpokoli: ok, thanks!11:58
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton12:15
-!- thaneor2(~acer8@r167-61-40-124.dialup.adsl.anteldata.net.uy) has joined #tryton12:38
-!- thaneor(~ldlc6@r167-61-40-124.dialup.adsl.anteldata.net.uy) has joined #tryton12:54
mrichezcedk: i set readonly state on my field depending on group admin, i remove field access rules and now everything is working correctly (duplicate, record readonly when field is checked by admin,...) :-)13:15
mrichezdo you think useful to explain on discuss what i did to allow giving more rights to user but not admin rights (in my case, validation of a product) ?13:35
pokolimrichez: discuss is our knowledge base, so anything you share there it may be usefull for anyone that haves the same behaviour14:08
mrichezpokoli: i'll update a previous discuss about this subject: https://discuss.tryton.org/t/write-access-rules-to-group-depending-on-a-field14:09
pokolimrichez: great14:10
pokolicedk: weblate broke sao translation another time. I retranslated in catalan to see if this fixed. But IIRC the issue also affected French14:11
pokoliWrong translations are marked as inconsistent because they have an equivalent transaltion in tryton which has a diferent value14:11
pokoliSo they can be found easly14:11
cedkpokoli: there is no error https://translate.tryton.org/projects/tryton/sao/14:25
pokolicedk: ok but I need to fix catalan manually14:26
cedkpokoli: I do not understand what you want to fix14:27
pokolicedk: this changeset https://hg.tryton.org/weblate/rev/3d223434be3d14:28
pokoliBut it only affects catalan14:28
cedkbroken software as usual14:31
cedkACTION the opensource tooling is really dieing14:32
pokoliBut I do not understand why it happens, because on french you have also non ascii codes14:33
pokoliOk, I think I fixed all14:35
mrichezhi, small bug with purchase_requisition, when removing currency and trying to add a line... should i allow to add a line without currency and set currency required on save (like for purchase) or prevent to add a line if currency is not set ?14:55
pokolimrichez: which is the purchase behaviour?15:00
mrichezpokoli: currency field is required, but you can add lines without field currency set....15:01
pokolimrichez: now I do not understand which is the bug15:04
mrichezcreate a new purchase_requisition, remove currency set by default, and try to add a line...15:05
pokolimrichez: ok, I've seen the traceback. You shouldallow to add a line wihthout currency without any exception15:05
-!- Timitos(~kpreisler@2001:a61:482:eb01:762b:62ff:fe84:ed7e) has left #tryton15:09
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton15:10
-!- Timitos(~kpreisler@2001:a61:482:eb01:762b:62ff:fe84:ed7e) has joined #tryton15:10
mrichezpokoli: ok15:10
-!- ludo2(~Thunderbi@221.114.141.88.rev.sfr.net) has joined #tryton15:27
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton20:35

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!