chat.freenode.net #tryton log beginning Wed Jun 27 00:00:01 CEST 2012 | ||
2012-06-27 03:21 <luc_> Hi, i have a question, I was reading the documentation but there is not answer there. How can I link a Button to a Python function? | ||
2012-06-27 10:38 -!- ccomb(~ccomb@men75-7-82-239-165-22.fbx.proxad.net) has left #tryton | ||
2012-06-27 16:01 -!- pjstevns(~pjstevns@nfg3.nfgs.net) has left #tryton | ||
2012-06-27 17:29 <lukio> hello, I create a field into my Product model, and I only want to see it, when my category of the product is 'TERCEROS', but I don't understand how to ask it using PYSON. any idea? thanks! my pastebin -> http://pastebin.com/WMRdnLzM | ||
2012-06-27 17:49 <cedk> lukio: Eval('category') will return the id not the name | ||
2012-06-27 17:49 <cedk> lukio: so you must convert 'TERCEROS' into an id | ||
2012-06-27 17:49 <cedk> lukio: you can use the PYSON.Id if the category is created via XML | ||
2012-06-27 18:51 <lukio> ok. first i have to create the category TERCEROS, and then, check how to ask it using the function Id() | ||
2012-06-27 18:52 <lukio> do u have any example of creating the category TERCEROS using xml ? | ||
2012-06-27 18:53 <cedk> lukio: no but it is like any record | ||
2012-06-27 19:28 <lukio> ok, now i create a my category using XML -> http://pastebin.com/WMRdnLzM | ||
2012-06-27 19:29 <lukio> how do i ask for my category using the function Id() ? | ||
2012-06-27 19:39 <lukio> I wrote this --->> 'invisible': Eval('category').in_([Id('product.category', 'cat_terceros')]), but throws me an error -->> http://pastebin.com/yxGKryhP | ||
2012-06-27 19:39 <lukio> cedk: ? | ||
2012-06-27 19:58 <cedk> lukio: it must be: Id(<module name>, <xml id>) | ||
2012-06-27 20:25 <lukio> cedk: I read the doc, and I didn't think the first argument must be the module name where it's defined the xml. | ||
2012-06-27 21:04 <cedk> lukio: it is http://doc.tryton.org/2.4/trytond/doc/ref/pyson.html#trytond.pyson.Id | ||
2012-06-27 21:28 -!- newzen(~newzen@190.199.245.224) has left #tryton |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!