irc.libera.chat #tryton log beginning Tue Jan 4 12:00:01 AM CET 2022 | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 00:40 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 00:40 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 06:13 | |
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton | 06:40 | |
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton | 08:01 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 08:59 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 08:59 | |
-!- rpit(~rpit@p4ffb7220.dip0.t-ipconnect.de) has joined #tryton | 10:03 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 13:09 | |
-!- udono(~udono@013-129-067-156.ip-addr.inexio.net) has joined #tryton | 13:38 | |
-!- springwurm_(~springwur@5.104.149.54) has joined #tryton | 13:51 | |
-!- rpit(~rpit@p200300c88f3e0900e532e79838eb182a.dip0.t-ipconnect.de) has joined #tryton | 13:54 | |
-!- LordVan(~lordvan@gentoo/developer/lordvan) has joined #tryton | 14:27 | |
LordVan | hi | 14:33 |
---|---|---|
LordVan | i'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 fields | 14:34 |
cedk | LordVan: default can not depend on other fields | 14:34 |
cedk | LordVan: if you want to copy data from sale line to stock move, you must fill them when sale line create the move | 14:35 |
LordVan | cedk, oh i did not know that. but I guess it makes sense now that I think about it. | 14:36 |
LordVan | cedk, could you by chance point me to some module that does that (or something similar) ? | 14:36 |
LordVan | since I did nto see something like on_change_origin or so yet ? | 14:42 |
udono | LordVan: take a look here: https://hg.tryton.org/modules/sale/file/tip/sale.py#l1596 | 14:44 |
LordVan | udono, 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 |
LordVan | udono, 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 |
LordVan | since I assume SaleLine.get_move would not be called when I assign it manually? | 14:55 |
cedk | LordVan: you can put the logic in on_change_origin and call it in get_move | 15:02 |
LordVan | cedk, 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 |
LordVan | will try that now | 15:03 |
cedk | LordVan: 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 case | 15:11 |
cedk | we just ensure data coherence like same uom category | 15:12 |
LordVan | cedk, 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 #tryton | 15:23 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 15:23 | |
LordVan | cedk, 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 |
cedk | LordVan: UI events are plugged automatically based on function name | 16:02 |
cedk | so on_change_<field> is triggered when the named field is changed | 16:03 |
LordVan | cedk, I was hoping you'd say that. awesome :) | 16:31 |
LordVan | what would be the best place to assure that certain input fields are strip()ed? | 16:36 |
cedk | LordVan: there is https://bugs.tryton.org/issue7914 | 16:48 |
-!- Pegasus_RPG(~Thunderbi@2603-6000-8400-cd5f-0000-0000-0000-18ea.res6.spectrum.com) has joined #tryton | 18:15 | |
LordVan | cedk, ah yes i remember seeing that before | 18:48 |
-!- rpit(~rpit@p200300c88f3e0900e532e79838eb182a.dip0.t-ipconnect.de) has joined #tryton | 19:06 | |
LordVan | hmm 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 |
LordVan | why 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 | -----+----------------------------+---------------- | 19:20 |
LordVan | 126 | 2022-01-04 19:15:16.059045 | sale.line,5499 | 19:20 |
LordVan | 127 | 2022-01-04 19:15:16.059045 | stock.move,126 | 19:20 |
LordVan | why is that there? | 19:21 |
LordVan | i mean i think i found where it happens (shipment._get_inventory_move) but why is that done? | 19:39 |
LordVan | sometimes 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 whatnot | 20:29 |
-!- Pegasus_RPG(~Thunderbi@2603-6000-8400-cd5f-0000-0000-0000-18ea.res6.spectrum.com) has joined #tryton | 20:30 | |
LordVan | anyone here who knows about (odt) templates and can maybe help me quickly with a (very annoying) problem | 20:42 |
udono | LordVan: 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 |
LordVan | udono, 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 |
udono | LordVan: it is a feature, not a bug. | 20:52 |
LordVan | udono, is it though? haha | 20:52 |
LordVan | hmm that is still not working though .. lemme look at the fodt | 20:53 |
LordVan | this doesn't seem to work inside a <table> element somehow .. | 20:55 |
udono | LordVan: having lewlines between controllstructure should work always. | 20:55 |
LordVan | table:table-cell i mean | 20:55 |
udono | newlines | 20:55 |
LordVan | i want no newlinesi n my output though | 20:55 |
LordVan | being the whole point of the if | 20:55 |
udono | so better use: | 20:55 |
udono | if test="ddd" | 20:55 |
udono | <variable> | 20:55 |
udono | /if | 20:55 |
LordVan | ah wait | 20:56 |
LordVan | it removes the newlines automatically then | 20:56 |
LordVan | i forgot | 20:56 |
LordVan | (still annoying that it does this stuff^^) | 20:56 |
udono | LordVan: it removes the surrounding xml-tag which is <p> I guess | 20:57 |
LordVan | there is no <p> but yeah | 20:57 |
udono | LordVan: Problem solved? | 20:58 |
LordVan | https://dpaste.org/kdRr | 20:58 |
LordVan | yes | 20:58 |
LordVan | jsut so you know what i mean | 20:58 |
LordVan | thanks | 20:58 |
udono | Ah, I meant <text:p> instead of <p> | 20:59 |
LordVan | was this metnioned in and (tryton) docs though? if not it should be imho ^ | 21:00 |
LordVan | now 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 guess | 21:01 |
udono | LordVan: Actually it is how genshi works. | 21:01 |
LordVan | udono, 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 problem | 21:03 |
udono | LordVan: maybe a discuss question and answer would be better?! | 21:03 |
LordVan | yeah maybe | 21:03 |
LordVan | Do 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 |
LordVan | because then i have aproblem with delivery notes that has no subtotal/tilte lines | 21:09 |
cedk | the behavior is not related to Genshi but relatorio which tries to insert the placeholder directive inside the OpenDocument XML in the most expected way | 21:11 |
udono | LordVan: better forget it with multipage. If you really think you must have it, see https://discuss.tryton.org/t/multipage-invoice-reports/3911 | 21:12 |
cedk | the relatorio documentation could receive some love because for now it is only based on example without describing how the directives behave | 21:12 |
LordVan | udono, i don't think I can just not have multipage | 21:12 |
LordVan | i 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 |
cedk | now 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 https://github.com/edgewall/genshi/pull/45 or disable the translation of the report | 21:14 |
LordVan | cedk, i am not using choose just IF | 21:15 |
cedk | LordVan: a directive is a dicrective | 21:15 |
LordVan | disabling translation might be a good alternative as I do not need it . although the whitespace workaround is ok with me | 21:15 |
LordVan | cedk, of course | 21:15 |
LordVan | my 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 lines | 21:16 |
LordVan | meaning 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 |
LordVan | i might have to discuss that requirement with management .. | 21:18 |
udono | LordVan: Are you using kits? | 21:22 |
udono | or other components? | 21:22 |
LordVan | yes | 21:22 |
LordVan | product_kit is used | 21:22 |
udono | LordVan: 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 |
udono | LordVan: But I am not sure if it is related. | 21:25 |
LordVan | udono, hmm maybe but i have plenty of orders without any product kits and i still would like a table header on those 2nd pages | 21:25 |
udono | LordVan: table header on 2nd pages is just a table preference in Libre office. | 21:26 |
LordVan | wait .. it is? (not a heavy office application user here i have to admit) | 21:27 |
udono | https://help.libreoffice.org/6.2/en-US/text/swriter/guide/table_repeat_multiple_headers.html | 21:29 |
LordVan | yeah i found it already | 21:29 |
LordVan | i really was not aware of taht (never needed it before in a writer document) | 21:29 |
LordVan | thanks for pointing that out | 21:29 |
LordVan | that 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 |
LordVan | that now means i just have to re-sort lines and "merge" them for my report | 21:36 |
LordVan | [layout fixes aside] | 21:36 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!