Odoo Help


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.


Fill automatically some fields when customer enter a new record

on 4/12/16, 5:03 AM 229 views

Hi everyone,

I have a new table with differents fields.

Inside the Customer View ( Sale), OpenERP users can create a new record.

However, I would like to fill automatically the two first fields:

- One is the name of the customer

- The other one is the date

Is it possible to do it? If yes, how?

Many thanks for your help,



Prakash Sharma

--Prakash Sharma--
| 2 1 4
Delhi, India
--Prakash Sharma--

I like to surround myself with brave, creative people.

My motivation for learning different technologies and algos drive me. I love challenges of a steep learning curve which I believe makes me a better learner. I have a strong desire to learn different technologies, which would enable me to become a full stack developer.

Prakash Sharma
On 4/18/16, 3:00 AM

You can set the default value of field in ODOO just traverse this path :

In side Setting-> Technical  ->Actions-

  1. User-defined Defaults


Bhavik Bagadiya
On 4/18/16, 2:19 AM

Hello Selverine

use defaults in field declaration like

def _selectCustomer(self):

     Customer_id = Customer id you want to set default

     return Customer_id

order_date = fields.Datetime('Order Date', default=fields.datetime.now())

customer_id = fields.Many2one('res.partner', 'Customer', default=_selectCustomer) 

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

2 follower(s)


Asked: 4/12/16, 5:03 AM
Seen: 229 times
Last updated: 4/18/16, 3:00 AM