IRC logs of #tryton for Saturday, 2010-03-06 #tryton log beginning Sat Mar 6 00:00:02 CET 2010
cedksharoon: hi00:21
sharooncedk: hi00:22
cedksharoon: have you started to work on a django frontend?00:22
sharooncedk: frontend?00:22
cedksharoon: webclient00:22
sharooncedk: no00:22
sharooncedk: django web client?00:22
cedksharoon: yes, you told me you had this idea?00:22
sharooncedk: oh thats already implemented00:23
cedksharoon: I was thinking about for the GSOC00:23
cedksharoon: is the code available?00:23
sharooncedk: on personal chat00:23
-!- tekknokrat(~gthielebe@ has left #tryton00:25
-!- rednul_( has joined #tryton02:16
-!- sharoon( has left #tryton03:03
-!- johbo( has joined #tryton03:53
-!- digitalsatori(~tony@ has joined #tryton04:44
-!- yangoon( has joined #tryton05:19
-!- pepeu(~manuel@ has joined #tryton05:25
-!- tekoholic(~quassel@ has joined #tryton07:15
-!- johbo( has joined #tryton08:18
-!- sharkcz( has joined #tryton09:01
-!- carlos(~carlos@ has joined #tryton09:43
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:54
-!- enlightx( has joined #tryton10:00
-!- sharoon( has joined #tryton10:02
-!- tekknokrat(~gthielebe@ has joined #tryton10:26
-!- Gavin_Achado( has joined #tryton10:29
-!- Timitos(~timitos@ has joined #tryton10:55
-!- digitalsatori(~tony@ has joined #tryton11:42
-!- tekknokrat(~gthielebe@ has joined #tryton12:12
cedksharoon: hi13:01
cedksharoon: I read the wiki page about django and I have some questions13:01
sharooncedk: sure13:01
cedksharoon: I see you commit the cursor in place where there was no change13:01
cedksharoon: so you could simply close it13:02
sharooncedk: checking13:02
sharooncedk: agree13:02
sharooncedk: i will change it13:02
cedksharoon: other point, you make a or you already have a BrowseRecord of the invoice13:03
cedksharoon: I don't see where you use "currency_id_TO"13:04
sharooncedk: i have removed some part of the code which is used by our paypal integration13:05
sharooncedk: forgot to remove this part13:05
cedksharoon: you could also remove: "import cProfile as profile" "import threading" "import tempfile"13:07
cedksharoon: and now, I design comment:13:08
cedksharoon: I find a little bit uggly to store the invoice odt in /tmp13:09
cedksharoon: you can not create a dowload function that return on the fly the document?13:09
sharooncedk: that was the way its coded, but errs out when behind apache13:11
cedksharoon: which kind of error?13:13
sharooncedk: wsgi, so it should essentially do :!13:14
cedksharoon: yes and instead of using a file on the system, you could use in IOString13:16
sharooncedk: thought it would be too complex for a simple tutorial integrating django and tryton13:17
sharooncedk: agree,13:18
cedksharoon: using tmp directory could be a security issue13:23
sharooncedk: sure in this case13:24
sharooncedk: it would be freely available for download of all invoices geenrates13:24
cedksharoon: so I think we should try to show best practice even if it is a little bit more complicate13:24
cedksharoon: is it the case of your implementation?13:24
sharooncedk: nope13:24
sharooncedk: we use it for the open erp modules download section13:25
sharooncedk: and other dynamically served protectionless data13:25
sharooncedk: when dynamically generated files need security the snippet i sent is what is commonly used13:25
cedksharoon: it assumes also that the webserver is not chrooted etc.13:28
sharooncedk: i agree and it has to be set as a virual directory under httpd.conf in apache13:29
cedksharoon: if you have code for the dynamic download, you could update the wiki page?13:29
sharooncedk: will do it now13:30
cedksharoon: great thx13:34
-!- dba( has joined #tryton13:38
cedksharoon: one more question:13:44
sharooncedk: sure13:44
cedksharoon: do you think it is possible to generate the html template on the fly by reading the xml view of Tryton?13:44
sharooncedk: i think its possible13:45
cedksharoon: ok I will put this idea for the GSOC13:46
sharooncedk: cool13:46
-!- woakas( has joined #tryton13:46
cedksharoon: wait, we are not yet selected for GSOC :-)13:47
sharooncedk: looks like i could apply too... i am doing my MS in Information Systems... so a student?13:52
cedksharoon: you should check with Google13:53
cedksharoon: we apply as an organisation to mentor students13:53
sharooncedk: i know13:53
cedksharoon: we = Tryton devs13:53
cedksharoon: but I think you can not apply as student if you are also a mentor14:03
sharooncedk: i am nearly done with my topic of dissertation, waiting for school to approve... its in e-commerce14:08
cedksharoon: sorry one more remark for django invoice module14:25
sharooncedk: please, tell me14:25
cedksharoon: you call print_invoice but it can break stuff as it will store the invoice report on the invoice even if the invoice is still in draft format14:25
cedksharoon: you should call the invoice report instead that take care of this for you14:26
sharooncedk: ok14:26
sharooncedk: can you modify accordingly?14:26
cedksharoon: ok14:26
-!- digitalsatori(~tony@ has joined #tryton14:32
cedksharoon: done14:33
sharooncedk: thanks, checking14:33
cedksharoon: is it required to use tempfile?14:33
cedksharoon: you can not use IOString?14:34
sharooncedk: its better14:34
sharooncedk: i had several issues while serving open erp modules dynamically14:34
cedksharoon: I mean StringIO14:34
sharooncedk: thats what is normally done with django and report lab14:35
sharooncedk: V14:35
sharooncedk: it could be also because i work on the trunk version of django ;) string IO is another alternative and faster since its c14:37
cedksharoon: update the code with StringIO14:39
cedksharoon: it is more secure14:39
sharooncedk: ok14:39
cedksharoon: there is still now a possible improvment for content_type14:42
sharooncedk: depending on the file format it could be changed14:43
cedksharoon: content type fixed14:50
sharooncedk: cool14:53
cedksharoon: if you can test the code it will be great14:56
-!- gremly( has joined #tryton15:01
sharooncedk: format, report, _, file_name = invoice_obj.execute(cursor, user, [inv_id], {}) is not working15:07
cedksharoon: what is the problem?15:11
sharooncedk: return value is format="id", report=None, _=None, file_name=None15:12
cedksharoon: strange15:12
cedksharoon: are you sure you get the report object?15:14
cedksharoon: fixed15:18
sharooncedk: still not fixed15:47
cedksharoon: where is it failed?15:49
sharooncedk: will let you know15:49
-!- digitalsatori(~tony@ has joined #tryton16:08
-!- juanfer( has joined #tryton16:17
-!- carlos(~carlos@ has joined #tryton16:31
-!- FWiesing( has joined #tryton16:36
cedksharoon: no news?16:56
-!- tekknokrat(~gthielebe@ has joined #tryton17:08
-!- paepke( has joined #tryton17:10
sharooncedk: no issues17:13
sharoonits right17:13
sharooncedk: file_name should be + format17:13
sharoon"." + format17:14
sharooncedk: also StringIO.StringIO(data) doesnt seem to work17:14
cedksharoon: not sure to understand17:14
sharooncedk: had to initialise and then write data separately17:14
sharooncedk: BTW i use ctringIO17:15
sharoonprobalbly because fo that17:15
sharooncedk: the file_name is now just Invoice, it has to be file_name+"."+format17:15
sharoonrather "%s.%s" %(file_name,format)17:16
cedksharoon: ok17:16
cedksharoon: it is all?17:18
sharoonthats all17:18
cedksharoon: fixed on wiki17:23
sharooncedk: cool17:23
sharooncedk: 1 more17:24
sharoonreportIO = StringIO.StringIO() is not the format17:24
sharoonreportIO = StringIO()17:24
cedksharoon: no StringIO is the module17:26
sharoon>>> import cStringIO17:26
sharoon>>> dir(cStringIO)17:26
sharoon['InputType', 'OutputType', 'StringIO', '__doc__', '__name__', '__package__', 'cStringIO_CAPI']17:26
sharoon>>> dir(cStringIO.StringIO)17:26
sharoon['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']17:26
cedksharoon: but not for StringIO17:27
sharooncedk: so the import should be modified for stringIO as `from StringIO import StringIO17:27
sharoonand reportIO = StringIO()17:27
cedksharoon: it is the same17:28
sharooncedk: got it17:28
sharooncedk: my bad.... dint read property17:29
cedksharoon: I have made some improvement to the code17:57
cedksharoon: I found that the cursor could be closed too early17:57
sharooncedk: yes17:57
cedksharoon: is "render_to_response" process the rendering ? Or it is a object that is render later?17:58
sharooncedk: render_to_reponse renders a template in the given context and returns a httresponse17:59
cedksharoon: ok so after this call, the BrowseRecord will no more be used18:00
sharooncedk: yes18:01
sharooncedk: its used18:01
sharooncedk: its used in the template18:01
cedksharoon: ok because in your implementation the cursor is closed before rendering18:03
sharooncedk: looks like we replaced it today18:03
sharooncedk: its only a cursor commit18:03
cedksharoon: so if the template require to make a database query to fetch more data, it will fail18:03
cedksharoon: and what is "c = get_context(request, response)"18:04
cedksharoon: and "c.update(csrf(request))"18:04
sharooncedk: special functions18:04
sharooncsrf is cross site reference protection18:05
sharoonlookslike the code snippets needs to be cleaned up and the import be included18:05
sharooncedk: fixed18:09
cedksharoon: you changed "from controllers.tryton", why?18:11
sharooncedk: controllers is a different app18:11
cedksharoon: ok, there is still one, I will remove it18:11
sharooncedk: here i assume that the is in same folder18:11
cedksharoon: is there a specific directory strucure for all that files?18:13
sharooncedk: yes, all this usually goes into a single app18:14
sharooncedk: and the html into a templates folder which further striuctures accordning to app18:14
sharooncedk: when we say view, it goes into of an app18:14
cedksharoon: is it possible to give the filename of all the codes?18:15
sharooncedk: good idea18:15
sharoonwill do on top18:15
cedksharoon: good like a tree structure18:16
cedksharoon: because I don't know django and I don't see well how all this code is organized18:16
-!- enlightx( has joined #tryton18:22
sharooncedk: done18:29
cedksharoon: great18:35
-!- ikks(igor@ has joined #tryton20:19
cedksharoon: thx for the email20:29
cedksharoon: I will try to answer and give their my vision and how tax include of OpenERP can not work20:30
cedksharoon: a reflection that I had 4 ago when I worked at Tiny :-)20:33
-!- carlos( has joined #tryton20:37
-!- tekknokrat(~gthielebe@ has joined #tryton21:43
-!- rednul_( has joined #tryton21:46
-!- Franz_( has joined #tryton22:04
-!- FWiesing( has joined #tryton22:35
-!- FWiesing( has left #tryton22:36
-!- FWiesing( has joined #tryton22:37
-!- Gavin_Achado( has joined #tryton23:24

Generated by 2.11.0 by Marius Gedminas - find it at!