chat.freenode.net #tryton log beginning Sun May 2 12:00:01 AM CEST 2021 | ||
-!- mniip(mniip@freenode/staff/mniip) has joined #tryton | 23:28 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 23:32 | |
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton | 05:00 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 07:37 | |
-!- irclog(~irclog@moretus.b2ck.com) has joined #tryton | 08:39 | |
-!- thaneor(~ldlc6@r167-61-148-122.dialup.adsl.anteldata.net.uy) has joined #tryton | 08:43 | |
-!- thaneor1(~acer8@r167-61-148-122.dialup.adsl.anteldata.net.uy) has joined #tryton | 08:44 | |
-!- ludo2(~Thunderbi@2001:912:1480:380::1) has joined #tryton | 08:50 | |
LordVan | hi. 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 it | 09:12 |
---|---|---|
-!- udono(~udono@098-131-067-156.ip-addr.inexio.net) has joined #tryton | 09:49 | |
cedk | LordVan: I do not understand why you inherit from CompanyReport | 11:48 |
cedk | LordVan: are you sure to register this class to extend the original SaleReport? | 11:48 |
LordVan | ah | 15:48 |
LordVan | yes makes sense | 15:48 |
LordVan | cedk, 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 |
LordVan | https://dpaste.org/FpfV | 15:55 |
cedk | LordVan: you inherit from nothing but use the PoolMeta as metaclass and register it in the Pool as report | 15:55 |
LordVan | ah so SaleReport(metaclass=PoolMeta): . | 15:56 |
LordVan | ic | 15:56 |
LordVan | ah crap i just noticed some other copy paste mistake | 15:57 |
LordVan | too much trial and error | 15:58 |
LordVan | XD | 15:58 |
LordVan | hmm still not working but i probably am doing something wrong registering .. I shall paste the code | 15:59 |
LordVan | cedk, https://dpaste.org/tC4W | 16:00 |
cedk | LordVan: is your module depending on sale module? | 16:08 |
LordVan | yes | 16:09 |
LordVan | cedk, https://github.com/LordVan/tryton-modules/tree/master/rm_extra_data <- not including the current attempts with the report ofc | 16:09 |
LordVan | the rest of it works ok so the problem must be with the report stuff itself | 16:11 |
cedk | LordVan: as you can see in the traceback your class is not in the stack | 16:11 |
LordVan | yes but i am unsure why | 16:11 |
LordVan | the code in the paste is all i changed form what is on my github | 16:12 |
LordVan | ok .. 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.sale | 17:37 |
LordVan | but it does not seem to inherit the original sale report class properl ynow? .. hmm | 17:38 |
LordVan | ok 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 #tryton | 17:47 | |
LordVan | what 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 |
LordVan | never mind | 18:11 |
LordVan | i just make a list and use .sort(key=lambda..) | 18:11 |
mrichez | LordVan: i did this way (example from custom code): https://pastebin.com/KBA3cwt3 | 19:13 |
mrichez | LordVan: it's to allow to order function field in sale lines | 19:15 |
LordVan | mrichez, 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 case | 19:15 |
mrichez | LordVan: ok :-) | 19:15 |
LordVan | since i do not want to change the actual order | 19:16 |
LordVan | btw | 19:16 |
LordVan | ah he's gone | 19:16 |
LordVan | never mind then ;) | 19:16 |
LordVan | hm | 19:31 |
LordVan | i 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 |
LordVan | can 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 |
LordVan | actually never mind | 19:47 |
LordVan | i do it the other way and change the template | 19:47 |
LordVan | makes more sense in the long runa nd is more flexible anyway | 19:47 |
-!- thaneor2(~acer8@r167-61-148-34.dialup.adsl.anteldata.net.uy) has joined #tryton | 20:29 | |
-!- thaneor(~ldlc6@r167-61-148-34.dialup.adsl.anteldata.net.uy) has joined #tryton | 20:47 | |
LordVan | just 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/!