IRC logs of #tryton for Thursday, 2013-02-28

chat.freenode.net #tryton log beginning Thu Feb 28 00:00:02 CET 2013
plantiancedk: I tried to email it via google drive.00:18
scrapperhello friends, I added a NEW Many2One field to invoice. in this field I am able to select companies (don't worry why) everything works fine now. but report creation only works when the actual context company is selected. if another company is selected Genshi eval.py "StrictLookup" throws an error "company" is not defined.09:02
scrapperhow can i tell Genshi that other companies are welcome too? :-)09:02
scrapperso actually this other "companie(s)" already exist in my tryton DB, but are not active in this user-context. (Because user only has one company in the context - the "active" one.)09:05
scrapperis there a way to hide a field (Many2One) from Genshi report creation? Because this field data is not needed for report creation.09:06
scrapperits just used for some application logic - but not for report itself.09:07
katrscrapper: Can you paste the actual error message somewhere?09:09
scrapperkatr: yes just a second. its short.09:10
katrkatr: Better don't clutter the channel and use something like pastebin.09:11
scrapperkatr: http://dpaste.com/1007505/09:12
scrapperkatr: the error totally makes sense. Genshi does not see this "other company value" in the actual context - because the real company is another one.09:12
katrscrapper: dpaste.com seems to have some technical problems at the moment.09:13
scrapperkatr: so it works for real company, but not if other companies are selected. but my application logic is in the need of this "other company". so the question is - how can i hide this check from Genshi?09:13
scrapperkatr: http://dpaste.com/1007505/09:13
scrapperkatr: for me dpaste.com works fine right now.09:14
katrscrapper: Don't understand what you mean by "real company".09:15
katrscrapper: Works for me too now.09:16
scrapperkatr: the "real company" is the actual company which is active in user context.09:16
scrapperkatr: different users can have different active companies.09:17
scrapperkatr: the story is - i have a main company - the "real company" which is active in user context... BUT i added a field in invoice Many2One where i am able to select another company. the "real" company is still active in user context...09:17
katrscrapper: And you want to pass an additional company to the report not necessarily related to the company of the user doing the print?09:18
scrapperkatr: this "other" company in truth is just a sub-company of the "real" one--- it helps my logic to decide what the report layout should look like. i created two different layouts. "invoice.odt" and "invoice2.odt" ... etc.09:19
scrapperkatr: depending on which "company" is selected in invoice - only the report template changes... but the "real" company always stays the same!09:19
katrscrapper: So if the invoice itself has this second company field you don't have to pass it to the report directly. You can directly access it from the invoice.09:20
scrapperkatr: exactly - i want to hide this "second company field" from report creation. so Genshi should not complain.09:21
scrapperkatr: but don't know how to do this. am I able to hide a field from report creation?09:21
scrapperkatr: maybe it would have been more intelligent to have a STATIC SELECTION than another Company Object... but now my solution is already finished and working. only report creation is giving trouble...09:22
katrkatr: If you pass a field named "company" to a report it should always be the company of the user doing the report.09:22
scrapperkatr: but the field name itself is "invoice_company" only the type is "company".09:23
katrscrapper: If your have a second company just pass a field "company_foo" or add it as field to the source record.09:23
katrscrapper: Don't understand why you want to hide something.09:24
scrapperkatr: ok so i must have messed of with company and "invoice_company". I think you helped me ... now I know what direction I should start looking for the trouble.09:25
katrscrapper: So simply pass "invoice_company = None". And do a check in the report template.09:25
scrapperkatr: ok thank you katr! will do so!09:25
katrscrapper: "invoice_company" is misleading because one would think this is the company the invoice belongs to. So it's better to give it a name according to the business case you're trying to accomplish.09:29
scrapperkatr: you are right! this was just a fast development shot. thank you!09:52
katrscrapper: You're welcome!09:53
-!- scrapper(~scrapper@80-121-31-97.adsl.highway.telekom.at) has left #tryton09:54
cedksharoonthomas: hi, will you provide a new patch for issue3026 ?12:04
sharoonthomascedk: the current patch should apply on 2.6 series, you need a patch in addition for 2.7 ?12:55
cedksharoonthomas: only patch on trunk are applied13:01
cedksharoonthomas: in your usage of Celery, how do you manage the transactions?15:41
sharoonthomascedk: we subclassed Task to build a customer Task class and the task executor handles transaction (and rollback on error)15:43
sharoonthomass/customer/custom15:43
cedksharoonthomas: it is what I thought15:44
cedksharoonthomas: I would like to create a decorator but I don't think it is possible15:44
sharoonthomascedk: a decorator is possible too, provided the task decorator is outside it15:45
sharoonthomascedk: or rollback on error would be difficult15:45
sharoonthomascedk: when you subclass task you will see the ugliness of celery15:46
cedksharoonthomas: you can use base option of Celery.task to provide a custom class15:47
sharoonthomascedk: yes as an argument to task decorator15:47
cedksharoonthomas: in your subclass, you override __call__ ?15:48
sharoonthomascedk: don't remember, looking into code15:49
sharoonthomascedk: what our code does is: you can call any tryton method <modelname>.<methodname> with any given args and kwargs asynchronously. There is only 1 async task handled by celery and all what it does is call this method after recreating the same Transaction context [db, user and context]15:54
sharoonthomascedk: this is the generic part which makes any tryton method call async15:54
cedksharoonthomas: I thought also about that15:55
cedksharoonthomas: but I'm wondering if it is a good idea15:55
sharoonthomascedk: it does not work in all cases, tryton itself does not have methods which work on single records15:56
sharoonthomascedk: it is useful with custom modules which are designed to have class methods which work on multiple records and delegate to instance methods which work on 1 record15:56
cedksharoonthomas: it could be managed like the RPC does15:57
cedksharoonthomas: in some way, I'm wondering if it should not only call __rpc__ methods15:58
sharoonthomascedk: not sure of that since most __rpc__ methods are designed to work with the web service clients and most methods take multiple records as argument. Not the kind of records async processing needs15:59
scrapperHi guys, am I suffering from a BUG? Tryton2.2.4 after adding a Field to invoice... if 1 choice is selected everything works fine... if 2 choice is selected error: UndefinedError: "company" not defined17:26
scrapperThe fun thing is - this error is also thrown when no relation to company is given. (Drink1, Drink2,... whatever)17:27
scrapperIt appears after hitting "Open" on "Invoice Form".17:29
scrapperTraceback: http://dpaste.com/1007912/17:36
cedkscrapper: you have a bug in the invoice report17:36
cedkscrapper: by the way, it is not a good choice to develop on an old version17:37
scrappercedk: its just an adjustment on our running systems - no chance to upgrade to newer version right now. not enough man power. :-/17:37
scrappercedk: thank you - now it works!!!17:56
-!- ciupicri(~ciupicri@unaffiliated/ciupicri) has left #tryton20:07

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!