IRC logs of #tryton for Friday, 2021-10-08 #tryton log beginning Fri Oct 8 12:00:01 AM CEST 2021
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:30
-!- ChanServ changed mode/#tryton -> +o cedk 23:30
-!- springwurm(~springwur@ has joined #tryton05:06
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton05:07
-!- timitos( has joined #tryton05:32
-!- udono( has joined #tryton06:28
-!- acaubet(~Thunderbi@ has joined #tryton07:08
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton07:52
-!- ChanServ changed mode/#tryton -> +o cedk 07:52
-!- timitos(~kpreisler@ has joined #tryton10:26
-!- timitos( has joined #tryton11:57
-!- springwurm(~springwur@ has joined #tryton12:09
-!- LordVan(~lordvan@gentoo/developer/lordvan) has joined #tryton12:41
LordVanI 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 it12: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
udonoLordVan: 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
LordVanudono, 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 line12:48
LordVanthe plan is not to change things in shipment.out anymore if avoidable12:49
LordVanalthough 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 .. hmm12:49
LordVanalso there is some logic involved in which text to pick as some fields are optional,.. putting that in templates is possible but lengthy12:50
LordVanI might be better off just putting the logic in the python code and just display that in the report then .. 12:51
LordVanroughly it is like this in the template:12:51
LordVan(pseudo code) if not inv_line0_skip => inv_line0 or proj_line0 or line012:52
LordVani 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/wording12:53
udonoWe use in delivery_note the following construct to show all related sales and dates:
LordVaninteresting . thanks12:54
LordVanactually .. 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
LordVangonna have to see which method creates the lines and where I can copy my data ..12:58
LordVani 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
LordVanI was thinking Move.draft() seems reasonable .. that way the data woudl get copied as soon as the delivery note gets put in "draft" State13:22
-!- rs[m](~rsinframa@2001:470:69fc:105::ea2) has joined #tryton13:22
cedkLordVan: copying data is most of the time bad13:33
cedkLordVan: just create a Function field that will search for the right data13:33
LordVancedk, yes i know but there might need to be some adjustments/fixes if someone messed up the original sale line - potentially -13:34
LordVanotherwise would have to go back to the sale, fix the sale line then go back to the delivery note13:34
LordVancedk, 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
LordVanI 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
LordVanthat 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
cedkpokoli: hi do you think you could finish today? I would like to finalize which depend on it16:12

Generated by 2.17.3 by Marius Gedminas - find it at!