IRC logs of #tryton for Tuesday, 2017-07-18 #tryton log beginning Tue Jul 18 00:00:01 CEST 2017
2017-07-18 00:28 -!- sergio_( has joined #tryton
2017-07-18 00:41 -!- cedk(~ced@gentoo/developer/cedk) has joined #tryton
2017-07-18 01:38 -!- kstenger1( has joined #tryton
2017-07-18 01:47 -!- smarro(~sebastian@ has joined #tryton
2017-07-18 02:16 -!- cedk(~ced@gentoo/developer/cedk) has joined #tryton
2017-07-18 03:49 -!- thaneor( has joined #tryton
2017-07-18 04:46 -!- scrapper( has joined #tryton
2017-07-18 08:26 -!- dmollerm( has joined #tryton
2017-07-18 08:30 -!- Timitos( has joined #tryton
2017-07-18 08:36 <dmollerm> Morning
2017-07-18 08:39 <dmollerm> cedk, pokoli: I found the root of the problem about a field not being synced with a xml record: it was a translatable field and a translation did not exist yet. After manually saving a translation all works smooth. I'll consider bundling an en.po file with a translation for this record.
2017-07-18 09:01 -!- cedk(~ced@gentoo/developer/cedk) has joined #tryton
2017-07-18 09:40 -!- nicoe( has joined #tryton
2017-07-18 10:00 -!- scrapper( has left #tryton
2017-07-18 10:06 -!- sim6(sim6matrix@gateway/shell/ has joined #tryton
2017-07-18 10:06 <sim6> Hello
2017-07-18 10:07 <sim6> I'm starting with tryton!
2017-07-18 10:16 -!- afibanez(501c77aa@gateway/web/cgi-irc/ has joined #tryton
2017-07-18 10:20 <pokoli> sim6: hello, I hope you have fun with tryton :)
2017-07-18 10:20 <sim6> :)
2017-07-18 10:22 <afibanez> I'm having some troubles with permissions, or context, or I don't know... I have a process that work when triggered by a Tryton button, but when is triggered by a cron job it fails at finding property fields. I'm using set_user and set_context to act as another company
2017-07-18 10:23 <afibanez> There are some common knowledge or examples of behaivours like this? I will appreciate a lot
2017-07-18 10:26 <cedk> afibanez: you have to define the companies for which the cron job must be run
2017-07-18 10:29 <afibanez> yes, i know. But i need to run the job with one company and in one moment view the a property field with the information of the another company. The use case is that i'm reinvoicing, so if I have a invoice from A to B (both are companies in my Tryton), i need to create the supplier invoice in B
2017-07-18 10:42 <pokoli> afibanez: you call set_user(0)?
2017-07-18 10:42 <pokoli> afibanez: and with which context you browse the instace from where the property is read?
2017-07-18 10:48 <afibanez> pokoli: yes i call 'with transaction.set_user(0, set_context=True):' and 'with transaction.set_context(, _check_access=False):'
2017-07-18 10:52 -!- csotelo(~csotelo@2001:1388:49c7:3e7:acb8:cfdc:234e:4a65) has joined #tryton
2017-07-18 10:54 <pokoli> afibanez: and you browse the instance inside this code block?
2017-07-18 10:59 <afibanez> pokoli: yes... i am doing more tests and i discovered that if i use administrator as the executor user it works... but if i use an special user for the cron (like normally) it fails... i will check permissions... but with set_user and _check_access I thought there would work
2017-07-18 11:02 <pokoli> afibanez: it should not be realated
2017-07-18 11:03 <pokoli> afibanez: btw, have you seen that we droped properties on latests version? Maybe you should consider upgrading
2017-07-18 11:08 <afibanez> pokoli: i found that if I configure in the cron user a company that can view all subcompanies data, it works... :/
2017-07-18 11:09 <afibanez> pokoli: yes, I like the properties drop in the newest Tryton. But we can't upgrade for now (it's planned)
2017-07-18 11:15 <cedk> the context company is checked against the companies of the user
2017-07-18 12:02 -!- orphean(~Orphean@ has joined #tryton
2017-07-18 13:03 <afibanez> Ok, it not works well and i'm revising the cron code. I've found in company/ a "# TODO replace with context". And I viewed that the company is setted and unsetted to the cron user. Thats a problem, because i can't set a company that works, it needs to change only the context. If i comment both writes, It works with the set_context only.
2017-07-18 13:04 <afibanez> Why is there that two writes? Are necessary for something?
2017-07-18 13:06 -!- mariomop(~quassel@ has joined #tryton
2017-07-18 13:06 <pokoli> afibanez: there is an issue for that:
2017-07-18 13:06 <jcm> Hi, do I need to close something when exiting a proteus script? postgresql complains on other sessions using db, I need to use pg_terminate_backend(pid) to release them.
2017-07-18 13:07 <pokoli> jcm: when does postgresql complain?
2017-07-18 13:07 <pokoli> jcm: AFAIK you don't have to close anything
2017-07-18 13:09 <jcm> pokoli: when I dropdb for instance
2017-07-18 13:09 <pokoli> jcm: do you have som trytond server running that have connected to the database?
2017-07-18 13:10 <afibanez> pokoli: I see. But there is no explanation why the set_context is there and the writes too
2017-07-18 13:15 <pokoli> afibanez:
2017-07-18 13:15 <cedk> afibanez: write is there for historical reason
2017-07-18 13:25 <afibanez> cedk: ok, but its safe remove it?
2017-07-18 13:25 <cedk> afibanez: do not know
2017-07-18 13:31 <cedk> afibanez: but the write should not prevent your code to work
2017-07-18 13:31 <cedk> afibanez: I guess the cron user is not added to all the companies it needs to be
2017-07-18 13:37 <jcm> pokoli: the client is disconnected, python console are terminanted, but ps aux|grep tryton shows up postgres: tryton <my_db> [local] idle
2017-07-18 13:38 <pokoli> jcm: as far as the server is running, the connections to the database are keep in a pool for new connections
2017-07-18 13:38 <pokoli> jcm: stoping the server will allow you to drop the DB
2017-07-18 13:38 <afibanez> cedk: ok... i will think abour it
2017-07-18 13:39 <jcm> pokoli: ok thks
2017-07-18 14:13 -!- rpit(~rpit@2a02:908:e671:9f80:56ee:75ff:fe0d:d3c7) has joined #tryton
2017-07-18 14:20 <jcm> me again... I don't find how to add users through proteus: with only company module activated, I get on user.main_company = company an AttributeError: 'res.user' Model has no attribute '_changed_values': {'employee': None, 'company': Pool().get('')(**{}), 'main_company': Pool().get('')(**{})}
2017-07-18 14:20 <jcm> without setting main_company raises a UserError in tryton4.4/trytond/trytond/res/", line 298, in create
2017-07-18 14:20 <pokoli> jcm: have you saved the company first?
2017-07-18 14:21 <jcm> pokoli: yes
2017-07-18 14:21 <pokoli> jcm: it's strange because you should probably get the company id on the repr, but I see an empty values :$
2017-07-18 14:22 <jcm> pokoli: found... company above is company = company_config.form. I need to reload the proper object
2017-07-18 14:47 -!- alexbodn(~alex@ has joined #tryton
2017-07-18 15:27 -!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton
2017-07-18 15:49 -!- thaneor1(~ldlc6@ has joined #tryton
2017-07-18 15:52 -!- mariomop_(~quassel@ has joined #tryton
2017-07-18 16:05 -!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton
2017-07-18 16:09 -!- smarro(~sebastian@ has joined #tryton
2017-07-18 16:17 -!- kstenger( has joined #tryton
2017-07-18 17:51 -!- JosDzG(~Thunderbi@ has joined #tryton
2017-07-18 17:55 <orphean> I've been looking through to try and find why nginx proxying ssl is preventing the client from connecting and I'm not going to lie I'm a bit lost.
2017-07-18 17:55 <orphean> I can connect to the static werkzeug server fine through a browser with ssl on port 8000
2017-07-18 17:56 <orphean> and the client even seems like it starts to connect as the green bar starts shuttling backward and forward in Profile Editor window
2017-07-18 17:56 <orphean> but then all I get is "Could not connect to the server"
2017-07-18 17:56 <pokoli> orphean: have checked the know_hosts of the tryton client?
2017-07-18 17:56 <orphean> I nuked that file twice already
2017-07-18 17:57 <orphean> Is there some sort of url decoration I need to put on the url for the client to detect it should connect with ssl?
2017-07-18 17:57 <pokoli> orphean: are you using custom certificates?
2017-07-18 17:57 <pokoli> orphean: which tryton version?
2017-07-18 17:57 <orphean> 4.4
2017-07-18 17:57 <pokoli> orphean: have a look at:!topic/tryton/S4eyVIe-b04
2017-07-18 17:57 <orphean> my certificate are from letsencrypt authority and installed in nginx
2017-07-18 17:58 <orphean> tryton is running on standard http behind nginx reverse proxy
2017-07-18 17:58 <pokoli> orphean: have you checked nginx logs?
2017-07-18 18:00 <orphean> I will do much more digging myself, I was just checking at this point whether there was some obvious url decoration / switch I needed to flip in the client.
2017-07-18 18:00 <orphean> I'll update once I find a solution.
2017-07-18 18:00 <orphean> Thanks
2017-07-18 18:10 -!- Telesight( has joined #tryton
2017-07-18 19:10 <orphean> Alright so after much messing around I was constantly missing in the logs nginx is throwing 400 responses rather than 200s over ssl
2017-07-18 19:10 <orphean> After enabling debug logging in nginx its throwing the response because it claims "client sent plain HTTP request to HTTPS port while reading client request headers"
2017-07-18 19:11 <orphean> so now i need to work out how to configure nginx to ignore this situation or rewrite some headers or whatever
2017-07-18 19:20 -!- smarro( has joined #tryton
2017-07-18 19:51 -!- robinak(~quassel@unaffilated/robink) has joined #tryton
2017-07-18 20:36 <orphean> yea so I don't have a development environment set up for the client right now so I can't check where exactly but the try block in https_connection must be failing on some ssl.SSLError and falling back to http_connection() as the known hosts file keeps getting updated with the hostname without the fingerprint
2017-07-18 20:37 -!- JosDzG(~Thunderbi@ has joined #tryton
2017-07-18 20:56 <kwmiebach> Hello. In relatorio, is it possible to define a python function?
2017-07-18 20:56 -!- deep-book-gk_(~1wm_su@ has joined #tryton
2017-07-18 20:57 -!- deep-book-gk_(~1wm_su@ has left #tryton
2017-07-18 20:58 -!- JosDzG(~Thunderbi@ has joined #tryton
2017-07-18 21:09 -!- alexbodn(~alex@ has joined #tryton
2017-07-18 21:39 <cedk> kwmiebach: no, it is a template engine
2017-07-18 21:40 <cedk> kwmiebach: if you need a method, just add it to the report context
2017-07-18 21:41 <cedk> orphean: run it in verbose mode
2017-07-18 21:44 <kwmiebach> cedk thank you, I will look into the context
2017-07-18 21:49 <cedk> kwmiebach: the method to override is: Report.get_context
2017-07-18 22:01 -!- semarie_(~semarie@unaffiliated/semarie) has joined #tryton
2017-07-18 22:47 <orphean> hi cedk, I narrowed it down to SSL Handshake failure
2017-07-18 22:48 <orphean> I still don't know why as my certificate chain is working fine for standard https
2017-07-18 22:52 <orphean> SSL_do_handshake() failed (SSL: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca:SSL alert number 48) while SSL handshaking, client: ::::::, server: [::]:8000
2017-07-18 22:52 <orphean> nginx error log
2017-07-18 22:53 <orphean> i chopped out the ipv6 client address
2017-07-18 22:56 <orphean> At this point I'm going to break and continue looking at it tomorrow
2017-07-18 23:12 -!- cedk(~ced@gentoo/developer/cedk) has joined #tryton
2017-07-18 23:52 -!- kobain(~kobain@unaffiliated/kobain) has joined #tryton

Generated by 2.17.3 by Marius Gedminas - find it at!