IRC logs of #tryton for Wednesday, 2013-08-21 #tryton log beginning Wed Aug 21 00:00:02 CEST 2013
-!- priyankarani(~priyanka@ has left #tryton08:05
-!- vcardon( has left #tryton09:10
jvblascomorning everyone11:23
sisalp2jvblasco: hi11:24
b0r7i want to add the usernam of the current logged in user to a report, but having trouble finding the model that is porviding it. The username (full: Name and Surname) is schon (e.g.) on the bottom left of the Client.. could one maybee point me in the right direction? grepping for 'username' resulted in a lot of 'rpc' stuff15:50
b0r7ah.. res.user is it, i think..15:53
jvblascou mean u want to use the user name of the user generating the report?15:56
b0r7jvblasco: yes15:56
jvblascoand yeah, the user is the res.user model15:57
jvblascothen u have to retrieve it from the transaction/context15:57
jvblascolater on get the model with the Pooler, make a search_read with the criteria u got from the context/transaction15:57
jvblascoand there u go15:57
jvblascoanyway i'm not really an expert in tryton. I know openERP passes the username in the context15:58
jvblascobut i think in tryton u can retrieve it from the transaction object15:58
b0r7uff okay.. sounds complicated.. i guess im going to find out thanks for the pointers!15:59
jvblascogimme a sec to check if i can find a code example15:59
jvblascolet's see if i can simplify it a little16:00
jvblascoanyway i may be wrong, but there it goes16:00
jvblascoif u import the Transaction module16:01
jvblascou should be able to do something like Transaction().context.get('user')16:01
jvblascomaybe it's uid and not user, didn't need to work with that16:01
jvblascothat should return the uid or the username doing that transaction16:02
jvblascofrom there16:02
jvblascou just need to retrieve the object through the ORM16:02
jvblascogimme a sec, i need to document myself, still haven't worked hard with the ORM so i still don't know everything it is capable of16:04
jvblascolater on u retrieve the model with the Pooler16:05
b0r7Transaction().user gives me the uid..16:05
jvblascouser = Pool.get('res.user')16:06
jvblascoafter that u only need to do a search_read16:06
jvblascouser.search_read(Don't really know the how are the params passed)16:07
jvblascobut u can find it in
jvblascothat would be the way to do it i know16:07
jvblascomaybe there's a better one16:07
jvblascobut that's the one i can come with ;)16:08
jvblascohope it helped16:08
b0r7oaky.. that is extremely helpful.. i need some time to work it out, though ;).. thanks a lot16:08
albertcaIn fact you should:16:10
albertcaUser = Pool().get('res.user') # Note the parenthesis after Pool16:10
jvblascoyeah, i come from openERP and still learning tryton16:11
albertcauser = User(Transaction().user) # Now you have the object of the user16:11
albertcajvblasco: most of us come from openerp16:11
albertcajvblasco: :)16:11
jvblascoalbertca: yeah, i know. Anyway i'm falling in love with this framework. Much better implementations in many places16:12
albertcajvblasco: yes...16:12
albertcab0r7: no need for search_read16:12
jvblascoalbertca: and the most important thing, it's simpler to generate code here16:12
b0r7Pool().get('res.user') leads to an error , stating: database_name = Transaction().cursor.database_name 'NoneType' object has no attribute 'database_name'16:19
albertcab0r7: Mm... I don't have experience with relatorio reports. The expression I provided was if doing a normal module16:25
albertcab0r7: I'd say you should have examples in the code, though16:26
b0r7yeah.. i think im getting there..16:27
jvblascobest time investment u'll do16:27
jvblascolooking in the code > most things to some extent xD16:28
cedkb0r7: you are probably outside of a transaction16:29
jvblascoguys, is there any how to about generating documentation?  Are there any "standards" to generate it?17:01
cedkjvblasco: make html or
jvblascocedk: mmmmmm, too many things to do and really little time. Anyway i meant howto type documentation. For example, generate tutorials for JSON-RPC17:14
jvblascocedk: I had some issues communicating php tryton via JSON- RPC and was thinking about generating some how to documentation to achieve that17:15
jvblascocedk: i try to generate it for internal wikis and that kind of stuff, but wanted to know if u have any standard to do it, to save time and generate it only once.17:17
cedkjvblasco: I don't understand17:18
jvblascocedk: when i solve a problem, and if time allows me to do it, i try to generate how to documentation about how that specific thing works. Later on i add it to an internal wiki we have in the enterprise17:19
jvblascocedk: i just wanted to know if there are any standards about generating that kind of documentation to add it to the tryton wiki as soon as the doc is finished17:20
jvblascocedk: excuse my english...17:21
jvblascocedk: not sure if i clarified anything17:21
cedkjvblasco: we use rst17:22
jvblascocedk: ok17:23
jvblascocedk: if i have time to generate in spanish, i will try to translate it to english to upload it to the wiki17:23
Piloujvblasco: It is better to patch the documentation than to update the wiki.17:34
cedkPilou, jvblasco: but doc about PHP code will not be included in base17:36
Piloujvblasco: yep documentation not considered useful by cedk will be rejected17:37
jvblascocedk, Pilou: good to know17:41
Pilouso you could update the wiki :)17:43
jvblascoMay i ask how do u delete Products, Party or Carriers from the client?17:43
jvblascoPilou, cedk: anyway if i can spend the time to generate it someday i will let u know or whatever. If u find it useful i'm sure u will know what to do with it :)17:45
plantianif read is not ordered is it just expected that client re-sorts the results based on the ids returned from search?18:23
cedkplantian: yes because client create records before reading them18:24
plantiancedk: okay thanks18:25
-!- vcardon( has left #tryton18:51
-!- katr( has left #tryton22:41

Generated by 2.11.0 by Marius Gedminas - find it at!