Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Error when use uppercase in var names

By
Leopo
on 5/15/15, 3:30 PM 554 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>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/15/15, 3:30 PM
Seen: 554 times
Last updated: 5/16/15, 6:15 PM