The patch "xrg" mentioned previously sounds like one of your best options.  
Otherwise if you have a look at hr_department.py they inherit the actions 
module and check for string within the domain.  If they find it they replace 
with correct values.  Not sure if this helps, but check it out...


###/bin/addons/board_project/board_project_manager_view.py###
<record>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <field>Timesheets</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
<field>hr_timesheet_sheet.sheet</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
<field>&#91;&#40;'state','&lt;&gt;','done'&#41;,&#40;'user_id','in',department_users_get&#40;&#41;&#41;&#93;</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <field>form</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <field>
&nbsp; &nbsp; &nbsp; &nbsp; </record>


###/bin/addons/hr/hr_department.py####
class ir_action_window&#40;osv.osv&#41;&#58;
&nbsp; &nbsp; _inherit = 'ir.actions.act_window'

&nbsp; &nbsp; def read&#40;self, cr, uid, ids, fields=None, context=None,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; load='_classic_read'&#41;&#58;
&nbsp; &nbsp; &nbsp; &nbsp; select = ids
&nbsp; &nbsp; &nbsp; &nbsp; if isinstance&#40;ids, &#40;int, long&#41;&#41;&#58;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; select = &#91;ids&#93;
&nbsp; &nbsp; &nbsp; &nbsp; res = super&#40;ir_action_window, 
self&#41;.read&#40;cr, uid, select, fields=fields,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context=context, 
load=load&#41;
&nbsp; &nbsp; &nbsp; &nbsp; for r in res&#58;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mystring = 
'department_users_get&#40;&#41;'
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if mystring in 
&#40;r.get&#40;'domain', '&#91;&#93;'&#41; or ''&#41;&#58;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r&#91;'domain'&#93; = 
r&#91;'domain'&#93;.replace&#40;mystring, str&#40;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
self.pool.get&#40;'hr.department'&#41;._get_members&#40;cr, uid&#41;&#41;&#41;
&nbsp; &nbsp; &nbsp; &nbsp; if isinstance&#40;ids, &#40;int, long&#41;&#41;&#58;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if res&#58;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return res&#91;0&#93;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else&#58;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return False
&nbsp; &nbsp; &nbsp; &nbsp; return res





-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=38353#38353

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to