Odoo Help


Default field value of a form view

Roberto Barreiro
on 2/27/14, 7:09 PM 10,721 views

How I can change the default value of a field in a form view in openerp7?


Med Said BARA

--Med Said BARA--

| 5 5 7
--Med Said BARA--
Med Said BARA
On 2/27/14, 9:27 PM

Hi; The simplest and easiest way , is to go under "Developer mode", and then open the form (you want), open the drop-down menu "Debug view" and choose "Set Defaults", modify the default values as you need.

steps to go under "Developer mode" and change default values (example of "Emplyee form"):

1-- image description

2-- image description

3-- image description

4-- image description

The more complexe way is to find the file where the field you want to change the default value is defined (created) [Probably in a class a_class definition after _columns = {.......} creation in _defaults = {..somewhere...here ..the default value....} statement, as in the example below ( extracted from the code mrp.py file of the mrp module)]: