Setting Default value for a field

Asked by Pavithra

Hi all,

 Please tell me how to set default different value for a field in different form

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Web Client Edit question
Assignee:
No assignee Edit question
Solved by:
Lorenzo Battistini
Solved:
Last query:
Last reply:
Revision history for this message
DBR (OpenERP) (dbr-openerp) said :
#1

Hello Pavithra,

For set default value to particular field in web you follow the following steps:
1) Fill default value in that field.
2) Right click on that field.
3) select 'set as default'.
4) choose any one Value applicable for option.
5) click on ok.

Hope this help...

Revision history for this message
Pavithra (pavithra-lakshmanan) said :
#2

Hi,

  When i set the default value using above procedure, it is applied to all the many2one field of that relation.. I want to apply only in a single form for that field...

Revision history for this message
Best Lorenzo Battistini (elbati) said :
#3

You can use the 'domain' field of the 'ir.actions.act_window' that opens your form

Revision history for this message
Lorenzo Battistini (elbati) said :
#4

Example:
<record id="your_action_id" model="ir.actions.act_window">
    <field name="domain">[('YOUR_FIELD','=','YOUR_DEFAULT_VALUE')]</field>
    .....

Revision history for this message
Pavithra (pavithra-lakshmanan) said :
#5

Thanks Lorenzo Battistini - agilebg.com, that solved my question.

Revision history for this message
stalker (stalker-operamail) said :
#6

Thanks to Lorenzo! Realy helped