IRC logs of #tryton for Monday, 2021-02-08

chat.freenode.net #tryton log beginning Mon Feb 8 12:00:02 AM CET 2021
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:41
-!- thaneor(~acer8@r167-61-8-158.dialup.adsl.anteldata.net.uy) has joined #tryton01:41
-!- thaneor1(~ldlc6@r167-61-8-158.dialup.adsl.anteldata.net.uy) has joined #tryton01:41
-!- htgoebel3(~hartmut@ppp-188-174-51-222.dynamic.mnet-online.de) has joined #tryton03:13
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton06:13
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton08:15
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton08:22
-!- udono(~udono@091-057-210-188.ip-addr.inexio.net) has joined #tryton08:34
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:40
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton10:06
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton10:12
-!- lucascastro(~lucascast@177-185-133-183.dynamic.isotelco.net.br) has joined #tryton10:16
-!- mariomop(~quassel@181.29.189.235) has joined #tryton10:48
-!- sharkcz(~sharkcz@19.161.broadband4.iol.cz) has joined #tryton12:21
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton12:45
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton13:01
-!- thaneor(~acer8@r167-61-135-130.dialup.adsl.anteldata.net.uy) has joined #tryton13:43
-!- thaneor1(~ldlc6@r167-61-135-130.dialup.adsl.anteldata.net.uy) has joined #tryton13:43
-!- lucascastro(~lucascast@177-185-131-162.corp.isotelco.net.br) has joined #tryton14:46
-!- lucascastro(~lucascast@177-185-131-162.corp.isotelco.net.br) has joined #tryton14:53
pokoliHirschbeutel: back at the office :)14:59
pokolibut I did not sleep the full weekend :P14:59
Hirschbeutelhopefully because of good things :)15:00
mrichezhi, i'm testing routes with tryton 5.8. Got a strange behaviour: when launching trytond manually with the hello_world route  it's ok. But after, i'm using systemd to launch my trytond (systemctl start trytond.service), got a 405 error (method not allowed) for my hello_world route. Any idea ?15:26
-!- amprxc(b97aa1f7@185.122.161.247) has joined #tryton15:28
-!- lucascastro(~lucascast@177-185-133-183.dynamic.isotelco.net.br) has joined #tryton15:29
pokolimrichez: as far as your systemd lauches trytond it should be no diference15:44
mrichezpokoli: that's what i thought... it's working with tryton 5.6 . Here i'm testing with a new installation with tryton 5.8.15:45
mrichezwerkzeug 0.14.1 with tryton 5.6, werkzeug 0.15.6 with tryton 5.815:47
mrichezjust testing route example hello_world (https://docs.tryton.org/projects/server/en/latest/topics/user_application.html)15:48
pokolimrichez: did you see any error on systemct logs?15:48
mrichezpokoli: no15:49
mrichezanother question: should i absolutely use module user_application to get access on Pool ? i try to create a route "/login" to check login with authenticate method of module web_user15:59
mrichezI found something strange about routes (see my first question). Launching trytond with a route, trying to call route -> Error 405. If i launch a gtk client, no more error. So i need to launch once the client to have access on routes16:11
pokolimrichez: if you have user_application decorator you should not use web_user autentication16:13
pokolimrichez: user_application used a token based autentification. THe user requests an app and then allows access to it from the user prferences16:14
pokolimrichez: did you have the -d flag on the systemctl? It sounds like the pool is not initialized16:15
cedkmrichez: this looks like your routes are not registered at startup16:15
mrichezpokoli: indeed no -d flag in my systemctl :-)16:16
mrichezfor the second question, i try with an external application to have a login (using web_user module) so i don't want to use user_application16:17
pokolimrichez: then you can use the routes but without the user_application decorator16:17
mrichezok, but my question is: could i use method of a model without authentification... so i'll define a route /login with a post method (email, password) and in this route i'll call the authenticate method of the web_user module.16:19
mrichezCan i do this as "anonymous user'16:20
-!- lucascastro(~lucascast@177-185-133-183.dynamic.isotelco.net.br) has joined #tryton16:21
pokolimrichez: yes you if you do not set the app.auth_required decorator16:22
pokolimrichez: for example this route is allowed witouth autentication: https://hg.tryton.org/trytond/file/caadf76bf505/trytond/res/routes.py#l2016:22
pokolimrichez: but the html_editor requires the user to be autenticated: https://hg.tryton.org/trytond/file/caadf76bf505/trytond/ir/routes.py#l4516:23
mrichezpokoli: ok thanks. Will check examples and try this way :-)16:23
HirschbeutelACTION nice feature to grab some posts from discuss - a simple way to contrubute, having backlinks for the org and publishing outside without loosing the content17:04
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton17:10
-!- thaneor2(~acer8@r167-61-135-130.dialup.adsl.anteldata.net.uy) has joined #tryton17:49
-!- thaneor(~acer8@r167-61-135-130.dialup.adsl.anteldata.net.uy) has joined #tryton17:58
mrichezShould i use a specific header to test a route with a "POST", got a 403 Forbidden18:56
cedkmrichez: you must allow the POST method for the route19:14
mrichezcedk: i did this way : @app.route('/<database_name>/hello', methods=['POST'])19:15
mrichezcedk: here's the small code (not working - Forbidden 403) : https://pastebin.com/4122aBdZ19:20
Hirschbeutelmrichez: and how you are doing the POST?19:22
mrichezHirschbeutel: with a curl: curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -i 'http://172.16.99.30:8000/tryton_fusion/hello' --data '{"email": "test@test.com"}'19:23
cedkmrichez: are you sure the code is imported?19:25
mrichezcedk: yes, i first try with a 'GET', example from the doc. Which was working. So i update code to try 'POST'19:26
mrichezback in 20 minutes... will read if any suggestion...19:30
-!- lucascastro(~lucascast@177-185-131-162.corp.isotelco.net.br) has joined #tryton19:42
-!- htgoebel3(~hartmut@ppp-188-174-51-222.dynamic.mnet-online.de) has left #tryton20:05
mrichezcedk: error raise here : http://hg.tryton.org/trytond/file/tip/trytond/wsgi.py#l16920:12
mrichezcedk: it's a cors problem20:23
cedkmrichez: strange you do not set any Origin in your request20:26
mrichezcedk: no, but exception raise for this test20:27
cedkmrichez: but it can be raised only if Origin header it set20:30
mrichezcedk: i execute request in browser with an extension, when executing in terminal it's working20:30
mrichezcedk: using extension RestClient in firefox, or RestER20:31
cedkmrichez: if the url of the page is not the same as the server address, than you actually have to configure CORS20:32
mrichezprobably browser sends an Origin - i set the url of the server in the extension form20:34
mrichezhttps://pasteboard.co/JNs8DUi.png20:34
mrichezbut now, i know it's working doing test in terminal :-)20:35
mrichezi'll go. See u tomorrow. Good night!20:36
Hirschbeutelcedk: ping21:15
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton21:28
cedkHirschbeutel: pong22:00
Hirschbeutelcedk: is jurrasic using supply_on_sale ?22:01
Hirschbeutelcedk: sitting here on designing a module which keeps track on external warehouses which are only monitored22:02
cedkHirschbeutel: yes recently for https://www.jurassicfruit.com/en/category/47/farmer-box?showCart=0&page=122:03
cedkbut without caring of supplier stock22:03
Hirschbeutelcedk:  ok - but I think its a possible common use case ...22:04
Hirschbeutelcedk: I startet a module - will propose a design tomorrow on discuss - but right now I think my current aproach is not straightest way to think :)22:07
Hirschbeutelcedk: Possibly with some sleep I get the idea22:08
Hirschbeutelcedk: one last question allowed?22:09
Hirschbeutelcedk: tommorow :)22:11

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