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 #tryton00:06
-!- yangoon1(~mathiasb@i59F4A85D.versanet.de) has joined #tryton04:06
-!- smarro(~sebastian@190.105.87.138) has joined #tryton06:06
-!- JanGB(~jan@x2f7fa56.dyn.telefonica.de) has joined #tryton06:06
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton07:06
-!- jmpoure(~jmpoure@soy95-3-82-237-147-64.fbx.proxad.net) has joined #tryton07:06
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton08:06
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton08:06
-!- tbruyere(~smuxi@mail.saluc.com) has joined #tryton08:06
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:06
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton08:06
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton09:06
-!- udono(~udono@121-058-210-188.ip-addr.inexio.net) has joined #tryton09:06
-!- rpit(~ralf@p200300C88F352A0078DC87435C614607.dip0.t-ipconnect.de) has joined #tryton09:06
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton09:06
-!- nicoe(~nicoe@2a02:578:858c:500:ee55:f9ff:fe7b:f7ac) has joined #tryton09:06
-!- VlijmenFileer(~VlijmenFi@111.95.210.199) has joined #tryton10:06
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton11:06
sisalpcedk : there is a gis module in the download directory https://downloads.tryton.org/4.8/trytond_gis-4.8.0.tar.gz11:06
sisalpcedk: it is the one I had problems with.11:06
pokolisisalp: probably this is not the gis module, but the gis backend for trytond11:06
pokolisisalp: you should not download this sources to the module directory11:06
pokolisisalp: al modules are listed on https://downloads.tryton.org/4.8/modules.txt (which does not contain the gis folder)11:06
sisalppokoli: good point, I missed this file. I have to adapt my download directive then. thank you.11:06
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton11:06
-!- mariomop(~quassel@181.90.153.86) has joined #tryton13:06
-!- zmijunkie1(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton13:06
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton13:06
-!- Tesla42(~stefan@helme-3.informatik.tu-chemnitz.de) has joined #tryton13:06
Tesla42hi13:06
Tesla42I want to add variables to the invoice footer13:06
Tesla42So on company->reports->footer menu, is there a way to write e. g. . ${invoice.company.rec_name}13:06
Tesla42?13:06
pokoliTesla42: there is no variable evaluation on company footer, but you can directly write the copmany name13:06
pokoliTesla42: may I ask you which variables do you want to print?13:06
Tesla42is there a way to add expression execution or variable evaluation feater there?13:06
Tesla42I want to print the bank iban bic13:06
Tesla42I have bank account module installed13:06
Tesla42I hate redundant data13:06
pokoliTesla42: but the bank account and the bic of the company is static, you can put it directly on the footer13:06
pokoliTesla42: this way it will be showed on all the reports13:06
pokoliTesla42: otherwise you can customize the template to include the bank account of the company after the footer13:06
Tesla42But when I change the account later I can accidentially forget to change the footer13:06
Tesla42I know customization of the template is possible13:06
Tesla42but this is more hierarchical13:06
Tesla42better abstraction13:06
Tesla42can the footer be changed by additional module managing "dynamic" footer?13:06
pokoliTesla42: yes, you can create a custom module to include a dynamic_footer field and evaluate variables there13:06
Tesla42I think that would also be helpfull for other user13:06
Tesla42are there other people asking for this feature?13:06
pokoliTesla42: we normally solve it by adding modifiing the template or using the static content on the footer13:06
Tesla42ok13:06
Tesla42is there a template repository, where different example templates are hostet, manageable by tryton?13:06
pokoliTesla42: don't think so... But templates are written with relatiorio and his docs has some examples:https://relatorio.readthedocs.io/en/latest/13:06
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton14:06
-!- smarro(~sebastian@190.105.87.138) has joined #tryton14:06
Tesla42thanks I will try to change the template15:06
Tesla42changing the template does not do anything16:06
Tesla42I saved the new template in the home dorectory16:06
Tesla42and opened it in tryton remports16:06
Tesla42and save the dataset16:06
Tesla42no difference in the reports/invoices16:06
Tesla42I also tried to replace the original template file -> no difference16:06
semarieif I remember correctly, templates should be "register" inside tryton16:06
Tesla42what does this mean?16:06
Tesla42I allready opened it in the reports menu16:06
Tesla42in tryton16:06
rmuTesla42: inovice is persistet in DB once created16:06
rmuTesla42: try different report16:06
Tesla42I recreated the invoice with new sell16:06
semarieTesla42: under Administration > User Interface > Actions > Reports16:06
Tesla42i did this16:06
semarieoh16:06
Tesla42that menu has also some weird behavior16:06
pokoliTesla42: could you describe what do you understand by "weird behaviour"?16:06
Tesla42if I remove the template in the menu by clicking the wipe symbol and save it16:06
Tesla42then a new field appears16:06
Tesla42with the relative path to the default template16:06
pokoliTesla42: because there is a base template on the module definition, which is used if no custom tmemplate is provided16:06
Tesla42but i can change the base template path16:06
Tesla42but it says I have no permissions to change it16:06
Tesla42I opened the new template there and pressed save16:06
Tesla42got some progress16:06
Tesla42added text changed16:06
Tesla42but onyl in header and main part not at the footer16:06
Tesla42I found the problem16:06
Tesla42there must be enough spacing between text and template or templates to each other16:06
Tesla42how can I find out what the variable name of my account is?16:06
pokoliTesla42: you should use the field name of your model.16:06
-!- VlijmenFileer(~VlijmenFi@111.95.210.199) has joined #tryton16:06
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton16:06
-!- zmijunkie(~Adium@i577B3506.versanet.de) has joined #tryton18:06
-!- zmijunkie(~Adium@i577B3506.versanet.de) has joined #tryton18:06
-!- zmijunkie(~Adium@i577B3506.versanet.de) has joined #tryton19:06
-!- zmijunkie(~Adium@200116b80a67a1004916d2591a246275.dip.versatel-1u1.de) has joined #tryton19:06
-!- Tesla42(~stefan@vpn-198-0019.hrz.tu-chemnitz.de) has joined #tryton20:06
-!- yangoon(~mathiasb@i59F4A96C.versanet.de) has joined #tryton20:06
-!- semarie_(~semarie@unaffiliated/semarie) has joined #tryton22:06
-!- rpit(~ralf@p200300C88F352A0078DC87435C614607.dip0.t-ipconnect.de) has joined #tryton22:06
-!- smarro(~sebastian@190.105.87.138) has joined #tryton22:06
Tesla42I do not understand where this variable names come from: invoice.company.rec_name22:06
rmuTesla42: http://doc.tryton.org/4.8/trytond/doc/ref/models/models.html?highlight=rec_name#trytond.model.ModelStorage.rec_name22:06
Tesla42I do not understand this concept23:06
Tesla42if I want to have the content of the field in menu item party->parties->banking23:06
Tesla42how do I know what is the name of it?23:06
cedkTesla42: look at the code23:06
Tesla42ok23:06
cedkTesla42: or you can browse Adminstration>Models>Models23:06
Tesla42I saw this menu already, but did not find the entry23:06
Tesla42I found "bank.account-party.party"23:06
Tesla42and23:06
Tesla42maybe "party.party.account"23:06
Tesla42how do I debug print?23:06
Tesla42is there a tryton console?23:06
cedkTesla42: do not understand23:06
Tesla42I want to check, if I found the right variable23:06
rmuTesla42: just insert temporary prints into the code ;) or put import pdb; pdb.set_trace() into places where you want so inspect stuff23:06
Tesla42ok23:06
Tesla42I also not found invoice.company.rec_name in the models menu23:06
cedkTesla42: I can see rec_name field definition in company model23:06
cedkTesla42: invoice.company is not a model23:06
rmuTesla42: that doesn't make sense. invoice.company points to company model, so you will find definition of invoice.company.rec_name in company23:06
rmucedk was faster ;)23:06
cedkTesla42: invoice is a model account.invoice which has a field Many2One company that point to company.company model23:06
Tesla42ok23:06
Tesla42and if I want to have the first bank account of a special party, so I have access:23:06
Tesla42party['myparty'].bank.account.number23:06
Tesla42?23:06
Tesla42party['myparty'].bank.account.number[0]23:06
Tesla42is this right?23:06
cedkTesla42: it depends from which record?23:06
cedkTesla42: also instances uses attribute and not item23:06
Tesla42ok23:06
Tesla42sounds like days on fidling and debugging23:06
Tesla42I need a tracing tool23:06
Tesla42clicking on a field in the menu should show the name to reference in template23:06
rmuTesla42: you mean in report?23:06
Tesla42yes23:06
rmubut it does show you23:06
Tesla42ok where?23:06
rmugo to Administration>Models>Models23:06
rmusearch for the model of your report23:06
rmuvoila, you have a list of fields available, including field names23:06
Tesla42ok23:06
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...23:06
rmufield type many2one means this field references another model23:06
Tesla42ok23:06
rmuif you install graphviz and pydot you can open "graph" report on model23:06
Tesla42but I do not understand this without example23:06
Tesla42I know, I added a bank account number, a european iban23:06
Tesla42I think it is on bank.account.number23:06
Tesla42but i want to habe that one referenced in the party configuration23:06
Tesla42with this many2one thing23:06
Tesla42what are the exact steps to find out, what variable name that field has?23:06
rmui don't understand23:06
rmubank.account.number is a model23:06
Tesla42I start on menu: I click on parties->parties and select 'myparty' , click on tab banking23:06
Tesla42there I can find some bank accounts associated with that party23:06
rmuyeah, but this relationship is "Many" to "Many"23:06
Tesla42but I defined it on banking->accounts23:06
Tesla42yes you said there is the relationship many2many,  but how to resolve this?23:06
rmuparty.party model has field "bank_accounts"23:06
Tesla42ok23:06
rmubut this field contains a list23:06
rmu(if referenced from report)23:06
rmuso either use something like [0] to take the first element if appropriate, or use a for-loop to loop over all bank accounts23:06
Tesla42no23:06
Tesla42if I look at models23:06
rmuor introduce a function field that somehow "knows" how to extract the one and only bank account23:06
Tesla42ther is party.party.account23:06
Tesla42and party.party.lang23:06
rmuin model party.party23:06
Tesla42there is no party.party.bank_account23:06
Tesla42or party.party.bank_accounts23:06
rmui see "account_payable", "account_receivable" and  so on and "bank_accounts"23:06
rmudon't understand where you are looking for "party.party.bank_accounts"23:06
cedkTesla42: you must look at the fields of the model by switching to form view23:06
Tesla42ok23:06
Tesla42doublicking on it shows it23:06
Tesla42ok23:06
Tesla42now we have party.party.bank_accounts23:06
Tesla42which is a list23:06
Tesla42ok party must also be a list or dict23:06
Tesla42now we have party.party['myparty'].bank_accounts[0]23:06
Tesla42right?23:06
Tesla42and there I have many2on from account to bank.account23:06
Tesla42means23:06
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 that23:06
Tesla42now we have party.party['myparty'].bank_accounts[0].account.number23:06
Tesla42right?23:06
rmubank.account model doesn't have field account23:06

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