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

chat.freenode.net #tryton log beginning Thu Feb 28 00:00:02 CET 2013
2013-02-28 00:18 <plantian> cedk: I tried to email it via google drive.
2013-02-28 09:02 <scrapper> hello 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.
2013-02-28 09:02 <scrapper> how can i tell Genshi that other companies are welcome too? :-)
2013-02-28 09:05 <scrapper> so 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.)
2013-02-28 09:06 <scrapper> is there a way to hide a field (Many2One) from Genshi report creation? Because this field data is not needed for report creation.
2013-02-28 09:07 <scrapper> its just used for some application logic - but not for report itself.
2013-02-28 09:09 <katr> scrapper: Can you paste the actual error message somewhere?
2013-02-28 09:10 <scrapper> katr: yes just a second. its short.
2013-02-28 09:11 <katr> katr: Better don't clutter the channel and use something like pastebin.
2013-02-28 09:12 <scrapper> katr: http://dpaste.com/1007505/
2013-02-28 09:12 <scrapper> katr: the error totally makes sense. Genshi does not see this "other company value" in the actual context - because the real company is another one.
2013-02-28 09:13 <katr> scrapper: dpaste.com seems to have some technical problems at the moment.
2013-02-28 09:13 <scrapper> katr: 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?
2013-02-28 09:13 <scrapper> katr: http://dpaste.com/1007505/
2013-02-28 09:14 <scrapper> katr: for me dpaste.com works fine right now.
2013-02-28 09:15 <katr> scrapper: Don't understand what you mean by "real company".
2013-02-28 09:16 <katr> scrapper: Works for me too now.
2013-02-28 09:16 <scrapper> katr: the "real company" is the actual company which is active in user context.
2013-02-28 09:17 <scrapper> katr: different users can have different active companies.
2013-02-28 09:17 <scrapper> katr: 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...
2013-02-28 09:18 <katr> scrapper: And you want to pass an additional company to the report not necessarily related to the company of the user doing the print?
2013-02-28 09:19 <scrapper> katr: 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.
2013-02-28 09:19 <scrapper> katr: depending on which "company" is selected in invoice - only the report template changes... but the "real" company always stays the same!
2013-02-28 09:20 <katr> scrapper: 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.
2013-02-28 09:21 <scrapper> katr: exactly - i want to hide this "second company field" from report creation. so Genshi should not complain.
2013-02-28 09:21 <scrapper> katr: but don't know how to do this. am I able to hide a field from report creation?
2013-02-28 09:22 <scrapper> katr: 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...
2013-02-28 09:22 <katr> katr: If you pass a field named "company" to a report it should always be the company of the user doing the report.
2013-02-28 09:23 <scrapper> katr: but the field name itself is "invoice_company" only the type is "company".
2013-02-28 09:23 <katr> scrapper: If your have a second company just pass a field "company_foo" or add it as field to the source record.
2013-02-28 09:24 <katr> scrapper: Don't understand why you want to hide something.
2013-02-28 09:25 <scrapper> katr: 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.
2013-02-28 09:25 <katr> scrapper: So simply pass "invoice_company = None". And do a check in the report template.
2013-02-28 09:25 <scrapper> katr: ok thank you katr! will do so!
2013-02-28 09:29 <katr> scrapper: "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.
2013-02-28 09:52 <scrapper> katr: you are right! this was just a fast development shot. thank you!
2013-02-28 09:53 <katr> scrapper: You're welcome!
2013-02-28 09:54 -!- scrapper(~scrapper@80-121-31-97.adsl.highway.telekom.at) has left #tryton
2013-02-28 12:04 <cedk> sharoonthomas: hi, will you provide a new patch for issue3026 ?
2013-02-28 12:55 <sharoonthomas> cedk: the current patch should apply on 2.6 series, you need a patch in addition for 2.7 ?
2013-02-28 13:01 <cedk> sharoonthomas: only patch on trunk are applied
2013-02-28 15:41 <cedk> sharoonthomas: in your usage of Celery, how do you manage the transactions?
2013-02-28 15:43 <sharoonthomas> cedk: we subclassed Task to build a customer Task class and the task executor handles transaction (and rollback on error)
2013-02-28 15:43 <sharoonthomas> s/customer/custom
2013-02-28 15:44 <cedk> sharoonthomas: it is what I thought
2013-02-28 15:44 <cedk> sharoonthomas: I would like to create a decorator but I don't think it is possible
2013-02-28 15:45 <sharoonthomas> cedk: a decorator is possible too, provided the task decorator is outside it
2013-02-28 15:45 <sharoonthomas> cedk: or rollback on error would be difficult
2013-02-28 15:46 <sharoonthomas> cedk: when you subclass task you will see the ugliness of celery
2013-02-28 15:47 <cedk> sharoonthomas: you can use base option of Celery.task to provide a custom class
2013-02-28 15:47 <sharoonthomas> cedk: yes as an argument to task decorator
2013-02-28 15:48 <cedk> sharoonthomas: in your subclass, you override __call__ ?
2013-02-28 15:49 <sharoonthomas> cedk: don't remember, looking into code
2013-02-28 15:54 <sharoonthomas> cedk: 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]
2013-02-28 15:54 <sharoonthomas> cedk: this is the generic part which makes any tryton method call async
2013-02-28 15:55 <cedk> sharoonthomas: I thought also about that
2013-02-28 15:55 <cedk> sharoonthomas: but I'm wondering if it is a good idea
2013-02-28 15:56 <sharoonthomas> cedk: it does not work in all cases, tryton itself does not have methods which work on single records
2013-02-28 15:56 <sharoonthomas> cedk: 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 record
2013-02-28 15:57 <cedk> sharoonthomas: it could be managed like the RPC does
2013-02-28 15:58 <cedk> sharoonthomas: in some way, I'm wondering if it should not only call __rpc__ methods
2013-02-28 15:59 <sharoonthomas> cedk: 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 needs
2013-02-28 17:26 <scrapper> Hi 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 defined
2013-02-28 17:27 <scrapper> The fun thing is - this error is also thrown when no relation to company is given. (Drink1, Drink2,... whatever)
2013-02-28 17:29 <scrapper> It appears after hitting "Open" on "Invoice Form".
2013-02-28 17:36 <scrapper> Traceback: http://dpaste.com/1007912/
2013-02-28 17:36 <cedk> scrapper: you have a bug in the invoice report
2013-02-28 17:37 <cedk> scrapper: by the way, it is not a good choice to develop on an old version
2013-02-28 17:37 <scrapper> cedk: its just an adjustment on our running systems - no chance to upgrade to newer version right now. not enough man power. :-/
2013-02-28 17:56 <scrapper> cedk: thank you - now it works!!!
2013-02-28 20:07 -!- ciupicri(~ciupicri@unaffiliated/ciupicri) has left #tryton

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