IRC logs of #tryton for Tuesday, 2022-01-04 #tryton log beginning Tue Jan 4 12:00:01 AM CET 2022
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton00:40
-!- ChanServ changed mode/#tryton -> +o cedk 00:40
-!- springwurm(~springwur@ has joined #tryton06:13
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton06:40
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton08:01
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:59
-!- ChanServ changed mode/#tryton -> +o cedk 08:59
-!- rpit( has joined #tryton10:03
-!- springwurm(~springwur@ has joined #tryton13:09
-!- udono( has joined #tryton13:38
-!- springwurm_(~springwur@ has joined #tryton13:51
-!- rpit( has joined #tryton13:54
-!- LordVan(~lordvan@gentoo/developer/lordvan) has joined #tryton14:27
LordVani'm trying to extend stock.move to include some custom fields but am struggling with some defaults -- i am trying to use defaults to get the data from the SaleLine referenced to pre-fill my fields14:34
cedkLordVan: default can not depend on other fields14:34
cedkLordVan: if you want to copy data from sale line to stock move, you must fill them when sale line create the move14:35
LordVancedk, oh i did not know that. but I guess it makes sense now that I think about it.  14:36
LordVancedk, could you by chance point me to some module that does that (or something similar) ?14:36
LordVansince I did nto see something like on_change_origin or so yet ?14:42
udonoLordVan: take a look here:
LordVanudono, thanks .. I was focusing on reading the stock module code right now to figure out where to do it but you are right of course sale get_move makes more sense ^^14:45
LordVanudono, but I was wondering would Move.assign() also be a viable option (for the rare case, that someone assigns the origin later on?)14:48
LordVansince I assume SaleLine.get_move would not be called when I assign it manually?14:55
cedkLordVan: you can put the logic in on_change_origin and call it in get_move15:02
LordVancedk, thanks. It is always better to do it the way it was intended to be done (in tryton) than to just do some hack that I happen to come up with ;)15:03
LordVanwill try that now15:03
cedkLordVan: but I must say we do not fill stock move if sale line is set as origin in standard so I do not think you have to worry about this case15:11
cedkwe just ensure data coherence like same uom category15:12
LordVancedk, yeah i just want to pre-fill it with info that comes from the sale line (if entered) which in turn comes from products (but could be changed in the sale line)15:21
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton15:23
-!- ChanServ changed mode/#tryton -> +o cedk 15:23
LordVancedk, I am not sure how to make the event trigger (so far i haven't defined any own, but just overwritten existing ones) .. would I have to make origin a Function field for that?15:28
cedkLordVan: UI events are plugged automatically based on function name16:02
cedkso on_change_<field> is triggered when the named field is changed16:03
LordVancedk, I was hoping you'd say that. awesome :)16:31
LordVanwhat would be the best place to assure that certain input fields are strip()ed?16:36
cedkLordVan: there is
-!- Pegasus_RPG( has joined #tryton18:15
LordVancedk, ah yes i remember seeing that before18:48
-!- rpit( has joined #tryton19:06
LordVanhmm this is odd .. I added get_move which calls my on_change_origin method on the Move .. but ..why does every move like that create 2 moves one with an origin as the sale_line and one with an origin as the move (before) that references the sale line?19:19
LordVanwhy is there an extra "row"(SQL wise) ... gonna have to read that code again .. but just to show hwat i mean:19:20
LordVan id  |        create_date         |     origin     19:20
LordVan 126 | 2022-01-04 19:15:16.059045 | sale.line,549919:20
LordVan 127 | 2022-01-04 19:15:16.059045 | stock.move,12619:20
LordVanwhy is that there?19:21
LordVani mean i think i found where it happens (shipment._get_inventory_move) but why is that done?19:39
LordVansometimes i hate genshi (for the reports)20:27
LordVan(it complaining about not fininding ancestor or closing tag when they are there just cuz of some whitespace missing or whatnot20:29
-!- Pegasus_RPG( has joined #tryton20:30
LordVananyone here who knows about (odt) templates and can maybe help me quickly with a (very annoying) problem20:42
udonoLordVan: genshi removes the whole surrounding XML-Tag, when using a control structure. So sometimes the whole paragraph is removed when eval an if/when-condition to true. In this case make the if/when-condition italic, so the surrounding XML-Tag is the italic formatting, but not the whole paragraph. Also you can open the fodt file in a text editor and analys the problem.20:50
LordVanudono, aaah i will try that thanks .. I thought I had heard about some workaround before .. although .. is there no way to somehow fix this in genshi?20:51
udonoLordVan: it is a feature, not a bug.20:52
LordVanudono, is it though? haha20:52
LordVanhmm that is still not working though .. lemme look at the fodt20:53
LordVanthis doesn't seem to work inside a <table> element somehow ..20:55
udonoLordVan: having lewlines between controllstructure should work always.20:55
LordVantable:table-cell i mean20:55
LordVani want no newlinesi n my output though20:55
LordVanbeing the whole point of the if20:55
udonoso better use:20:55
udonoif test="ddd"20:55
LordVanah wait20:56
LordVanit removes the newlines automatically then20:56
LordVani forgot20:56
LordVan(still annoying that it does this stuff^^)20:56
udonoLordVan: it removes the surrounding xml-tag which is <p> I guess20:57
LordVanthere is no <p> but yeah20:57
udonoLordVan: Problem solved?20:58
LordVanjsut so you know what i mean20:58
udonoAh, I meant <text:p> instead of <p>20:59
LordVanwas this metnioned in and (tryton) docs though? if not it should be imho ^  21:00
LordVannow I gotta figure out how I would have to deal with possible tables that are longer than one page so I have a header again .. time to look at existing tempaltes i guess21:01
udonoLordVan: Actually it is how genshi works.21:01
LordVanudono, yes but I meant that it might be good to mention it in tryton docs as I am fairly sure i am not the first (or last) to run into this problem21:03
udonoLordVan: maybe a discuss question and answer would be better?!21:03
LordVanyeah maybe21:03
LordVanDo I see it correctly that the best way to deal with multi page templates with tables (like an invoice that spans more than one page cuz it is just that long) is best dealt by putting subtotal or title lines into it?21:06
LordVanbecause then i have aproblem with delivery notes that has no subtotal/tilte lines21:09
cedkthe behavior is not related to Genshi but relatorio which tries to insert the placeholder directive inside the OpenDocument XML in the most expected way21:11
udonoLordVan: better forget it with multipage. If you really think you must have it, see
cedkthe relatorio documentation could receive some love because for now it is only based on example without describing how the directives behave21:12
LordVanudono, i don't think I can just not have multipage21:12
LordVani just noticed that subtotal or title SaleLines are not actually copied to Invoice (which does not surprise me after I read the code earler)21:13
cedknow on recent trytond version we use the translation tool from Genshi but it behaves badly and can result in relatorio removing too much, the fix is or disable the translation of the report21:14
LordVancedk, i am not using choose just IF21:15
cedkLordVan: a directive is a dicrective21:15
LordVandisabling translation might be a good alternative as I do not need it . although the whitespace workaround is ok with me21:15
LordVancedk, of course21:15
LordVanmy biggest problem right now is that i want to "merge" move lines with the same origin SaleLine to show the total of a certain product instead of showing it twice in different places -- while keeping subtotal or title lines21:16
LordVanmeaning more than one stock moves as we might not deliver everything at once .. i could just create my own list and re-sort it instead of outgoing_moves but the probme there would be how the hell would I keep my subtotal/title lines 21:17
LordVan(the requirement that invoice lines have to be in the same order as sale lines is annoying)21:17
LordVani might have to discuss that requirement with management ..21:18
udonoLordVan: Are you using kits?21:22
udonoor other components?21:22
LordVanproduct_kit is used21:22
udonoLordVan: so it could help, when you carefully check your requirements and the difference with products type 'good' and products type 'kit' both using components...21:24
udonoLordVan: But I am not sure if it is related.21:25
LordVanudono, hmm maybe but i have plenty of orders without any product kits and i still would like a table header on those 2nd pages21:25
udonoLordVan: table header on 2nd pages is just a table preference in Libre office.21:26
LordVanwait .. it is? (not a heavy office application user here i have to admit)21:27
LordVanyeah i found it already21:29
LordVani really was not aware of taht (never needed it before in a writer document)21:29
LordVanthanks for pointing that out21:29
LordVanthat solves most of my issues(except subtotal but if that is the only thing missing i can probably convince them we don't need it anymore now that we use tryton instead of just libreoffice calc)21:30
LordVanthat now means i just have to re-sort lines and "merge" them for my report21:36
LordVan[layout fixes aside]21:36

Generated by 2.17.3 by Marius Gedminas - find it at!