irc.libera.chat #tryton log beginning Sat Oct 7 12:10:01 AM CEST 2023 | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 22:56 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 22:56 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 06:16 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 06:16 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 07:23 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 07:23 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 07:50 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 07:50 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 09:10 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 09:10 | |
-!- srgdts(~srgdts@user/srgdts) has joined #tryton | 10:39 | |
nickbnf | hello together! | 11:00 |
---|---|---|
nickbnf | First of all thank you for a great ERP | 11:00 |
nickbnf | Ca any body help me with a sale.sale report? | 11:01 |
nickbnf | cedk: hi Cedk, are you here? | 11:21 |
cedk | nickbnf: hi what is your question? (ask directly instead of asking permission) | 12:45 |
cedk | nickbnf: if it is complex you may ask on https://discuss.tryton.org/c/support | 12:51 |
-!- udono(~udo@183-153-117-131.ip-addr.inexio.net) has joined #tryton | 13:01 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 13:55 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 13:55 | |
nickbnf | cedk: both default templates for account.sale:report and sale.sale:report are created ina way, that they are iterating over all entries in "records", which is fine, as log as you are staying away from headers and footers. | 14:49 |
nickbnf | cedk: through several experiments I have find out, that nether header of footer are away for a current "item from records" | 14:50 |
nickbnf | cedk: onr can say they did not know the current "index of an iteration" | 14:50 |
nickbnf | cedk: here is my use case: I am trying to put following Quotation/Invoice attirbutes {quotation|sale type, date, (customer)party.code, (customer) party.tax_id, (quotation|sale)record.full_number} in to a header | 14:53 |
nickbnf | cedk: reason behind this is to able to identify to what matter all pages are related | 14:54 |
nickbnf | cedk: it is special important if you have a quotation, which must be signed by a customer | 14:55 |
nickbnf | cedk: and without such "header of footer based" identification is not possible to proove later, what Quotation has customer actually signed | 14:56 |
nickbnf | cedk: I am also confused, why each report is getting a list of records instead of a one | 14:57 |
nickbnf | cedk: thank you in advance! And if IRC is wrong plac for this descussion, just tell and I will post it at discuss.tryton.org | 14:58 |
cedk | nickbnf: OpenDocument format allows only a songle content of header and footer | 14:58 |
nickbnf | cedk: you can still iterate records in header | 14:59 |
cedk | nickbnf: so you must group records by header_key | 15:00 |
nickbnf | cedk: one can try to group them, but the issue is that you are getting "potentially" multiple records, that you are iterating throug in a document body. And in my case it looks like you have 3 separate areas {header, body, footer} where you have no way to know "sync" an iteration of a body part | 15:03 |
nickbnf | cedk: or have you ment, that there is possibility to wolkaround this through some kid of header_key mapping? | 15:04 |
cedk | nickbnf: Report.header_key will generate one report per key | 15:18 |
nickbnf | cedk: seems promising. How one can make a use of a Report.header_key? Modify esisting report, create a new one, or it is just a matter of sime setting? | 15:20 |
nickbnf | cedk: just trying to understand where Report.header_key can fe found and how one can propper use it | 15:21 |
cedk | nickbnf: it is already used for the sale report through the CompanyReport to goup record from the same company | 15:23 |
cedk | because we put in the header the company header (idem for footer) | 15:23 |
nickbnf | cedk: so "account.invoice" Report and "sale.sale" Repors are already grouped and are called with "len(records) == 1"? | 15:25 |
nickbnf | cedk: and it it safe in this context to access curent customer party over "records[0]"? | 15:26 |
nickbnf | cedk: thank you again for your time, I know you are making it in your spare time. | 15:27 |
cedk | nickbnf: no they are grouped per company | 15:28 |
cedk | in the header/footer of template, it is only safe to access header data | 15:29 |
cedk | the CompanyReport put in the context the header['company'] (for backward compatibiliy) | 15:29 |
nickbnf | cedk: are you talking about header | 15:30 |
nickbnf | and footer fields by a company? | 15:30 |
cedk | nickbnf: no the header key in the evaluation context of the report | 15:31 |
cedk | just like records | 15:31 |
nickbnf | cedk: ah so there is "header" key available in a report evaluation scope that one can access | 15:33 |
cedk | nickbnf: yes | 15:33 |
cedk | it is filled by the values returned by Report.header_key | 15:34 |
cedk | which is a tuple of couple (key, value) | 15:34 |
nickbnf | cedk: so it a list of pairs? | 15:34 |
nickbnf | cedk: looks promising! And how one can add some data in this list? | 15:35 |
nickbnf | cedk: over gui? over some party attributes? | 15:36 |
nickbnf | cedk: I am new to tryton have just installed it one month ago, so it is possible that my question are dumb | 15:36 |
cedk | nickbnf: you need to extend the Report subclass of the report | 15:39 |
cedk | like https://docs.tryton.org/projects/server/en/latest/tutorial/module/extend.html but for report | 15:39 |
nickbnf | cedk: so it is only possible throug creating a tryton module or patching tryton which is less good option | 15:41 |
nickbnf | cedk: I will try to play around with it. | 15:43 |
nickbnf | cedk: can such functionality be interresting for a tryton mainline or it is only my crazy special case? | 15:44 |
cedk | I do not think | 15:49 |
cedk | ACTION bbl | 15:50 |
-!- udono(~udo@183-153-117-131.ip-addr.inexio.net) has joined #tryton | 19:06 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 21:05 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 21:05 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!