irc.libera.chat #tryton log beginning Fri Oct 14 12:00:01 AM CEST 2022 | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 22:00 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 22:00 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 05:16 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 06:17 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 06:17 | |
-!- tbruyere(~Thunderbi@82.187-182-91.adsl-dyn.isp.belgacom.be) has joined #tryton | 06:21 | |
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton | 06:40 | |
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton | 07:18 | |
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton | 07:46 | |
-!- LordVan(~LordVan@gentoo/developer/lordvan) has joined #tryton | 08:59 | |
LordVan | Hi. I got a weird issue with my Sale.on_change_party: https://dpaste.org/NmZSK | 08:59 |
---|---|---|
LordVan | the warning is displayed and it works . but for some reason when the warning is displayed my party is set to None unless I select the party again? | 09:00 |
cedk | LordVan: you can not raise exception in on_change | 09:11 |
LordVan | cedk, but the UserError i had in there worked just fine .. the problem is only with the warning ? | 09:11 |
cedk | LordVan: no it is for any Exception | 09:12 |
cedk | on_change is not allowed to raise exception | 09:13 |
LordVan | i was not aware of that | 09:13 |
LordVan | but .. how come my previous code did work just fine then? https://github.com/LordVan/tryton-modules/blob/39549e508f9d94ff266a87012d90595d1c47c0eb/rm_extra_data/sale.py#L67 | 09:13 |
LordVan | cedk, but if you say exceptions are not allowed in on_change_* .. how would I do a check like the one I need and display the error/warning to the user ? | 09:21 |
LordVan | also if exceptions are not allowed it might be good to put that in https://docs.tryton.org/projects/server/en/latest/topics/models/fields_on_change.html | 09:25 |
cedk | LordVan: you can raise error on button action or create/write/delete | 09:55 |
cedk | LordVan: indeed it will be good to extend the documentation, waiting your patch :-) | 09:56 |
LordVan | cedk, yeah I was thinking of doing it while saving or changing state (I just prefer it immediately after changing party, but if that is not something that should be done then I will change it) | 09:59 |
LordVan | that documentation is in the redthedocs repo right? | 10:00 |
-!- nicoe(~nicoe@2a02:2788:54:1ff:18c2:1aff:fef9:2b7f) has joined #tryton | 10:03 | |
cedk | LordVan: no in each repo | 10:19 |
cedk | LordVan: so for general doc it is in trytond | 10:19 |
-!- mrichez(~Maxime@mail.saluc.com) has joined #tryton | 11:06 | |
LordVan | cedk, ok i shall look later. as for where to put the warnings /errors .. would it be better to override save() or just put it into quote/confirm/processing? | 11:14 |
LordVan | never mind the save thing .. I'll do my checks in quote and confirm :) | 11:16 |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 12:13 | |
-!- nicoe(~nicoe@2a02:2788:54:1ff:18c2:1aff:fef9:2b7f) has joined #tryton | 12:22 | |
cedk | LordVan: usually checks are better on wokflow transitions | 12:29 |
mrichez | hi, in module sale_stock_quantity, should warehouse be taken in account when removing quantities from other sales ? https://hg.tryton.org/modules/sale_stock_quantity/file/tip/sale.py#l139 | 13:31 |
cedk | mrichez: I think so | 13:56 |
cedk | mrichez: but it should search on the warehouse of the line | 13:57 |
mrichez | cedk: indeed... bug or feature ? | 14:01 |
cedk | bug | 14:11 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!