IRC logs of #tryton for Wednesday, 2013-09-18

chat.freenode.net #tryton log beginning Wed Sep 18 00:00:02 CEST 2013
2013-09-18 08:17 -!- priyankarani(~priyanka@122.177.8.204) has left #tryton
2013-09-18 11:48 <jvblasco> Guys any documentation / tips for deploying a tryton in a production server? For development i'm using the ppa in the google code wiki. But my guess is that it may not be the most optimal way for production environments (maybe i'm wrong)
2013-09-18 11:55 <yangoon1> jvblasco: which PPA? Ubuntu?
2013-09-18 11:56 <yangoon1> jvblasco: especially for production environments I would recommend distribution packages
2013-09-18 12:00 <jvblasco> yangoon1: yeah, the ubuntu one. The problem with distro packages is that it packages tryton 2.4 not 2.8
2013-09-18 12:00 <jvblasco> yangoon1: https://launchpad.net/~rayanayar/+archive/tryton-2.8
2013-09-18 12:05 <yangoon1> jvblasco: I meant packaged software for the distribution, so you can go with the PPA
2013-09-18 12:05 <jvblasco> i c
2013-09-18 12:05 <corro> I recommend packages from PYPI, they are most up-to-date and earlier versions are available too. Like that you have full control over your environment.
2013-09-18 12:06 <corro> Be sure to checkout virtualenv too, no need to install the packages globally
2013-09-18 12:07 <jvblasco> yangoon1, corro: may i say that pypi is the officialy maintained packaging and ppa is community maintained?
2013-09-18 12:08 <corro> jvblasco: Official packages are released on PYPI, yes. I don't know who maintains the PPA meantioned.
2013-09-18 12:08 <yangoon1> corro: I disagree for production environments. You have perhaps full control, but you *must* take it. You are out of the package management of the system and have to take care of the consequences.
2013-09-18 12:09 <yangoon1> corro: a look at the PPA mentionned could help
2013-09-18 12:10 <jvblasco> yangoon1, corro: i may go, for speed purposes, with the ppa right now. But maybe in the future i will switch to pypi
2013-09-18 12:11 <corro> yangoon1: You have to take control over the packaging system anyway, just imagine the PPA get updated to 3.0 but you want to stay at 2.8 for a while?
2013-09-18 12:11 <jvblasco> corro: u can always tell apt to freeze the version
2013-09-18 12:12 <yangoon1> corro: yes, use the package management adequate and set preferences
2013-09-18 12:12 <jvblasco> anyway i'm new to python and i'm still getting used to tools like pypi, virtualenv is an unknown for me, and i need to study that. But right now time is my enemy
2013-09-18 12:13 <jvblasco> corro: if u can point me in the right direction working with pypi / virtualenv (i mean point to some good starting docs) i would really appreciate the help ;)
2013-09-18 12:14 <jvblasco> yangoon1, corro: anyway thanks so much for the help and your time guys ;)
2013-09-18 12:14 <yangoon1> jvblasco: welcome
2013-09-18 12:31 <sisalp1> jvblasco: I use pypi/environment too for my hosting services.
2013-09-18 12:32 <sisalp1> if interested in an installer example, let me know, I have one somewhere
2013-09-18 12:35 <jvblasco> sisalp1: sure
2013-09-18 12:37 <sisalp1> jvblasco: here https://docs.google.com/document/d/1lKIHZcc3TFOUrjQebQ-sVyQ000mIv9gkxJSbCt0JQjE/edit?usp=sharing
2013-09-18 12:38 <sisalp1> jvblasco: tested on a virtual server with debian 7 or ubuntu 12.04
2013-09-18 12:38 <sisalp1> You probably don't need all the complexity, but it gives you an example of a working setup
2013-09-18 12:39 <sisalp1> jvblasco: support on a separate irc in case needed
2013-09-18 12:57 <jvblasco> sisalp1: sure, i will give it a look asap. Thnx so much for sharing ;)
2013-09-18 13:18 <jvblasco> guys i'm having issues with triggers. They are only being processed when i create a register from the client. When i create the register from the code, triggers don't seem to work. Any thing i should know about them? Do they have anything implemented in the client side?
2013-09-18 13:20 <cedk> jvblasco: no everything is done on server side
2013-09-18 13:20 <cedk> jvblasco: but root user doesn't trigger
2013-09-18 13:23 <jvblasco> cedk: ahm. That may be the problem then. Then i wonder how to implement a system where users only have access to an api module but that api needs to create registers and read in other models. I thought changing the user for the transaction would do the trick. May creating a special user for that kind of work the way to go instead of using the root?
2013-09-18 13:32 <cedk> jvblasco: the restriction on root user is not sure, there is a comment in the code
2013-09-18 13:35 <jvblasco> cedk: in the ir trigger code?
2013-09-18 13:36 <jvblasco> if Transaction().user == 0: return [] # XXX is it want we want?
2013-09-18 13:36 <cedk> jvblasco: yes
2013-09-18 13:37 <jvblasco> cedk: i guess that's what makes root user to not trigger triggers
2013-09-18 13:37 <cedk> jvblasco: yes
2013-09-18 13:40 <jvblasco> cedk: thnx so much, i'll try to find a workaround with the admin user or creating a specific user for that. btw may i switch to, for example, the admin with the "with" statement using "with Transaction().set_user(1, set_context=True):" or i have to log the admin user in runtime?
2013-09-18 13:44 <cedk> jvblasco: no you can
2013-09-18 13:52 <jvblasco> cedk: and where may i find documentation about contexts and context management?
2013-09-18 13:57 <jvblasco> cedk: i mean in tryton
2013-09-18 14:08 <cedk> jvblasco: it is managed by Transaction: http://doc.tryton.org/2.8/trytond/doc/ref/transaction.html?highlight=context#transaction
2013-09-18 14:11 <cedk> jvblasco: by the way: http://codereview.tryton.org/1073002
2013-09-18 14:11 <cedk> jvblasco: I think it is a better behavior
2013-09-18 14:13 <WUD> are text fields like 'description' on 'product' stored as null in the database when they are empty or empty strings?
2013-09-18 14:15 <jvblasco> WUD: u mean when created from the client?
2013-09-18 14:15 <jvblasco> WUD: or created with the ORM in the code?
2013-09-18 14:15 <cedk> WUD: depends what you mean by empty
2013-09-18 14:15 <WUD> created from the client
2013-09-18 14:16 <jvblasco> WUD: With the client the field in the database has an empty string, from the code the field in the database has nothing.
2013-09-18 14:16 <WUD> so it stores it as an empty string, because it happens from the client
2013-09-18 14:16 <WUD> an empty string is , ''
2013-09-18 14:16 <jvblasco> WUD: that would be my guess. Yeah that's what i see in the database ;)
2013-09-18 14:17 <jvblasco> WUD: anyway im new to tryton, i may be mistaken.
2013-09-18 14:17 <WUD> I think It should be null
2013-09-18 14:17 <WUD> or nil
2013-09-18 14:18 <cedk> WUD: client can not show None but only an empty string
2013-09-18 14:18 <cedk> WUD: so both could be in the DB and you always have to deal with
2013-09-18 14:18 <WUD> I have to deal with both? An empty and a nil?
2013-09-18 14:18 <jvblasco> cedk: is that code review planned to enter the trunk code?
2013-09-18 14:19 <cedk> jvblasco: as all codereview
2013-09-18 14:23 <cedk> jvblasco: indeed I put the comment because I had no idea of cases where we would like something else
2013-09-18 14:24 <cedk> but now, at least with your example doing "sudo" should trigger
2013-09-18 14:36 -!- WUD(~WUD@122.177.8.204) has left #tryton
2013-09-18 14:38 <jvblasco> cedk: what do u mean with sudo?
2013-09-18 14:39 <cedk> jvblasco: using root user to perform some action but keep user in context
2013-09-18 14:39 <jvblasco> cedk: with Transaction().set_user(0, set_context=True):?
2013-09-18 14:39 <cedk> jvblasco: yes
2013-09-18 14:40 <jvblasco> cedk: hehehe, ok. Thanks so much for the help. A workaround would have been very painfull ;)
2013-09-18 14:55 <vezjakv> cedk: hi, regarding submitting translations for different core modules: can there be a single review for multiple modules, e.g. for account, account_invoice, account_...
2013-09-18 14:56 <vezjakv> cedk: or each module has its own review id (since module has own repo)
2013-09-18 14:59 <cedk> vezjakv: you can become the official translator for your language
2013-09-18 14:59 <cedk> vezjakv: than you will have push access
2013-09-18 15:00 <cedk> vezjakv: but before that you should submit few translation to check if you follow correctly the guidelines
2013-09-18 15:00 <vezjakv> cedk: yes, make sense
2013-09-18 15:01 <vezjakv> cedk: so, for each module a separate review id?
2013-09-18 15:01 <cedk> vezjakv: at first
2013-09-18 15:01 <vezjakv> cedk: ok, thnx
2013-09-18 16:53 <jvblasco> cedk: It all works like a breeze with the patch. Everything working as intended. Thank u very much cedk. The opportunity cost of the work around would have meant a failure in the project. U saved me there ;)
2013-09-18 16:54 <jvblasco> BTW i think i found a bug in the email_template module.
2013-09-18 16:54 <jvblasco> i know it's not part of the core but still a very usefull modulethough
2013-09-18 16:55 <cedk> jvblasco: please report to the author
2013-09-18 16:56 <jvblasco> maybe it's intended, but i will ;)
2013-09-18 17:01 <cedk> jvblasco: always report, authors will be happy to have your feedback
2013-09-18 17:01 <jvblasco> cedk: yeah, same as startups (like us) live from customer's feedback xD
2013-09-18 17:04 <jvblasco> cedk: btw, when are code reviews merged in the trunk?
2013-09-18 17:05 <cedk> jvblasco: when reviewed normally
2013-09-18 17:06 <cedk> jvblasco: but sometimes, I got some reviews nobody looks so I push them after few days
2013-09-18 17:16 <vezjakv> hi all, 1q: does localize_modules.py from tryton-tools work with trunk? it worked with 2.8 branch
2013-09-18 17:17 <cedk> vezjakv: did you test it?
2013-09-18 17:18 <jvblasco> mmmmmmm
2013-09-18 17:18 <vezjakv> cedk: when executing PYTHONPATH=.:../proteus ../tryton-tools/localize_modules.py -l sl_SI -d testdb trytond/modules, I've got:
2013-09-18 17:18 <vezjakv> cedk: /database.py", line 344, in execute return self.cursor.execute(sql) sqlite3.OperationalError: table ir_configuration already exists
2013-09-18 17:19 <jvblasco> guys, i have created a user that doesn't belong to any group and it has read access to party, carrier and product modules. Am i missing something? Is it the intended behaviour?
2013-09-18 17:20 <vezjakv> cedk: anyway, I'll do it manually through Export Translation
2013-09-18 17:21 <jvblasco> may that user inherit any kind of access rule from the company it belongs to?
2013-09-18 17:27 <jvblasco> I also tried creating a group that only has access to a model that doesn't have any field, just methods. And it keeps havind read/write access to those models.
2013-09-18 17:27 <jvblasco> having*
2013-09-18 17:38 <cedk> vezjakv: I think this should fix the script: http://codereview.tryton.org/1076002/
2013-09-18 17:39 <cedk> jvblasco: yes it is intended behavior
2013-09-18 17:39 <jvblasco> cedk: and how do i cut all kind of access to any model?
2013-09-18 17:40 <jvblasco> cedk: i need users without any access to the system aside from an api-like model
2013-09-18 17:40 <cedk> jvblasco: except maybe for carrier
2013-09-18 17:41 <cedk> jvblasco: create model access
2013-09-18 17:42 <jvblasco> cedk: give it a look in test.urbansherpas.es:8000 db: ProvesPermisos user: admin pass: provisional123 | created user: usuario pass: usuario123
2013-09-18 17:45 <jvblasco> cedk: dbname ProvesPermissos, sry
2013-09-18 17:47 <jvblasco> cedk: i created a model access to the api-like model, added the user to the group, and can still read party and above models
2013-09-18 17:48 <cedk> jvblasco: create model access to others models
2013-09-18 17:48 <jvblasco> cedk: ok
2013-09-18 17:59 <vezjakv> cedk: hmm, now it throws: tryton/trunk/trytond/trytond/backend/sqlite/database.py", line 165, in connect db_filename = self.database_name + '.sqlite' TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
2013-09-18 17:59 <vezjakv> cedk: it seems that dbname is not passed somehow
2013-09-18 18:07 <cedk> vezjakv: did you apply the patch also on trytond?
2013-09-18 18:09 <vezjakv> cedk: uf, just proteus, didn't know :(
2013-09-18 18:11 <vezjakv> cedk: is it possible to apply with hgreview --fetch if repo already contains changes? or, I have to apply manually?
2013-09-18 18:15 <cedk> vezjakv: manually or clean the repo
2013-09-18 18:19 <vezjakv> cedk: great! it works. thnx again.
2013-09-18 19:05 <cedk> vezjakv: about translation, I think I can stop submitting review
2013-09-18 19:06 <cedk> vezjakv: let's wait for monday and submit your commits
2013-09-18 19:06 <cedk> vezjakv: after that I will give you push access
2013-09-18 19:06 <cedk> vezjakv: by the way, translators doesn't have the right to modify setup.py
2013-09-18 19:07 <vezjakv> cedk: ok, I felt a bit as 'spammer' :(
2013-09-18 19:07 <cedk> vezjakv: so I will add the classifier later
2013-09-18 19:07 <vezjakv> cedk: so setup.py should be left untouched?
2013-09-18 19:12 <cedk> vezjakv: yes
2013-09-18 19:22 <jvblasco> see u tomorrow everyone ;)

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