IRC logs of #tryton for Friday, 2022-10-14

irc.libera.chat #tryton log beginning Fri Oct 14 12:00:01 AM CEST 2022
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton22:00
-!- ChanServ changed mode/#tryton -> +o cedk 22:00
-!- springwurm(~springwur@5.104.149.54) has joined #tryton05:16
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:17
-!- ChanServ changed mode/#tryton -> +o cedk 06:17
-!- tbruyere(~Thunderbi@82.187-182-91.adsl-dyn.isp.belgacom.be) has joined #tryton06:21
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton06:40
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton07:18
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton07:46
-!- LordVan(~LordVan@gentoo/developer/lordvan) has joined #tryton08:59
LordVanHi. I got a weird issue with my Sale.on_change_party: https://dpaste.org/NmZSK08:59
LordVanthe 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
cedkLordVan: you can not raise exception in on_change09:11
LordVancedk, but the UserError i had in there worked just fine .. the problem is only with the warning ?09:11
cedkLordVan: no it is for any Exception09:12
cedkon_change is not allowed to raise exception09:13
LordVani was not aware of that 09:13
LordVanbut .. 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
LordVancedk, 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
LordVanalso 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.html09:25
cedkLordVan: you can raise error on button action or create/write/delete09:55
cedkLordVan: indeed it will be good to extend the documentation, waiting your patch :-)09:56
LordVancedk, 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
LordVanthat documentation is in the redthedocs repo right?10:00
-!- nicoe(~nicoe@2a02:2788:54:1ff:18c2:1aff:fef9:2b7f) has joined #tryton10:03
cedkLordVan: no in each repo10:19
cedkLordVan: so for general doc it is in trytond10:19
-!- mrichez(~Maxime@mail.saluc.com) has joined #tryton11:06
LordVancedk, 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
LordVannever mind the save thing .. I'll do my checks in quote and confirm :)11:16
-!- springwurm(~springwur@5.104.149.54) has joined #tryton12:13
-!- nicoe(~nicoe@2a02:2788:54:1ff:18c2:1aff:fef9:2b7f) has joined #tryton12:22
cedkLordVan: usually checks are better on wokflow transitions12:29
mrichezhi, 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#l13913:31
cedkmrichez: I think so13:56
cedkmrichez: but it should search on the warehouse of the line13:57
mrichezcedk: indeed... bug or feature ?14:01
cedkbug14:11

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