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 #tryton | 22:37 | |
-!- qqx(~qqx@142.159.90.146.dyn.plus.net) has joined #tryton | 22:48 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 23:11 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 23:11 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 05:05 | |
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton | 05:26 | |
-!- timitos(~kpreisler@2001:a61:4ac:5b01:762b:62ff:fe84:ed7e) has joined #tryton | 05:35 | |
-!- rpit(~rpit@p200300c88f365000db48e182b4ab3144.dip0.t-ipconnect.de) has joined #tryton | 06:25 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 06:34 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 06:34 | |
-!- qqx(~qqx@142.159.90.146.dyn.plus.net) has joined #tryton | 07:01 | |
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton | 07:04 | |
mrichez | hi, 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 |
---|---|---|
cedk | mrichez: 'mydict' seems strange, I guess it should be an Eval(..., {}) | 08:20 |
qqx | mrichez: the first argument to In is of type Eval, where a string is expected because the second argument is a dict, maybe? | 08:21 |
mrichez | cedk: mydict is the return of a class method: https://codereview.tryton.org/292521002/diff/365521002/modules/product/product.py#newcode140 | 08:31 |
mrichez | qqx: yes, i want to check if value of a field is in a dict | 08:32 |
qqx | mrichez: 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 |
mrichez | qqx: so my question.. :-) thank you! | 08:35 |
qqx | Also as an aside, the source is using 'assert' for logic. Isn't python 'assert' meant for debugging and is stripped on optimization? | 08:36 |
cedk | mrichez: PYSON.In does not support to test PYSON key in dict | 08:36 |
cedk | mrichez: I guess the assert should support PYSON key | 08:37 |
cedk | mrichez: in https://hg.tryton.org/trytond/file/tip/trytond/pyson.py#l492 | 08:38 |
mrichez | cedk: so it should be a feature ? or i have to find another way to test my key ? | 08:42 |
mrichez | cedk: asert .... or isinstance(key, PYSON) ? | 08:43 |
cedk | mrichez: I guess it could be a new feature if it works | 08:46 |
mrichez | cedk: i'm testing | 08:46 |
mrichez | cedk: i paste same code as here: https://hg.tryton.org/trytond/file/tip/trytond/pyson.py#l443 for "In" | 08:48 |
mrichez | cedk: ok, working ! :-) | 08:52 |
mrichez | cedk: i mean tests are working :-), now will try with a demo | 08:52 |
cedk | mrichez: I think you must add a test for this case | 08:53 |
mrichez | cedk: you mean in the feature issue ? | 08:54 |
cedk | mrichez: yes to add this new behavior to PYSON | 08:55 |
mrichez | cedk: ok | 08:55 |
-!- udono(~udono@048-130-067-156.ip-addr.inexio.net) has joined #tryton | 09:12 | |
LordVan | Hi | 09:13 |
LordVan | I was wondering | 09:13 |
LordVan | would it be possibl to use the CSV importer in the tryton client | 09:13 |
LordVan | to import just sale line data into the currently open sale? | 09:13 |
cedk | LordVan: you would need to have a window displaying the sale lines and fill the sale field | 09:20 |
cedk | LordVan: 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 updated | 09:22 |
LordVan | so 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 |
cedk | LordVan: yes the header should be something like: id,lines/product,lines/quantity,… | 09:25 |
LordVan | nice .. 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 it | 09:25 |
mrichez | One 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 |
cedk | LordVan: the ID can be found in "View logs" | 09:31 |
LordVan | cedk, oh nice I did not know. thanks | 09:31 |
cedk | mrichez: run-tests.py test_pyson | 09:31 |
mrichez | cedk: thanks :-) | 09:32 |
-!- LordVan(~LordVan@gentoo/developer/lordvan) has joined #tryton | 11:11 | |
-!- SISalp(~SISalp@51.sisalp.net) has left #tryton | 11:22 | |
-!- SISalp(~SISalp@51.sisalp.net) has joined #tryton | 11:39 | |
LordVan | cedk, 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 #tryton | 11:44 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 12:07 | |
cedk | LordVan: by default it search by rec_name | 12:16 |
LordVan | oh nice. that would be even easier if we could add that | 12:17 |
LordVan | I might just prepare a spreadsheet for the office staff with the data and some examples to copy | 12:18 |
LordVan | because for some things data entry in a table is easier than seperate pages/forms for each entry | 12:18 |
cedk | LordVan: you can set the list as editable | 12:19 |
cedk | LordVan: you can also on editable list use copy/paste | 12:20 |
LordVan | what list do you mean now? | 12:20 |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 12:26 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 12:26 | |
LordVan | cedk, what do you mean with "editable list" ? | 12:29 |
udono | LordVan: hi, see account_statement. you can enter lines directly in the table, thats am editable list | 12:37 |
LordVan | udono, yes like translations too | 12:37 |
LordVan | but i thought he meant it can be set in the UI | 12:38 |
LordVan | but i think i misunderstood and it has to be done in code? | 12:38 |
udono | LordVan: yes, must be done in code | 12:39 |
LordVan | I wonder if that would be feasible for sale lines .. hmm | 12:39 |
LordVan | I hadn'T actually thought about that but that could be super useful | 12:39 |
LordVan | thanks cedk and udono | 12:39 |
udono | LordVan: 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 |
LordVan | udono, i shall have a look. thanks | 12:43 |
-!- KyrillKlaus(~5abb3c89@ircip2.mibbit.com) has joined #tryton | 13:16 | |
KyrillKlaus | Hello | 13:16 |
acaubet | I have a ir.rule to restrict the records to a new users group, it works ok allowing only to see the records on the domain | 13:38 |
acaubet | but now the admin (or other groups with privileges) can not see those records, which I'm missing? | 13:39 |
acaubet | what* I'm missing? | 13:39 |
acaubet | this is my domain eval="[('agent.party', '=', Eval('user.party', {}))]" | 13:40 |
acaubet | note that I have added the field party on res_user | 13:41 |
mrichez | acaubet: maybe you should test if user is in specific group and bypass domain eval | 13:43 |
cedk | acaubet: rule define who can see the records so if no rule exist for admin group, he will not see them | 13:45 |
cedk | so you probably need to define a rule that allow to see all records for the admin group | 13:46 |
acaubet | okey, will try that, make sense | 13:47 |
acaubet | I 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 rule | 14:35 |
acaubet | the testing user only have the specific grup with the rule mentioned above | 14:36 |
-!- timitos(~kpreisler@2001:a61:4ac:5b01:762b:62ff:fe84:ed7e) has joined #tryton | 15:12 | |
-!- qqx(~qqx@142.159.90.146.dyn.plus.net) has joined #tryton | 16:37 | |
-!- qqx(~qqx@142.159.90.146.dyn.plus.net) has joined #tryton | 20:56 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!