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

chat.freenode.net #tryton log beginning Wed Sep 4 00:00:10 CEST 2013
2013-09-04 03:41 <kotek> Hi...
2013-09-04 03:42 <kotek> Anyone here can help with reports generation?
2013-09-04 08:29 -!- dmf(~damienfra@01012313.cism.ucl.ac.be) has left #tryton
2013-09-04 08:46 <abhisar> how to display a field of many2one field of a model in its view in tryton 2.8??
2013-09-04 08:49 <WUD> I have a model which has a M2O field in it, for example: a module which has a M20 for 'sale', now I want to show the 'lines' from 'sale' in the view for my 'module', how do I do it? I've looked for examples through product 2.8 but couldn't find it. Does leaving out inherit in 2.8 cause us to not be able to use specific fields from our referenced modules?
2013-09-04 08:50 <nicoe> abhisar, WUD: use function fields
2013-09-04 08:51 <abhisar> can you please elaborate
2013-09-04 08:56 <nicoe> abhisar: http://doc.tryton.org/2.8/trytond/doc/ref/models/fields.html#function
2013-09-04 08:56 <nicoe> abhisar: There is plenty of example in the code
2013-09-04 08:57 <jeancavallo1> abhisar: Let's assume you have model A which has a M2O link (my_field) to a model B with a Char field (some_data). What you got to do is create a Function field in model A (my_displayer) which will get the value you want so you can display it in a model A view
2013-09-04 10:42 <jvblasco> morning everyone
2013-09-04 10:45 <WUD> Morning
2013-09-04 10:48 <jvblasco> i think i an issue with the session management in the server side. We found that if we create a new database and set the admin password and log in to it as admin u can get admin access to another database through the backup/restore function in the client
2013-09-04 10:48 <nicoe> jvblasco: morning
2013-09-04 10:48 <jvblasco> The process to replicate would be create 2 databases from client with 2 different admin passwords
2013-09-04 10:49 <jvblasco> log into one of them as admin, and then dump the other database.
2013-09-04 10:49 <cedk> jvblasco: of course
2013-09-04 10:50 <jvblasco> delete the database u loged in and restore the other one with the same name as the deleted one
2013-09-04 10:50 <cedk> jvblasco: I see no problem here
2013-09-04 10:50 <cedk> jvblasco: session are in the DB
2013-09-04 10:50 <jvblasco> and u will be able to log with the other database password and not the original one
2013-09-04 10:50 <jvblasco> for example, db1 pass wop db2 pass tururu
2013-09-04 10:51 <cedk> jvblasco: no, you will just be able to use the same session because you dumped it
2013-09-04 10:51 <jvblasco> but i log into the other database
2013-09-04 10:51 <jvblasco> i mean i use db1 password to log into db2
2013-09-04 10:51 <jvblasco> restored database
2013-09-04 10:51 <cedk> jvblasco: and af course password of users are also dumped
2013-09-04 10:51 <jvblasco> excuse my english
2013-09-04 10:52 <jvblasco> yeah, but as soon as i restart the server everything fits again
2013-09-04 10:52 <jvblasco> let me try to explain again
2013-09-04 10:52 <jvblasco> db1 and db2
2013-09-04 10:52 <jvblasco> i log into db1
2013-09-04 10:52 <jvblasco> after that
2013-09-04 10:52 <jvblasco> i dump db2
2013-09-04 10:52 <jvblasco> delete db1
2013-09-04 10:53 <jvblasco> and restore db2 with db1 name
2013-09-04 10:53 <jvblasco> if i try to log into the new db1
2013-09-04 10:53 <yangoon1> jvblasco: it seems you confound admin password of database and of server
2013-09-04 10:53 <jvblasco> i log with the deleted db1 password and not the dumped db2 password
2013-09-04 10:53 <jvblasco> nope
2013-09-04 10:54 <jvblasco> i know admin password is for database managent, and it is configured in /etc/tryton-server.cong
2013-09-04 10:54 <yangoon1> on client side for dumping and restoring you have to use the server admin password
2013-09-04 10:54 <jvblasco> i know
2013-09-04 10:55 <yangoon1> so I don't understand the problem right now
2013-09-04 10:55 <jvblasco> give it a try
2013-09-04 10:55 <jvblasco> create 2 databases
2013-09-04 10:55 <jvblasco> and use different passwords for the admin users
2013-09-04 10:56 <jvblasco> (i know the client admin password for dumping and restoring is another one and configured in the server side)
2013-09-04 10:56 <jvblasco> after that log in in both databases
2013-09-04 10:56 <jvblasco> and dump one of them
2013-09-04 10:56 <cedk> jvblasco: ok get_login has a cache
2013-09-04 10:57 <jvblasco> that was my guess cause as soon as i restarted the server everything went back to normal fucntionality
2013-09-04 10:57 <jvblasco> not sure if i would consider this a security hole
2013-09-04 10:58 <jvblasco> cause anyone with the admin password (not the database one i mean the database management one)
2013-09-04 10:58 <jvblasco> may get access to database he wouldn't get other way
2013-09-04 10:58 <jvblasco> anyway with the admin password he may dump it anyway
2013-09-04 10:59 <jvblasco> not a real issue for a production server with only one database
2013-09-04 11:03 <jvblasco> ok, sry about that, just wanted to ask b4 reporting a bug
2013-09-04 11:04 <yangoon1> jvblasco: no matter to be sorry, would you fill an issue please?
2013-09-04 11:04 <jvblasco> in the bug tracker?
2013-09-04 11:04 <yangoon1> yes
2013-09-04 11:04 <jvblasco> sure
2013-09-04 11:04 <jvblasco> anyway, that makes me wonder
2013-09-04 11:04 <yangoon1> jvblasco: thx
2013-09-04 11:05 <jvblasco> how would i scale horizontally the tryton server with a load balancer if it caches the sessions?
2013-09-04 11:06 <yangoon1> multi_server = True disables caching
2013-09-04 11:12 <jvblasco> yangoon1: Good to know, thnx so much.
2013-09-04 11:13 <yangoon1> jvblasco welcome
2013-09-04 11:18 <jvblasco> i will report that as a bug
2013-09-04 11:19 <jvblasco> i don't think feature or wish is accurate for that.
2013-09-04 11:26 <priyankarani> there seems to be a bug in the convert_domain function of product.py (introduced in migration to 2.8 removal of _inherits)
2013-09-04 11:26 <priyankarani> it will not convert [()]
2013-09-04 11:27 <cedk> priyankarani: for me, it is not a valid domain
2013-09-04 11:27 <priyankarani> it will convert [('template.category', '=', 1)] to [('template', '=', 1)]
2013-09-04 11:27 <priyankarani> cedk: that was a typo
2013-09-04 11:28 <priyankarani> cedk: look at the example i have written.. and I have a patch with test for this
2013-09-04 11:28 <priyankarani> cedk: is there any existing bug report you are aware of, or should i create one ?
2013-09-04 11:29 <cedk> priyankarani: make a search
2013-09-04 11:30 <jvblasco> yangoon1: already reported, also reported the client restore database error although it's restoring it, it throws the error
2013-09-04 11:31 <yangoon1> jvblasco: good
2013-09-04 11:38 <priyankarani> cedk: the related issue is already closed and your patch seems to have introduced the bug http://hg.tryton.org/modules/product/rev/62aadb864911
2013-09-04 11:38 <priyankarani> cedk: https://bugs.tryton.org/issue3118
2013-09-04 11:38 <priyankarani> cedk: do you want me to reopen the issue or create a new one ?
2013-09-04 11:39 <cedk> priyankarani: yes
2013-09-04 11:40 <priyankarani> cedk: reopen ?
2013-09-04 11:42 <cedk> priyankarani: yes if it is not fixed
2013-09-04 14:16 <priyankarani> cedk: In tryton 2.8 we need to pass empty tuple in selection field if there is no default value set. But there is no empty tuple passed for 'Resource' field in ir.attachment ?
2013-09-04 14:17 <cedk> priyankarani: I don't understand the question
2013-09-04 14:22 <priyankarani> cedk: I'm creating attachment in my module. But its breaking saying ('UserError', (u'The field "Resource" on "Attachment" is not in the selection.', '')). I guess Its because no empty tuple is added to selection values of 'Resource' field.
2013-09-04 14:25 <cedk> priyankarani: yes the field is required
2013-09-04 14:25 <cedk> priyankarani: an attachment must be attached to something
2013-09-04 14:25 <jeancavallo1> priyankarani: I am not sure, but I think the idea is that "resource" is considered a mandatory field. It is initialized through the context
2013-09-04 16:48 <jvblasco> where can i find the code where tryton checks the access rules and that kind of stuff? We are somehow stuck in the access rules, not sure how the rules domain is checked and would be nice to know
2013-09-04 17:07 <jeancavallo1> jvblasco: What are you trying to do ?
2013-09-04 17:30 <jvblasco> jeancavallo1: i'm trying to restrict a user to only be able to read, write their own generated sale orders, for example
2013-09-04 17:34 <jvblasco> jeancavallo1: i tried to use the rule [('create_uid', '=', 'res.user.id')], but i thoght using the Transaction.user would be better [('create_uid', '=', 'Transaction.user')]. But i don't really have any clues to what i have access within that domain. That's why i wanted to read the code.
2013-09-04 20:27 -!- vcardon(~vcardon@LNeuilly-152-23-15-185.w193-252.abo.wanadoo.fr) has left #tryton
2013-09-04 20:45 -!- vcardon(~vcardon@LNeuilly-152-23-15-185.w193-252.abo.wanadoo.fr) has left #tryton
2013-09-04 23:23 <kotek> sharkcz, <3
2013-09-04 23:23 <kotek> you are providing relatorio&neso packages for fedora?

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