IRC logs of #tryton for Monday, 2018-06-18

chat.freenode.net #tryton log beginning Mon Jun 18 00:00:01 CEST 2018
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton22:04
-!- yangoon1(~mathiasb@i59F4A85D.versanet.de) has joined #tryton02:34
-!- smarro(~sebastian@190.105.87.138) has joined #tryton04:12
-!- JanGB(~jan@x2f7fa56.dyn.telefonica.de) has joined #tryton04:47
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton05:09
-!- jmpoure(~jmpoure@soy95-3-82-237-147-64.fbx.proxad.net) has joined #tryton05:56
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton06:04
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton06:11
-!- tbruyere(~smuxi@mail.saluc.com) has joined #tryton06:20
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:25
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton06:58
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton07:16
-!- udono(~udono@121-058-210-188.ip-addr.inexio.net) has joined #tryton07:17
-!- rpit(~ralf@p200300C88F352A0078DC87435C614607.dip0.t-ipconnect.de) has joined #tryton07:30
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton07:33
-!- nicoe(~nicoe@2a02:578:858c:500:ee55:f9ff:fe7b:f7ac) has joined #tryton07:52
-!- VlijmenFileer(~VlijmenFi@111.95.210.199) has joined #tryton08:10
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton09:18
sisalpcedk : there is a gis module in the download directory https://downloads.tryton.org/4.8/trytond_gis-4.8.0.tar.gz09:46
sisalpcedk: it is the one I had problems with.09:47
pokolisisalp: probably this is not the gis module, but the gis backend for trytond09:50
pokolisisalp: you should not download this sources to the module directory09:51
pokolisisalp: al modules are listed on https://downloads.tryton.org/4.8/modules.txt (which does not contain the gis folder)09:51
sisalppokoli: good point, I missed this file. I have to adapt my download directive then. thank you.09:56
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton09:59
-!- mariomop(~quassel@181.90.153.86) has joined #tryton11:07
-!- zmijunkie1(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton11:16
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton11:21
-!- Tesla42(~stefan@helme-3.informatik.tu-chemnitz.de) has joined #tryton11:27
Tesla42hi11:27
Tesla42I want to add variables to the invoice footer11:28
Tesla42So on company->reports->footer menu, is there a way to write e. g. . ${invoice.company.rec_name}11:28
Tesla42?11:28
pokoliTesla42: there is no variable evaluation on company footer, but you can directly write the copmany name11:29
pokoliTesla42: may I ask you which variables do you want to print?11:29
Tesla42is there a way to add expression execution or variable evaluation feater there?11:30
Tesla42I want to print the bank iban bic11:30
Tesla42I have bank account module installed11:30
Tesla42I hate redundant data11:31
pokoliTesla42: but the bank account and the bic of the company is static, you can put it directly on the footer11:31
pokoliTesla42: this way it will be showed on all the reports11:31
pokoliTesla42: otherwise you can customize the template to include the bank account of the company after the footer11:32
Tesla42But when I change the account later I can accidentially forget to change the footer11:32
Tesla42I know customization of the template is possible11:32
Tesla42but this is more hierarchical11:33
Tesla42better abstraction11:33
Tesla42can the footer be changed by additional module managing "dynamic" footer?11:33
pokoliTesla42: yes, you can create a custom module to include a dynamic_footer field and evaluate variables there11:34
Tesla42I think that would also be helpfull for other user11:35
Tesla42are there other people asking for this feature?11:35
pokoliTesla42: we normally solve it by adding modifiing the template or using the static content on the footer11:39
Tesla42ok11:40
Tesla42is there a template repository, where different example templates are hostet, manageable by tryton?11:41
pokoliTesla42: don't think so... But templates are written with relatiorio and his docs has some examples:https://relatorio.readthedocs.io/en/latest/11:50
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton12:43
-!- smarro(~sebastian@190.105.87.138) has joined #tryton12:51
Tesla42thanks I will try to change the template13:24
Tesla42changing the template does not do anything14:16
Tesla42I saved the new template in the home dorectory14:16
Tesla42and opened it in tryton remports14:17
Tesla42and save the dataset14:17
Tesla42no difference in the reports/invoices14:17
Tesla42I also tried to replace the original template file -> no difference14:17
semarieif I remember correctly, templates should be "register" inside tryton14:18
Tesla42what does this mean?14:19
Tesla42I allready opened it in the reports menu14:19
Tesla42in tryton14:19
rmuTesla42: inovice is persistet in DB once created14:20
rmuTesla42: try different report14:20
Tesla42I recreated the invoice with new sell14:20
semarieTesla42: under Administration > User Interface > Actions > Reports14:21
Tesla42i did this14:22
semarieoh14:22
Tesla42that menu has also some weird behavior14:23
pokoliTesla42: could you describe what do you understand by "weird behaviour"?14:24
Tesla42if I remove the template in the menu by clicking the wipe symbol and save it14:24
Tesla42then a new field appears14:24
Tesla42with the relative path to the default template14:25
pokoliTesla42: because there is a base template on the module definition, which is used if no custom tmemplate is provided14:25
Tesla42but i can change the base template path14:25
Tesla42but it says I have no permissions to change it14:25
Tesla42I opened the new template there and pressed save14:26
Tesla42got some progress14:28
Tesla42added text changed14:28
Tesla42but onyl in header and main part not at the footer14:28
Tesla42I found the problem14:31
Tesla42there must be enough spacing between text and template or templates to each other14:32
Tesla42how can I find out what the variable name of my account is?14:35
pokoliTesla42: you should use the field name of your model.14:37
-!- VlijmenFileer(~VlijmenFi@111.95.210.199) has joined #tryton14:38
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton14:39
-!- zmijunkie(~Adium@i577B3506.versanet.de) has joined #tryton16:20
-!- zmijunkie(~Adium@i577B3506.versanet.de) has joined #tryton16:35
-!- zmijunkie(~Adium@i577B3506.versanet.de) has joined #tryton17:54
-!- zmijunkie(~Adium@200116b80a67a1004916d2591a246275.dip.versatel-1u1.de) has joined #tryton17:59
-!- Tesla42(~stefan@vpn-198-0019.hrz.tu-chemnitz.de) has joined #tryton18:04
-!- yangoon(~mathiasb@i59F4A96C.versanet.de) has joined #tryton18:30
-!- semarie_(~semarie@unaffiliated/semarie) has joined #tryton20:01
-!- rpit(~ralf@p200300C88F352A0078DC87435C614607.dip0.t-ipconnect.de) has joined #tryton20:04
-!- smarro(~sebastian@190.105.87.138) has joined #tryton20:12
Tesla42I do not understand where this variable names come from: invoice.company.rec_name20:31
rmuTesla42: http://doc.tryton.org/4.8/trytond/doc/ref/models/models.html?highlight=rec_name#trytond.model.ModelStorage.rec_name20:43
Tesla42I do not understand this concept21:08
Tesla42if I want to have the content of the field in menu item party->parties->banking21:09
Tesla42how do I know what is the name of it?21:09
cedkTesla42: look at the code21:10
Tesla42ok21:10
cedkTesla42: or you can browse Adminstration>Models>Models21:12
Tesla42I saw this menu already, but did not find the entry21:12
Tesla42I found "bank.account-party.party"21:15
Tesla42and21:15
Tesla42maybe "party.party.account"21:17
Tesla42how do I debug print?21:17
Tesla42is there a tryton console?21:17
cedkTesla42: do not understand21:19
Tesla42I want to check, if I found the right variable21:19
rmuTesla42: just insert temporary prints into the code ;) or put import pdb; pdb.set_trace() into places where you want so inspect stuff21:19
Tesla42ok21:20
Tesla42I also not found invoice.company.rec_name in the models menu21:20
cedkTesla42: I can see rec_name field definition in company model21:22
cedkTesla42: invoice.company is not a model21:22
rmuTesla42: that doesn't make sense. invoice.company points to company model, so you will find definition of invoice.company.rec_name in company21:22
rmucedk was faster ;)21:22
cedkTesla42: invoice is a model account.invoice which has a field Many2One company that point to company.company model21:23
Tesla42ok21:24
Tesla42and if I want to have the first bank account of a special party, so I have access:21:26
Tesla42party['myparty'].bank.account.number21:27
Tesla42?21:27
Tesla42party['myparty'].bank.account.number[0]21:27
Tesla42is this right?21:30
cedkTesla42: it depends from which record?21:30
cedkTesla42: also instances uses attribute and not item21:31
Tesla42ok21:33
Tesla42sounds like days on fidling and debugging21:33
Tesla42I need a tracing tool21:33
Tesla42clicking on a field in the menu should show the name to reference in template21:34
rmuTesla42: you mean in report?21:34
Tesla42yes21:34
rmubut it does show you21:34
Tesla42ok where?21:35
rmugo to Administration>Models>Models21:35
rmusearch for the model of your report21:35
rmuvoila, you have a list of fields available, including field names21:36
Tesla42ok21:37
rmuthe model form view shows field name (that you will want to reference in your report), field type, description, module that introduces the field etc...21:37
rmufield type many2one means this field references another model21:37
Tesla42ok21:38
rmuif you install graphviz and pydot you can open "graph" report on model21:38
Tesla42but I do not understand this without example21:38
Tesla42I know, I added a bank account number, a european iban21:39
Tesla42I think it is on bank.account.number21:40
Tesla42but i want to habe that one referenced in the party configuration21:40
Tesla42with this many2one thing21:40
Tesla42what are the exact steps to find out, what variable name that field has?21:43
rmui don't understand21:43
rmubank.account.number is a model21:45
Tesla42I start on menu: I click on parties->parties and select 'myparty' , click on tab banking21:45
Tesla42there I can find some bank accounts associated with that party21:46
rmuyeah, but this relationship is "Many" to "Many"21:46
Tesla42but I defined it on banking->accounts21:46
Tesla42yes you said there is the relationship many2many,  but how to resolve this?21:47
rmuparty.party model has field "bank_accounts"21:48
Tesla42ok21:48
rmubut this field contains a list21:48
rmu(if referenced from report)21:48
rmuso either use something like [0] to take the first element if appropriate, or use a for-loop to loop over all bank accounts21:49
Tesla42no21:49
Tesla42if I look at models21:49
rmuor introduce a function field that somehow "knows" how to extract the one and only bank account21:49
Tesla42ther is party.party.account21:49
Tesla42and party.party.lang21:49
rmuin model party.party21:50
Tesla42there is no party.party.bank_account21:50
Tesla42or party.party.bank_accounts21:50
rmui see "account_payable", "account_receivable" and  so on and "bank_accounts"21:50
rmudon't understand where you are looking for "party.party.bank_accounts"21:51
cedkTesla42: you must look at the fields of the model by switching to form view21:51
Tesla42ok21:52
Tesla42doublicking on it shows it21:52
Tesla42ok21:53
Tesla42now we have party.party.bank_accounts21:53
Tesla42which is a list21:53
Tesla42ok party must also be a list or dict21:54
Tesla42now we have party.party['myparty'].bank_accounts[0]21:54
Tesla42right?21:55
Tesla42and there I have many2on from account to bank.account21:57
Tesla42means21:57
rmuusually, in a report, only "objects" is defined, containing a list of instances of the model you are generating the report on. I'm not sure you can reference arbitrary instances/models like that21:57
Tesla42now we have party.party['myparty'].bank_accounts[0].account.number21:57
Tesla42right?21:58
rmubank.account model doesn't have field account21:59

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