IRC logs of #tryton for Tuesday, 2021-06-29

irc.libera.chat #tryton log beginning Tue Jun 29 12:00:01 AM CEST 2021
-!- qqx(~qqx@142.159.90.146.dyn.plus.net) has joined #tryton22:37
-!- qqx(~qqx@142.159.90.146.dyn.plus.net) has joined #tryton22:48
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:11
-!- ChanServ changed mode/#tryton -> +o cedk 23:11
-!- springwurm(~springwur@5.104.149.54) has joined #tryton05:05
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton05:26
-!- timitos(~kpreisler@2001:a61:4ac:5b01:762b:62ff:fe84:ed7e) has joined #tryton05:35
-!- rpit(~rpit@p200300c88f365000db48e182b4ab3144.dip0.t-ipconnect.de) has joined #tryton06:25
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:34
-!- ChanServ changed mode/#tryton -> +o cedk 06:34
-!- qqx(~qqx@142.159.90.146.dyn.plus.net) has joined #tryton07:01
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton07:04
mrichezhi, in pyson i try to check if a key based on a field exists in a dictionnary and then get my key.. If(In(Eval('field'), mydict), Get(mydict, Eval('field')) ... Got error "key must be a string". Thanks for help!07:50
cedkmrichez: 'mydict' seems strange, I guess it should be an Eval(..., {})08:20
qqxmrichez: the first argument to In is of type Eval, where a string is expected because the second argument is a dict, maybe?08:21
mrichezcedk: mydict is the return of a class method: https://codereview.tryton.org/292521002/diff/365521002/modules/product/product.py#newcode14008:31
mrichezqqx: yes, i want to check if value of a field is in a dict08:32
qqxmrichez: AFAICT from the source, if the second arg is a dict, then the first arg has to be a string, not an Eval("field"). But I'm totally new here so I may not know the whole story. :-(08:34
mrichezqqx: so my question.. :-) thank you!08:35
qqxAlso as an aside, the source is using 'assert' for logic. Isn't python 'assert' meant for debugging and is stripped on optimization?08:36
cedkmrichez: PYSON.In does not support to test PYSON key in dict08:36
cedkmrichez: I guess the assert should support PYSON key08:37
cedkmrichez: in https://hg.tryton.org/trytond/file/tip/trytond/pyson.py#l49208:38
mrichezcedk: so it should be a feature ? or i have to find another way to test my key ?08:42
mrichezcedk: asert .... or isinstance(key, PYSON) ?08:43
cedkmrichez: I guess it could be a new feature if it works08:46
mrichezcedk: i'm testing08:46
mrichezcedk: i paste same code as here: https://hg.tryton.org/trytond/file/tip/trytond/pyson.py#l443 for "In"08:48
mrichezcedk: ok, working ! :-)08:52
mrichezcedk: i mean tests are working :-), now will try with a demo08:52
cedkmrichez: I think you must add a test for this case08:53
mrichezcedk: you mean in the feature issue ?08:54
cedkmrichez: yes to add this new behavior to PYSON08:55
mrichezcedk: ok08:55
-!- udono(~udono@048-130-067-156.ip-addr.inexio.net) has joined #tryton09:12
LordVanHi09:13
LordVanI was wondering09:13
LordVanwould it be possibl to use the CSV importer in the tryton client09:13
LordVanto import just sale line data into the currently open sale?09:13
cedkLordVan: you would need to have a window displaying the sale lines and fill the sale field09:20
cedkLordVan: or you can import the CSV from the sale window as long as you set the column id to the sale id that must be updated09:22
LordVanso for me the easiest would be to put the sale id in column one and then just the sale lines correct?09:22
LordVan[the reason for this is that a customer of ours can send spreadsheets with the order data and it would save time a / avoid typos if the office staff can do it. But of course adding the whole thing in csv is a bit more than I can ask them to do ;)09:23
cedkLordVan: yes the header should be something like: id,lines/product,lines/quantity,…09:25
LordVannice .. so if I expose the sale ID on the UI by adding it as a field I can get them to just put that in the spreadsheet and then they can import it09:25
mrichezOne more question: how to run specific tests? i mean how to launch test_pyson.py only ? or if not possible only trytond tests ?09:28
cedkLordVan: the ID can be found in "View logs"09:31
LordVancedk, oh nice I did not know. thanks09:31
cedkmrichez: run-tests.py test_pyson09:31
mrichezcedk: thanks :-)09:32
-!- LordVan(~LordVan@gentoo/developer/lordvan) has joined #tryton11:11
-!- SISalp(~SISalp@51.sisalp.net) has left #tryton11:22
-!- SISalp(~SISalp@51.sisalp.net) has joined #tryton11:39
LordVancedk, i take it that if i wanted to add a link to a product it'D have to be the products id right?11:44
-!- udono(~udono@048-130-067-156.ip-addr.inexio.net) has joined #tryton11:44
-!- springwurm(~springwur@5.104.149.54) has joined #tryton12:07
cedkLordVan: by default it search by rec_name12:16
LordVanoh nice. that would be even easier if we could add that12:17
LordVanI might just prepare a spreadsheet for the office staff with the data and some examples to copy12:18
LordVanbecause for some things data entry in a table is easier than seperate pages/forms for each entry12:18
cedkLordVan: you can set the list as editable12:19
cedkLordVan: you can also on editable list use copy/paste12:20
LordVanwhat list do you mean now?12:20
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton12:26
-!- ChanServ changed mode/#tryton -> +o cedk 12:26
LordVancedk, what do you mean with "editable list" ?12:29
udonoLordVan: hi, see account_statement. you can enter lines directly in the table, thats am editable list12:37
LordVanudono, yes like translations too12:37
LordVanbut i thought he meant it can be set in the UI12:38
LordVanbut i think i misunderstood and it has to be done in code?12:38
udonoLordVan: yes, must be done in code12:39
LordVanI wonder if that would be feasible for sale lines .. hmm12:39
LordVanI hadn'T actually thought about that but that could be super useful12:39
LordVanthanks cedk and udono12:39
udonoLordVan: maybe the https://hg.tryton.org/modules/account_invoice_line_standalone/file/default/doc/index.rst module is a good template for a module sale_line_standalone?12:42
LordVanudono, i shall have a look. thanks12:43
-!- KyrillKlaus(~5abb3c89@ircip2.mibbit.com) has joined #tryton13:16
KyrillKlausHello 13:16
acaubetI have a ir.rule to restrict the records to a new users group, it works ok allowing only to see the records on the domain13:38
acaubetbut now the admin (or other groups with privileges) can not see those records, which I'm missing?13:39
acaubetwhat* I'm missing?13:39
acaubetthis is my domain eval="[('agent.party', '=', Eval('user.party', {}))]"13:40
acaubetnote that I have added the field party on res_user13:41
mrichezacaubet: maybe you should test if user is in specific group and bypass domain eval13:43
cedkacaubet: rule define who can see the records so if no rule exist for admin group, he will not see them13:45
cedkso you probably need to define a rule that allow to see all records for the admin group13:46
acaubetokey, will try that, make sense13:47
acaubetI have added a rule with domain eval="[]" to corresponding admin groups, now admin can see the records, but the rule don't works anymore for the specific new group`with custom rule14:35
acaubetthe testing user only have the specific grup with the rule mentioned above14:36
-!- timitos(~kpreisler@2001:a61:4ac:5b01:762b:62ff:fe84:ed7e) has joined #tryton15:12
-!- qqx(~qqx@142.159.90.146.dyn.plus.net) has joined #tryton16:37
-!- qqx(~qqx@142.159.90.146.dyn.plus.net) has joined #tryton20:56

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