Add a new field in search view

Asked by David

HI

I want to include the ZIP (Postal code), in to customers search view.

How can I do that?

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#1

David,

You have to add a field 'zip' to customer model first.

'zip': fields.related('address', 'zip', type='char', string='ZIP'),

Once done, you should add this field into the search view of res.partner model.

That's it!

Thanks.

Revision history for this message
David (dhecar) said :
#2

OK, i've change the the code an it works well, but, if I'll update the base module througth bzr the view will revert.

Can I extend the view within a module?

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#3

David,

Yes, you should create a module!

Thanks.

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#4

David,

Let me know if this does not help.

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask David for more information if necessary.

To post a message you must log in.