[FIX] Base_report_creator : Allowing to use current userid
lp bug: https://launchpad.net/bugs/446391 fixed bzr revid: jvo@tinyerp.com-20091013151218-o1vdbejzd6djq6bt
This commit is contained in:
committed by
Jay (Open ERP)
parent
e92ddd2999
commit
95ec254f70
@@ -259,8 +259,8 @@ class report_creator(osv.osv):
|
||||
ret_str = ret_str[0:len(ret_str)-3]
|
||||
if ret_str.endswith('or'):
|
||||
ret_str = ret_str[0:len(ret_str)-2]
|
||||
ret_str = ret_str.strip()
|
||||
return ret_str
|
||||
ret_str = ret_str.strip()
|
||||
return ret_str % {'uid' : uid}
|
||||
|
||||
def _id_get(self, cr, uid, id, context):
|
||||
# return 'min(sale_order_line.id)'
|
||||
|
||||
@@ -86,6 +86,8 @@
|
||||
<field name="condition"/>
|
||||
</form>
|
||||
</field>
|
||||
<separator string="Legend" colspan="4"/>
|
||||
<label string="Use %(uid)s to filter by the connected user" align="0.0"/>
|
||||
</page><page string="Security">
|
||||
<separator string="Authorized Groups (empty for all)" colspan="4"/>
|
||||
<field name="group_ids" colspan="4" nolabel="1"/>
|
||||
|
||||
@@ -129,6 +129,10 @@ def _set_filter_value(self, cr, uid, data, context):
|
||||
value_data = 'true'
|
||||
else:
|
||||
value_data = 'false'
|
||||
|
||||
if field_type in ['float','integer']:
|
||||
value_data = value_data or 0
|
||||
|
||||
if field_type == 'many2many' and value_data and len(value_data):
|
||||
fields_list = set_field_operator(self,table_name+"."+field_data['name'],field_data['ttype'],form_data['operator'],value_data[0][2])
|
||||
else:
|
||||
@@ -136,7 +140,7 @@ def _set_filter_value(self, cr, uid, data, context):
|
||||
if fields_list:
|
||||
create_dict = {
|
||||
'name':model_name + "/" +field_data['field_description'] +" "+ mapping_fields[form_data['operator']] + " " + str(fields_list[2]) + " ",
|
||||
'expression':' '.join(fields_list),
|
||||
'expression':' '.join(map(str,fields_list)),
|
||||
'report_id':data['id'],
|
||||
'condition' : form_data['condition']
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user