Skip to Content
Menu
This question has been flagged
3173 Views

Hi,

I have a problem try to use uppercase in names of varibles when I try to apply a filter Group by...

I did a custom module to import data from CSV files send by partner that uses other ERP, and the title of csv are all in uppercase, so I decide to use the same names for vars in uppercase. All seems to work, I can storage information and impor the CSV in a easy way for users. But when try to apply a "Group by " in this fields doesn't work, show grouped item but with zero records. There is some restriction to use uppercase in var names ? There is a way to solve this ? maybe add some code when import CSV file. I know a can change the uppercase in csv table, or select fileds manually when import, but the idea is have a solution that user don't need to change anything and just import the files because there are many.

Thanks a lot.

,py Code example:

_columns = {                
'employee_id':fields.many2one('hr.employee', 'Asignado a'),
'ORDER_STATUS':fields.selection([
('done','Done'),
('waiting','Waiting'),
('confirmed','Assign'),
('assigned','Cancel'),
], 'Order Status', select=True),
'SERVICE_CODE': fields.integer('Service Code'),
}
---- .xml -----
<field name="arch" type="xml">
<search string="Controls">
<field name="employee_id" />
<field name="ORDER_STATUS" />
<field name="SERVICE_CODE" /> 
<group expand="1" string="Group by..">
<filter string="Assigned to" name="employee_id"
context="{'group_by':'employee_id'}" />
<filter string="Order Status" name="ORDER_STATUS"
context="{'group_by':'ORDER_STATUS'}" />
<filter string="Service Code" name="SERVICE_CODE"
                                                        context="{'group_by':'SERVICE_CODE'}" />
</group>
</search>
Avatar
Discard
Related Posts Replies Views Activity
1
Jul 23
1450
2
Nov 17
6811
2
Aug 15
9353
0
Apr 15
3607
0
Sep 23
4342