IRC logs of #tryton for Sunday, 2011-11-20

chat.freenode.net #tryton log beginning Sun Nov 20 00:00:01 CET 2011
2011-11-20 10:22 -!- plantian(~ian@c-67-169-72-36.hsd1.ca.comcast.net) has left #tryton
2011-11-20 10:33 <cedk> the FUD has already started: https://groups.google.com/d/topic/tryton-es/wEslb5bN5AA/discussion
2011-11-20 12:31 <marc0s> hi
2011-11-20 12:33 <marc0s> can anyone point me out to an example of a domain on a many2many field? I want to filter out the party field of one model of my own by the category of that party
2011-11-20 13:10 <cedk> marc0s: could you show the code because I don't understand your target
2011-11-20 13:10 <marc0s> cedk: sure, one sec
2011-11-20 13:12 <marc0s> cedk: http://paste.pocoo.org/show/510486/
2011-11-20 13:12 <marc0s> cedk: i want to filter the parties that can be selected as company_id to those belonging to a specific category
2011-11-20 13:12 <marc0s> s/filter/restrict/
2011-11-20 13:13 <marc0s> being category a many2many field at party model
2011-11-20 13:17 <cedk> marc0s: which category?
2011-11-20 13:18 <marc0s> cedk: in my case will be 'Insurance Companies' (a category created by the module)
2011-11-20 13:19 <marc0s> cedk: http://hg.tenak.net/tryton/insurance/file/c2945fcffd78/insurance.xml#l11
2011-11-20 14:10 <cedk> marc0s: this will not work very well
2011-11-20 14:10 <cedk> marc0s: you can not set a domain based on such record
2011-11-20 14:11 <cedk> marc0s: at least not easily
2011-11-20 14:11 <marc0s> cedk: aha...
2011-11-20 14:11 <cedk> marc0s: have you thought about using a field to check party of "Insurance Companies" ?
2011-11-20 14:11 <marc0s> cedk: and some pointer to the 'hard way'? :P
2011-11-20 14:12 <cedk> marc0s: we never did it in Tryton :-(
2011-11-20 14:12 <cedk> marc0s: one way, you create a function field that will return the id of "category_insurance_companies"
2011-11-20 14:12 <cedk> marc0s: this you use it as value for the domain
2011-11-20 14:13 <cedk> like this: [('categories', '=', Eval('insurance_company_id'))]
2011-11-20 14:13 <marc0s> cedk: i see
2011-11-20 14:14 <marc0s> cedk: probably the easier way is to have such field to mark a party as an 'insurance company'
2011-11-20 14:14 <cedk> marc0s: yeps
2011-11-20 14:15 <marc0s> cedk: moreover when the customer told me that they ain't gonna be using parties categories, at least now...
2011-11-20 14:15 <cedk> marc0s: but I think in the future we will have a PYSON statement to get the xml id
2011-11-20 14:15 <marc0s> cedk: nice
2011-11-20 14:15 <cedk> marc0s: this will be required for some features like view in separated files, buttons on Model etc.
2011-11-20 14:16 <marc0s> cedk: thanks :)
2011-11-20 14:17 <marc0s> cedk: hope to have this module finished more earlier than later, do you think it will be nice to submit it to code review (aka will probably somebody look at it) before packaging and releasing it?
2011-11-20 14:18 <marc0s> it's for a company that manages insurances of cars, health, life and that stuff (they are not the insurance company itself, but kind of a reseller)
2011-11-20 14:19 <marc0s> maybe the term would be broker or something like that
2011-11-20 14:31 <cedk> marc0s: do you think it is generic module?
2011-11-20 14:32 <marc0s> cedk: think so, but we can discuss about it... maybe my perception of generic is not the same as yours ;)
2011-11-20 14:33 <marc0s> cedk: i'll be open to suggestions anyway :)
2011-11-20 14:33 <marc0s> lunch time, see you later
2011-11-20 19:24 -!- Timitos(~kp@88.217.184.172) has left #tryton

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