irc.libera.chat #tryton log beginning Fri Oct 8 12:00:01 AM CEST 2021 | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 23:30 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 23:30 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 05:06 | |
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton | 05:07 | |
-!- timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton | 05:32 | |
-!- udono(~udono@065-137-067-156.ip-addr.inexio.net) has joined #tryton | 06:28 | |
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton | 07:08 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 07:52 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 07:52 | |
-!- timitos(~kpreisler@134.3.92.37) has joined #tryton | 10:26 | |
-!- timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton | 11:57 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 12:09 | |
-!- LordVan(~lordvan@gentoo/developer/lordvan) has joined #tryton | 12:41 | |
LordVan | hi | 12:41 |
---|---|---|
LordVan | I got extra fields in my sale lines that I use for reports,.. now I need some of those fields data in my deliver notes .. is it recommended to just add the fields needed there too and copy the data over, or is accessing move.origin.<custom-field> the recommended way to do it | 12:42 |
LordVan | (currently leaning towards using the data directly from the sale line, but i am not sure if there could be some implications I am unaware of) | 12:44 |
udono | LordVan: It depends on the use case. When you wanted to have the exact fields from sale in delivery note, you should use the origin in the report. When you need to change the values in the shipment.out, it gets compliicated, as every move line in shipment can have another sale as origin... | 12:47 |
LordVan | udono, basically I added a field already in the sale line that will be used as part of the text in the delivery note / invoice and yes it should be exactly as on the sale line | 12:48 |
LordVan | the plan is not to change things in shipment.out anymore if avoidable | 12:49 |
LordVan | although there might have to be (potential) fixes to typos,..and if the sale is already processed it might be tricky to edit that in the sale line .. hmm | 12:49 |
LordVan | also there is some logic involved in which text to pick as some fields are optional,.. putting that in templates is possible but lengthy | 12:50 |
LordVan | I might be better off just putting the logic in the python code and just display that in the report then .. | 12:51 |
LordVan | roughly it is like this in the template: | 12:51 |
LordVan | (pseudo code) if not inv_line0_skip => inv_line0 or proj_line0 or line0 | 12:52 |
LordVan | i have that for a couple of fields because things are needed for other reports that could be needed in a report from sale, but not in a delivery note - or a different form/wording | 12:53 |
udono | We use in delivery_note the following construct to show all related sales and dates: https://dpaste.org/0YJX | 12:53 |
LordVan | interesting . thanks | 12:54 |
LordVan | actually .. in trying to explain what I need I relized that my tempalte would be super bloated if I really did all this in the template itself .. so I think to simplify the template (and make editing the delivery note text possible without going back to the sale and changing the sale line) I should probably just copy over the text I need to the stock.move into a custom field there (and do all the processing in python when the stock moves are | 12:56 |
LordVan | created) | 12:56 |
LordVan | gonna have to see which method creates the lines and where I can copy my data .. | 12:58 |
LordVan | i forgot how complex this all is .. can someone give me a pointer as to where (which method,..) I'd best put in code taht fills in custom fields for delivery notes from the sale_line data? | 13:08 |
LordVan | I was thinking Move.draft() seems reasonable .. that way the data woudl get copied as soon as the delivery note gets put in "draft" State | 13:22 |
-!- rs[m](~rsinframa@2001:470:69fc:105::ea2) has joined #tryton | 13:22 | |
cedk | LordVan: copying data is most of the time bad | 13:33 |
cedk | LordVan: just create a Function field that will search for the right data | 13:33 |
LordVan | cedk, yes i know but there might need to be some adjustments/fixes if someone messed up the original sale line - potentially - | 13:34 |
LordVan | otherwise would have to go back to the sale, fix the sale line then go back to the delivery note | 13:34 |
LordVan | cedk, but i like the idea of a function field (not sure how to go about that exactly so i can use it from the template though) | 13:35 |
LordVan | I only copy data where it is needed for "historical" purposes (meaning where we need the data in a certain place unchanged even if e.g. the product is changed) | 13:36 |
LordVan | that said the sale and sale lines in extension of that are unchangeable once done anyway (afaik) so i could use that and have a look at the function field ... I certainly prefer that over copying data again | 13:38 |
cedk | pokoli: hi do you think you could finish https://bugs.tryton.org/issue10536 today? I would like to finalize https://bugs.tryton.org/issue10269 which depend on it | 16:12 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!