IRC logs of #tryton for Saturday, 2023-10-07

irc.libera.chat #tryton log beginning Sat Oct 7 12:10:01 AM CEST 2023
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton22:56
-!- ChanServ changed mode/#tryton -> +o cedk 22:56
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:16
-!- ChanServ changed mode/#tryton -> +o cedk 06:16
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton07:23
-!- ChanServ changed mode/#tryton -> +o cedk 07:23
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton07:50
-!- ChanServ changed mode/#tryton -> +o cedk 07:50
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:10
-!- ChanServ changed mode/#tryton -> +o cedk 09:10
-!- srgdts(~srgdts@user/srgdts) has joined #tryton10:39
nickbnfhello together!11:00
nickbnfFirst of all thank you for a great ERP11:00
nickbnfCa any body help me with a sale.sale report?11:01
nickbnfcedk: hi Cedk, are you here?11:21
cedknickbnf: hi what is your question? (ask directly instead of asking permission)12:45
cedknickbnf: if it is complex you may ask on https://discuss.tryton.org/c/support12:51
-!- udono(~udo@183-153-117-131.ip-addr.inexio.net) has joined #tryton13:01
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton13:55
-!- ChanServ changed mode/#tryton -> +o cedk 13:55
nickbnfcedk: 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
nickbnfcedk: through several experiments I have find out, that nether header of footer are away for a current "item from records" 14:50
nickbnfcedk: onr can say they did not know the current "index of an iteration"14:50
nickbnfcedk: 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 header14:53
nickbnfcedk: reason behind this is to able to identify to what matter all pages are related14:54
nickbnfcedk: it is special important if you have a quotation, which must be signed by a customer14:55
nickbnfcedk: and without such "header of footer based" identification is not possible to proove later, what Quotation has customer actually signed14:56
nickbnfcedk: I am also confused, why each report is getting a list of records instead of a one14:57
nickbnfcedk: thank you in advance! And if IRC is wrong plac for this descussion, just tell and I will post it at discuss.tryton.org14:58
cedknickbnf: OpenDocument format allows only a songle content of header and footer14:58
nickbnfcedk: you can still iterate records in header14:59
cedknickbnf: so you must group records by header_key15:00
nickbnfcedk: 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 part15:03
nickbnfcedk: or have you ment, that there is possibility to wolkaround this through some kid of header_key mapping?15:04
cedknickbnf: Report.header_key will generate one report per key15:18
nickbnfcedk: 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
nickbnfcedk: just trying to understand where Report.header_key can fe found and how one can propper use it15:21
cedknickbnf: it is already used for the sale report through the CompanyReport to goup record from the same company15:23
cedkbecause we put in the header the company header (idem for footer)15:23
nickbnfcedk: so "account.invoice" Report and "sale.sale" Repors are already grouped and are called with "len(records) == 1"?15:25
nickbnfcedk: and it it safe in this context to access curent customer party over "records[0]"?15:26
nickbnfcedk: thank you again for your time, I know you are making it in your spare time. 15:27
cedknickbnf: no they are grouped per company15:28
cedkin the header/footer of template, it is only safe to access header data15:29
cedkthe CompanyReport put in the context the header['company'] (for backward compatibiliy)15:29
nickbnfcedk: are you talking about header15:30
nickbnfand footer fields by a company?15:30
cedknickbnf: no the header key in the evaluation context of the report15:31
cedkjust like records15:31
nickbnfcedk: ah so there is "header" key available in a report evaluation scope that one can access15:33
cedknickbnf: yes15:33
cedkit is filled by the values returned by Report.header_key15:34
cedkwhich is a tuple of couple (key, value)15:34
nickbnfcedk: so it a list of pairs?15:34
nickbnfcedk: looks promising! And how one can add some data in this list?15:35
nickbnfcedk: over gui? over some party attributes?15:36
nickbnfcedk: I am new to tryton have just installed it one month ago, so it is possible that my question are dumb15:36
cedknickbnf: you need to extend the Report subclass of the report15:39
cedklike https://docs.tryton.org/projects/server/en/latest/tutorial/module/extend.html but for report15:39
nickbnfcedk: so it is only possible throug creating a tryton module or patching tryton which is less good option 15:41
nickbnfcedk: I will try to play around with it.15:43
nickbnfcedk: can such functionality be interresting for a tryton mainline or it is only my crazy special case?15:44
cedkI do not think15:49
cedkACTION bbl15:50
-!- udono(~udo@183-153-117-131.ip-addr.inexio.net) has joined #tryton19:06
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton21: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/!