IRC logs of #tryton for Monday, 2018-07-02

chat.freenode.net #tryton log beginning Mon Jul 2 00:00:02 CEST 2018
-!- fsanchez(~fsanchez@190.236.1.105) has joined #tryton22:15
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton22:17
-!- thaneor(~lenovo3@r186-53-74-198.dialup.adsl.anteldata.net.uy) has joined #tryton22:57
-!- fsanchez(~fsanchez@190.236.14.32) has joined #tryton23:49
-!- thaneor1(~lenovo3@r186-48-183-55.dialup.adsl.anteldata.net.uy) has joined #tryton00:34
-!- thaneor(~lenovo3@r186-48-183-55.dialup.adsl.anteldata.net.uy) has joined #tryton02:48
-!- yangoon(~mathiasb@i59F4D629.versanet.de) has joined #tryton02:56
-!- fsanchez(~fsanchez@190.239.80.2) has joined #tryton04:23
-!- prakhar(~prakhar@103.255.235.42) has joined #tryton05:08
-!- thaneor(~lenovo3@r186-48-183-55.dialup.adsl.anteldata.net.uy) has joined #tryton05:24
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton06:08
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:28
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton06:41
-!- jmpoure(~jmpoure@63.109.206.77.rev.sfr.net) has joined #tryton06:52
-!- Tesla42(~stefan@helme-3.informatik.tu-chemnitz.de) has joined #tryton07:20
-!- prakhar(~prakhar@182.69.224.30) has joined #tryton07:29
Tesla42h07:40
Tesla42hi07:40
Tesla42i am here again07:41
Tesla42yesterday i couldn't solve one problem07:41
Tesla42translation of some fileds in report did not work07:41
Tesla42https://github.com/TheTesla/tryton-invoice-template07:42
Tesla42this <line.type> in the footer is not translated07:42
Tesla42I hoped it is translated in the way it is in the menu/view07:42
cedkTesla42: footer is only evaluated once with the context of the report07:46
-!- irclog(~irclog@moretus.b2ck.com) has joined #tryton07:47
Tesla42i do not mean the footer field07:47
cedkTesla42: ha you want the string translated of a selection07:49
cedkTesla42: you must use a descriptor: http://doc.tryton.org/4.8/trytond/doc/ref/models/fields.html#trytond.model.fields.Selection.translated07:49
-!- NeonKing-(~Neonking@176-179-38-86.abo.bbox.fr) has joined #tryton08:12
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton08:16
-!- NeonKing(~Neonking@unaffiliated/neonking) has joined #tryton08:17
-!- nlopez73(~nlopez73@static-160-102-225-77.ipcom.comunitel.net) has joined #tryton08:35
-!- rpit(~ralf@p200300C88F330400F43B3E3F0C8F79A2.dip0.t-ipconnect.de) has joined #tryton08:40
-!- JanGB(~jan@x2f7f844.dyn.telefonica.de) has joined #tryton09:03
-!- nlopez73_(~nlopez73@static-160-102-225-77.ipcom.comunitel.net) has joined #tryton09:13
Tesla42ah ok09:24
-!- JanGB1(~jan@nat3.hmt-leipzig.de) has joined #tryton10:25
-!- smorillo(4de166a0@gateway/web/cgi-irc/kiwiirc.com/ip.77.225.102.160) has joined #tryton10:53
-!- yangoon(~mathiasb@i59F4D629.versanet.de) has joined #tryton11:02
-!- fsanchez(~fsanchez@190.239.80.2) has joined #tryton11:04
-!- prakhar(~prakhar@122.177.99.101) has joined #tryton11:09
Tesla42where du I have to do this?11:23
Tesla42should i write <line.type.translated()> ?11:23
cedkTesla42: it must be defined like a field on the Model11:24
Tesla42didn't something like that before11:25
-!- mariomop(~quassel@181.93.207.230) has joined #tryton11:25
Tesla42what do I have to do step by step?11:25
cedkTesla42: see http://hg.tryton.org/modules/party/file/921ad32c82a9/party.py#l31811:26
Tesla42can I do this in the tryton gui?11:27
Tesla42is it in administration->models->models ?11:29
Tesla42not possible that way?11:32
pokoliTesla42: no, you should create a new fied on the model that is only possible using a module11:36
Tesla42ok so I have to write a module?11:36
Tesla42or to edit the module11:36
Tesla42?11:37
pokoliTesla42: write a new module that extends the model11:38
pokoliTesla42: you can also include the report as part of this module11:38
Tesla42ok11:39
Tesla42why is there no generic selection translation solution?11:41
Tesla42is it possible to implement this?11:41
-!- smn(4de166a0@gateway/web/cgi-irc/kiwiirc.com/ip.77.225.102.160) has joined #tryton11:43
Tesla42do i have to extend the report module?11:46
-!- nlopez73(4de166a0@gateway/web/cgi-irc/kiwiirc.com/ip.77.225.102.160) has joined #tryton11:48
-!- smn(4de166a0@gateway/web/cgi-irc/kiwiirc.com/ip.77.225.102.160) has left #tryton11:49
-!- smorillo(4de166a0@gateway/web/cgi-irc/kiwiirc.com/ip.77.225.102.160) has joined #tryton11:50
-!- mariomop(~quassel@181.93.207.230) has joined #tryton11:59
-!- nlopez73(4de166a0@gateway/web/cgi-irc/kiwiirc.com/ip.77.225.102.160) has joined #tryton12:01
-!- mariomop(~quassel@host82.190-31-227.telecom.net.ar) has joined #tryton12:28
pokoliTesla42: current code is here: http://hg.tryton.org/trytond/file/6fc99c9dd8da/trytond/model/fields/selection.py12:31
-!- prakhar(~prakhar@182.69.217.244) has joined #tryton12:31
pokoliTesla42: for me it will be best if something can be implemented to allow using the translated string on reports without the need of creating a new field on the report12:32
pokoliTesla42: but not sure how to implement this12:33
-!- thaneor1(~lenovo3@r179-24-118-81.dialup.adsl.anteldata.net.uy) has joined #tryton12:35
-!- lukio(~lukio@190.19.220.68) has joined #tryton13:08
-!- smorillo(4de166a0@gateway/web/cgi-irc/kiwiirc.com/ip.77.225.102.160) has joined #tryton13:20
-!- smorillo(4de166a0@gateway/web/cgi-irc/kiwiirc.com/ip.77.225.102.160) has joined #tryton13:30
-!- jpellicer(~jpellicer@185.107.106.118) has joined #tryton14:07
-!- jmpoure(~jmpoure@63.109.206.77.rev.sfr.net) has joined #tryton14:45
-!- JanGB(~jan@x2f7f844.dyn.telefonica.de) has joined #tryton14:46
-!- csotelo(~csotelo@179.43.97.56) has joined #tryton14:49
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton15:25
-!- csotelo(~csotelo@179.43.97.56) has joined #tryton15:47
-!- prakhar1(~prakhar@122.177.81.135) has joined #tryton16:25
-!- Tesla42(~stefan@2001:bc8:3f13:ffc2:4c96:5ed9:d4f3:b00b) has joined #tryton17:17
-!- lukio(~lukio@181.93.80.78) has joined #tryton17:55
Tesla42http://hg.tryton.org/modules/party/file/921ad32c82a9/party.py#l31817:56
Tesla42on line 318 the type_string is used nowhere17:56
Tesla42why?17:56
-!- smorillo(250f6795@gateway/web/cgi-irc/kiwiirc.com/ip.37.15.103.149) has joined #tryton17:58
TimitosTesla42: you only need to define the 'type_string' and then you can use it in your report18:03
Tesla42ok18:03
Tesla42and for this contact_mechanism type string I need:18:03
Tesla42contacttype = fields.Selection([(None, ''), ('contact_mechanism',  ?)], 'Type')18:04
Tesla42contactstring = contacttype.translated('type')18:05
Tesla42maybe I am completely wrong18:07
TimitosTesla42: contacttype_string = contacttype.translated('contacttype') would be my version18:07
Tesla42ah ok18:08
TimitosTesla42: but on contact mechanism model there is already a "type" field. why do you try to implement this again?18:08
Tesla42I want to have the translation of it18:08
Tesla42for the report18:08
Tesla42the translation is already available in the view18:08
Tesla42but not in the report18:09
Tesla42https://github.com/TheTesla/tryton-invoice-template18:09
Tesla42on the line in the footer18:09
TimitosTesla42: but then there is no need to reimplement the type field. Just use "type_string = type.translated('type')" on the contact mechanism model18:11
Tesla42yes, that is, what i wanted to know18:12
Tesla42I found the file ^^18:14
Tesla42https://github.com/TheTesla/tryton-invoice-template18:14
Tesla42/usr/lib/python3/dist-packages/trytond/modules/party/contact_mechanism.py18:14
Tesla42this one ^18:15
-!- JanGB(~jan@x2f7f844.dyn.telefonica.de) has joined #tryton18:15
Tesla42 45     type = fields.Selection(_TYPES, 'Type', required=True, states=STATES,18:17
Tesla42 46         sort=False, depends=DEPENDS)18:17
Tesla42 47     type_string = type.translates('type')18:17
-!- thaneor(~lenovo3@r179-24-118-81.dialup.adsl.anteldata.net.uy) has joined #tryton18:17
Tesla42like that?18:17
TimitosTesla42: yes. but the common way how to do this would be to create a custom module and to add the translated type string there18:20
Tesla42I know, but I think it is too hard for me now to dreate a custom module18:20
Tesla42later maybe18:20
Tesla42it is not translating18:44
Tesla42now I think I have to add the translation18:44
-!- lukio(~lukio@181.93.80.78) has joined #tryton18:58
Tesla42what do I have to do that i can see the contact_mechanism.type translated in the report?19:10
Tesla42do i have to reference the translated value in the report template19:43
Tesla42?19:43
Tesla42I solved it myself19:46
Tesla42yes, i have to reference type_string19:46
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton20:01
Tesla42thanks very much20:21
Tesla42it works20:21
Tesla42https://github.com/TheTesla/tryton-invoice-template20:21
-!- lukio(~lukio@181.93.80.78) has joined #tryton20:42
-!- JanGB(~jan@x2f7f844.dyn.telefonica.de) has joined #tryton20:53
-!- irclog(~irclog@moretus.b2ck.com) has joined #tryton21:15
-!- smorillo(250f6795@gateway/web/cgi-irc/kiwiirc.com/ip.37.15.103.149) has joined #tryton21:48
-!- orphean(~Orphean@31.192.224.224) has joined #tryton21:56

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