IRC logs of #tryton for Thursday, 2017-04-27

chat.freenode.net #tryton log beginning Thu Apr 27 00:00:01 CEST 2017
-!- JosDzG(~Thunderbi@189.250.122.148) has joined #tryton00:39
-!- JanGB(~jan@dslb-088-073-244-178.088.073.pools.vodafone-ip.de) has joined #tryton01:15
-!- JosDzG(~Thunderbi@189.250.122.148) has joined #tryton01:32
-!- csotelo(~csotelo@179.7.36.250) has joined #tryton02:24
-!- csotelo(~csotelo@179.7.36.250) has joined #tryton03:39
-!- iscadrian(440ca59b@gateway/web/freenode/ip.68.12.165.155) has joined #tryton03:42
iscadrianHello. I downloaded the tryton source code, but the trytond.config is not present. Is it something I have to create by myself?03:47
-!- VaticanCameos(~VaticanCa@182.77.114.115) has joined #tryton04:54
-!- thaneor(~ldlc6@r179-24-156-43.dialup.adsl.anteldata.net.uy) has joined #tryton04:55
iscadrianwhich Tryton client is compatible with Trytond 4.2?05:58
-!- JanGB(~jan@business-178-015-079-061.static.arcor-ip.net) has joined #tryton08:02
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton08:41
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:42
-!- dmollerm(~dmollerm@170.red-80-28-119.adsl.static.ccgg.telefonica.net) has joined #tryton08:51
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton08:58
-!- rpit(~rpit@aftr-37-24-151-117.unity-media.net) has joined #tryton09:12
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton10:50
-!- Telesight(~anthony@4dae0c97.ftth.telfortglasvezel.nl) has joined #tryton11:49
-!- piyush_(0116a082@gateway/web/freenode/ip.1.22.160.130) has joined #tryton12:06
piyush_hello I am getting some error "'int' object has no attribute '__getitem__'"12:06
pokolipiyush_: where? on a module? on proteus?12:11
piyush_while creating new sale12:12
piyush_I am sending "taxes" : (taxID) in request12:14
piyush_may be this cause problem?12:14
pokolipiyush_: can you post the full traceback?12:23
pokolipiyush_: please use som paste service (i.e: pastebin.com)12:23
piyush_thank you pokoli I got my error12:25
-!- mariomop(~quassel@190.30.187.82) has joined #tryton12:48
-!- uha4(~uha4@146.0.99.188) has joined #tryton14:09
uha4hello, can anyone tell me, how i can access the original (not translated) value of a field?14:10
uha4i want to check in my module, if a product.template is in a specific category. But if the category.name is translated, it should be recogised anyway14:11
uha4is there a way to access the untranslated value?14:12
pokoliuha4: you can change the translation language by using the language key on the context14:14
pokoliuha4: so just use yout "original language" code to access it14:14
pokoliuha4: something like: http://hg.tryton.org/trytond/file/764d4f9698d0/trytond/ir/translation.py#l50214:15
uha4i tried using 'with Transaction().set_context(language=u'en'): ', but still got the translated value14:17
pokoliuha4: you have to re-browse the record to get the correct translation14:18
pokoliuha4: have you checked with the client that english do not contain the translation value?14:18
uha4ok, thanks.14:18
uha4is there a faster/simpler way than "Pool().get('product.category')(id).name" ?14:20
uha4i would like to use it in a on_change_with method, so it's called quite often...14:20
pokoliuha4: there is a cache for translations14:20
pokoliuha4: can I ask for what are you trying to implement?14:21
uha4pokoli: I have some product properties that are only relevant for food products. So i created a category 'food' in product.xml of my module. and want to hide or require some fields dependend of product category.14:25
pokoliuha4: use the xml_id for this record with ir.model.data14:26
pokolia domain like: ('category', '=', Id('your_module', 'xml_id_of_food_category')) will do the trick14:26
uha4pokoli: in the template i created a field.Function(field.Boolean)) that is updated checking the categories14:26
pokoliuha4: if you only need for pyson, there is no need of function field14:27
pokoliuha4: see http://doc.tryton.org/4.2/trytond/doc/ref/pyson.html?highlight=id#trytond.pyson.Id14:27
uha4pokoli: thanks, never heard of this...14:29
-!- csotelo(~csotelo@179.7.36.250) has joined #tryton14:30
pokoliuha4: when you create a record via xml, a mapping between id and db_id is stored on the ir.model.data table, so you always refer (from server or from pyson) to records created via xml14:30
-!- JanGB(~jan@business-178-015-079-061.static.arcor-ip.net) has joined #tryton14:30
uha4pokoli: i think i need the function field, as template.categories is many to many, and any of the categories could be a child of 'food_category'14:31
uha4pokoli: i also want to be able to do things like "if lot.product.food: "14:32
pokoliuha4: then, in order to get the id of the 'food_category' you should use: Pool().get('ir.model.data').get_id('module', 'xml_id')14:32
uha4does it make sense to cache the this category somewere more global, that this Pool().get() does not have to be executed everytime the getter function is called?14:35
uha4e.g. in a class attribute? it's anyway never going to change as long as the server is running...14:36
pokoliuha4: you don't have to worry about it14:37
pokoliuha4: there is also a Cache for get_id on ir.model.data and for me this will be enough14:37
pokoliuha4: but If you want to cache the value of the function field, you can create a Cache for it's values14:38
pokoliuha4: see http://doc.tryton.org/4.2/trytond/doc/ref/cache.html?highlight=cache14:38
pokoliuha4: just take care of clearing the cache when writting on the dependant fields14:39
uha4pokoli: I was just worried as Pool().get() sounds somehow expensive without knowing exactly what it does...14:40
uha4pokoli: thanks a lot...14:41
pokoliuha4: just take care to only initialize Pool() one time when getting multiple classes14:59
pokoliuha4: dont doot Pool().get('a'); Pool().get('b'), but do pool = Pool(); pool.get('a'); pool.get('b')15:00
uha4pokoli: but i have to initialize it within my on_change_with method? or is there a better place?15:04
pokoliuha4: you have to initialize it where you have to use it. So yes, on the on_change method if you are going to use there15:08
uha4pokoli: ok, so i got it right.15:10
-!- lukio(~lukio@host126.186-109-85.telecom.net.ar) has joined #tryton15:35
-!- kstenger(~karla@r186-55-66-228.dialup.adsl.anteldata.net.uy) has joined #tryton15:41
-!- csotelo(~csotelo@179.7.36.250) has joined #tryton16:13
-!- marc_(~marc@170.red-80-28-119.adsl.static.ccgg.telefonica.net) has joined #tryton16:35
-!- JanGB(~jan@business-178-015-079-061.static.arcor-ip.net) has joined #tryton16:45
dmollermHi. I am trying to automate the trytond deployment into production and development servers and I have run across a particular problem:16:45
dmollermWhen a module that had already been activated has a new tryon module dependency our deployment brings it to the python virtualenv, but then trytond won't start because the dependency is not activated, `trytond-admin --all` won't activate it, `trytond-admin -m` won't run, `trytond-admin -u mymodule` won't run either...16:46
dmollermThe only solution is to run `trytond-admin -m new_dependency`, but if there is a whole new bunch of modules this is not trivial to do. My question is: is there any reason for `trytond-admin -u mymodule` not activating the modules "mymodule" depends on? Is there any discussion/doc regarding this?16:46
-!- VaticanCameos(~VaticanCa@223.190.7.91) has joined #tryton16:47
dmollermSorry, the command was `trytond-admin -u new_dependency`16:47
cedkdmollerm: I think the reason is explicit is better than implicit16:48
kstengerI would agree, but when you activate a module from the client it actually activates also it's dependencies, which is a bit contradicting :-)16:50
cedkkstenger: the wizard tells you what is going to happen and you can change it16:51
kstengerah, true16:51
cedkalso it is different to activate a new module because of a new dependency than activate depenency to active a module16:52
cedkbut it is true that it will be great to have trytond-admin to activate dependencies on new module activation16:52
kstengerideally it could be interactive16:53
cedkkstenger: yes or display the list of module to also activate16:55
kstengerexactly this is what I meant16:55
kstengerso it's exclicit but still scriptable16:56
kstengerexplicit*16:56
-!- thaneor1(~ldlc6@r179-25-75-20.dialup.adsl.anteldata.net.uy) has joined #tryton16:57
cedkkstenger: indeed for now, it should the first level of missing module, it will be better to show all17:00
dmollermMaybe a new command line option that assumes you want to activate any needed dependency? (apt-get style)17:00
cedkho non, do not take apt-get as example of good command line :-)17:01
kstengercedk: would you please reword "indeed for now, it should the first level of missing module, it will be better to show all"17:03
dmollermIt was just to name a popular package manager. pip, npm, yum, composer and so on have similar behaviours: prompt if you really want all the dependencies or provide an option that assumes "yes"17:04
cedkkstenger: if you try to install a module A that depends on B and B depends on C17:07
cedkkstenger: any of those modules are activated17:07
cedkkstenger: you try to activate A, trytond-admin will tell you that it is missing B17:08
cedkbut nothing about C17:08
cedkdmollerm: I think activate module is different of installing a module17:08
cedkdmollerm: it is most of the time irreversible operation so we can not use the same logic as package manager17:09
kstengercedk: got it now, but I guess it would tell you about C if on a second step you tell it to install B, do you agree ?17:10
-!- JanGB(~jan@dslb-088-073-244-178.088.073.pools.vodafone-ip.de) has joined #tryton17:10
cedkkstenger: I think it is the case now (was not before) but it should be tested17:14
-!- lukio(~lukio@host126.186-109-85.telecom.net.ar) has joined #tryton17:14
dmollermcedk: indeed, but if the user is prompted about this or an "--assume-yes" option is provided I see no reason to activate dependencies despite the irreversible changes in the DB.17:14
cedkdmollerm: last time I look at that, it was too complex to implement17:17
dmollermcedk: traversing and parsing a tryton.cfg tree? Or messing with the "check whether this dependency is already installed"?17:29
dmollermJust saying... I'll have to look into this sooner or later for our deployments, but if the community does not agree that this would be a nice-to-have I'd rather develop a custom tool than maintain a tryton-admin feature17:33
cedkdmollerm: activate the missing module because we do not have the ORM17:35
cedkalso the best will be to reuse ir.module function but it is not available17:36
-!- JosDzG(~Thunderbi@189.250.122.148) has joined #tryton17:37
-!- dm0ller(~dmollerm@170.red-80-28-119.adsl.static.ccgg.telefonica.net) has joined #tryton17:40
-!- JosDzG(~Thunderbi@189.250.122.148) has joined #tryton17:42
pokolidmollerm: cedk kstenger it is not https://bugs.tryton.org/issue5696 ?17:55
pokoliindeed when I first tough about this issue I had the same use case as dmollerm17:56
-!- lukio(~lukio@181.47.212.165) has joined #tryton17:57
dmollermpokoli: yes! thank you18:03
-!- JanGB(~jan@dslb-088-073-244-178.088.073.pools.vodafone-ip.de) has left #tryton18:04
-!- iscadrian(~androirc@2600:8803:ac01:5800:606f:e708:daaa:cebb) has joined #tryton19:04
kstengerpokoli: indeed19:52
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton21:44
-!- kstenger(~karla@r167-56-247-29.dialup.adsl.anteldata.net.uy) has joined #tryton21:48
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton22:19
-!- JanGB(~jan@dslb-088-073-244-178.088.073.pools.vodafone-ip.de) has joined #tryton22:49

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!