IRC logs of #tryton for Sunday, 2021-05-02

chat.freenode.net #tryton log beginning Sun May 2 12:00:01 AM CEST 2021
-!- mniip(mniip@freenode/staff/mniip) has joined #tryton23:28
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:32
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton05:00
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton07:37
-!- irclog(~irclog@moretus.b2ck.com) has joined #tryton08:39
-!- thaneor(~ldlc6@r167-61-148-122.dialup.adsl.anteldata.net.uy) has joined #tryton08:43
-!- thaneor1(~acer8@r167-61-148-122.dialup.adsl.anteldata.net.uy) has joined #tryton08:44
-!- ludo2(~Thunderbi@2001:912:1480:380::1) has joined #tryton08:50
LordVanhi. re-posting my question from yesterday: is it not enough to  have this to make my own report with extra context data?: https://dpaste.org/QEpC -- the method is of course only a placeholder for now, but when I generate the report it just says it doesn'T find it09:12
-!- udono(~udono@098-131-067-156.ip-addr.inexio.net) has joined #tryton09:49
cedkLordVan: I do not understand why you inherit from CompanyReport11:48
cedkLordVan: are you sure to register this class to extend the original SaleReport?11:48
LordVanah15:48
LordVanyes makes sense15:48
LordVancedk, I had a thinking mistake .. how would I do it correctly though? inherit from SaleReport instead I assume, but do i need to still somehow register it then so it is used?15:50
LordVanhttps://dpaste.org/FpfV15:55
cedkLordVan: you inherit from nothing but use the PoolMeta as metaclass and register it in the Pool as report15:55
LordVanah so SaleReport(metaclass=PoolMeta): .15:56
LordVanic15:56
LordVanah crap i just noticed some other copy paste mistake15:57
LordVantoo much trial and error15:58
LordVanXD15:58
LordVanhmm still not working but i probably am doing something wrong registering .. I shall paste the code15:59
LordVancedk, https://dpaste.org/tC4W16:00
cedkLordVan: is your module depending on sale module?16:08
LordVanyes16:09
LordVancedk, https://github.com/LordVan/tryton-modules/tree/master/rm_extra_data <- not including the current attempts with the report ofc16:09
LordVanthe rest of it works ok so the problem must be with the report stuff itself16:11
cedkLordVan: as you can see in the traceback your class is not in the stack16:11
LordVanyes but i am unsure why16:11
LordVanthe code in the paste is all i changed form what is on my github16:12
LordVanok .. i found the mistake .. i had a mistake in the report definitions (internal name was wrong) for some reason it seemed to fall back to normal sale.sale17:37
LordVanbut it does not seem to inherit the original sale report class properl ynow? .. hmm17:38
LordVanok never mind that was just a typo in my code .. it works now! thanks :)17:40
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton17:47
LordVanwhat would be the easiest way to get sale lines in a particular order? - is there even such a way? (I want to sort them by a specific custom field)17:59
LordVan[but not change the actual order in the sale]17:59
LordVannever mind18:11
LordVani just make a list and use .sort(key=lambda..)18:11
mrichezLordVan: i did this way (example from custom code): https://pastebin.com/KBA3cwt319:13
mrichezLordVan: it's to allow to order function field in sale lines19:15
LordVanmrichez, interesting. thanks. though i really need to just sort it (and possibly merge/ignore some lines) when the report is generated so i think the lambda list.sort() is enough i my case19:15
mrichezLordVan: ok :-)19:15
LordVansince i do not want to change the actual order19:16
LordVanbtw19:16
LordVanah he's gone19:16
LordVannever mind then ;)19:16
LordVanhm19:31
LordVani added a string to my SaleLine class that I wanted to use as placeholder for my merging (to simplify my template code) .. but now i get an error that it is readonly?19:31
LordVancan i somehow circumvent that?19:32
LordVan(i know how i could work aroudn it but it is .. more complex and seemed pointelss)19:34
LordVanactually never mind19:47
LordVani do it the other way and change the template19:47
LordVanmakes more sense in the long runa nd is more flexible anyway19:47
-!- thaneor2(~acer8@r167-61-148-34.dialup.adsl.anteldata.net.uy) has joined #tryton20:29
-!- thaneor(~ldlc6@r167-61-148-34.dialup.adsl.anteldata.net.uy) has joined #tryton20:47
LordVanjust fyi my code works (and is in the github repo if someone wants to have a look .. i'll write a short blog entry some time soon)21:30

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