chat.freenode.net #tryton log beginning Tue Apr 20 12:00:01 AM CEST 2021 | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 23:20 | |
-!- thaneor(~ldlc6@r167-61-166-60.dialup.adsl.anteldata.net.uy) has joined #tryton | 00:51 | |
-!- thaneor1(~acer8@r167-61-166-60.dialup.adsl.anteldata.net.uy) has joined #tryton | 00:51 | |
-!- yangoon(~mathiasb@p5dd08a70.dip0.t-ipconnect.de) has joined #tryton | 01:29 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 05:10 | |
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton | 05:13 | |
-!- Timitos(~kpreisler@2001:a61:482:eb01:762b:62ff:fe84:ed7e) has joined #tryton | 05:30 | |
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton | 06:33 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 06:44 | |
mrichez | hi, 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 |
---|---|---|
mrichez | Then 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 record | 07:16 |
mrichez | should 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 |
mrichez | You 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 party | 07:20 |
-!- ludo2(~Thunderbi@2001:912:1480:380::1) has joined #tryton | 07:24 | |
pokoli | mrichez: which is the error raised when duplicating? | 07:24 |
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton | 07:25 | |
mrichez | pokoli: you are not allowed to access "Model.field_name" | 07:26 |
pokoli | mrichez: I guess the error is raised in this line: https://hg.tryton.org/trytond/file/226f75c85e92/trytond/model/modelstorage.py#l177 | 07:29 |
mrichez | pokoli: could we adapt the behavior ? | 07:30 |
pokoli | mrichez: Not sure but it seems there is something to improve here | 07:31 |
mrichez | pokoli: would be nice... | 07:31 |
pokoli | because you are not directly writing the field but copy sends all fields to ensure the new record has the same values thant the previous one | 07:31 |
mrichez | pokoli: i think fields without write access should be set to None... | 07:32 |
pokoli | mrichez: I think we should keep the other record value | 07:33 |
mrichez | pokoli: or default value | 07:33 |
pokoli | mrichez: and if you need to clear it you can always do by overriding the copy method | 07:33 |
mrichez | pokoli: ok | 07:33 |
mrichez | pokoli: so this check is useless ? | 07:34 |
mrichez | pokoli: should i open a discuss or create a feature ? | 07:38 |
pokoli | mrichez: no, it's not useless because it should be enforced when creating new recorsd | 07:40 |
pokoli | mrichez: but probably the check should be skipped when copying | 07:41 |
cedk | I do not think it is right to skip access check when copying | 07:43 |
cedk | if the user can not create the exact same record manually, he should not be allowed to do so with copy | 07:43 |
cedk | also not setting value for field without access will result in an different copied record | 07:47 |
cedk | the only case I think this could be done is if the current value is the default value | 07:47 |
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton | 07:51 | |
mrichez | cedk: 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 user | 07:52 |
pokoli | mrichez: you should clear the value when copying, so the default value is set | 07:53 |
pokoli | but IIUC this will also crash ash the user is not allowed to write on this field | 07:53 |
mrichez | pokoli: ok, so back to problem | 07:54 |
nicoe | About 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 assert | 07:54 |
pokoli | nicoe: IIRC we agreed on disabling failing tests on 3.5 because this is no longer supported | 07:55 |
nicoe | pokoli: OK | 07:56 |
cedk | we agree when the cause is external tools | 07:57 |
cedk | I would not like to have trytond tests disabled | 07:57 |
cedk | nicoe: I think the test should be improved also on trunk because it should not rely on internal design like the order a dict is filled | 07:59 |
cedk | nicoe: maybe the easiest way is to convert domain list to set | 08:17 |
mrichez | cedk: 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 |
cedk | mrichez: create access on field is only for relation field like One2Many | 09:12 |
cedk | mrichez: otherwise it is always write access that is needed | 09:12 |
mrichez | cedk: ok | 09:15 |
cedk | maybe we should add a note about that in the doc | 09:23 |
mrichez | cedk: ok, so to resolve my problem i could create a wizard (custo) to copy all fields of a model except those not writable | 09:39 |
cedk | mrichez: I think your access on field should not be static | 09:43 |
cedk | mrichez: for me it looks like it depends on a kind of state | 09:43 |
mrichez | cedk: it's the field which define the "state"... validated or not... | 09:48 |
mrichez | cedk: would be easier if readonly states could depends on group with a pyson eval | 09:50 |
cedk | mrichez: it can using the context and Id | 10:16 |
mrichez | cedk: so i'll try this way | 10:44 |
-!- mariomop(~quassel@181.29.189.235) has joined #tryton | 11:04 | |
mrichez | i noticed reviewbot was not updating my bugs ? i add to add review manually... problem ? | 11:57 |
pokoli | mrichez: You should do it manually: https://bugs.tryton.org/issue10293 | 11:58 |
mrichez | pokoli: ok, thanks! | 11:58 |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 12:15 | |
-!- thaneor2(~acer8@r167-61-40-124.dialup.adsl.anteldata.net.uy) has joined #tryton | 12:38 | |
-!- thaneor(~ldlc6@r167-61-40-124.dialup.adsl.anteldata.net.uy) has joined #tryton | 12:54 | |
mrichez | cedk: 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 |
mrichez | do 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 |
pokoli | mrichez: discuss is our knowledge base, so anything you share there it may be usefull for anyone that haves the same behaviour | 14:08 |
mrichez | pokoli: i'll update a previous discuss about this subject: https://discuss.tryton.org/t/write-access-rules-to-group-depending-on-a-field | 14:09 |
pokoli | mrichez: great | 14:10 |
pokoli | cedk: weblate broke sao translation another time. I retranslated in catalan to see if this fixed. But IIRC the issue also affected French | 14:11 |
pokoli | Wrong translations are marked as inconsistent because they have an equivalent transaltion in tryton which has a diferent value | 14:11 |
pokoli | So they can be found easly | 14:11 |
cedk | pokoli: there is no error https://translate.tryton.org/projects/tryton/sao/ | 14:25 |
pokoli | cedk: ok but I need to fix catalan manually | 14:26 |
cedk | pokoli: I do not understand what you want to fix | 14:27 |
pokoli | cedk: this changeset https://hg.tryton.org/weblate/rev/3d223434be3d | 14:28 |
pokoli | But it only affects catalan | 14:28 |
cedk | broken software as usual | 14:31 |
cedk | ACTION the opensource tooling is really dieing | 14:32 |
pokoli | But I do not understand why it happens, because on french you have also non ascii codes | 14:33 |
pokoli | Ok, I think I fixed all | 14:35 |
mrichez | hi, 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 |
pokoli | mrichez: which is the purchase behaviour? | 15:00 |
mrichez | pokoli: currency field is required, but you can add lines without field currency set.... | 15:01 |
pokoli | mrichez: now I do not understand which is the bug | 15:04 |
mrichez | create a new purchase_requisition, remove currency set by default, and try to add a line... | 15:05 |
pokoli | mrichez: ok, I've seen the traceback. You shouldallow to add a line wihthout currency without any exception | 15:05 |
-!- Timitos(~kpreisler@2001:a61:482:eb01:762b:62ff:fe84:ed7e) has left #tryton | 15:09 | |
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton | 15:10 | |
-!- Timitos(~kpreisler@2001:a61:482:eb01:762b:62ff:fe84:ed7e) has joined #tryton | 15:10 | |
mrichez | pokoli: ok | 15:10 |
-!- ludo2(~Thunderbi@221.114.141.88.rev.sfr.net) has joined #tryton | 15:27 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 20:35 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!