تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3484 أدوات العرض

Friends,

 I have a field ministry_or_not..(many2one)

I have to set its value as "Ministry" for the form view_trademark_file_form

and "Not Ministry" for view_tradename_form

any clue

Thanks..

الصورة الرمزية
إهمال
أفضل إجابة

Use context in the action that call the view and prepend fieldname with "default_".

context: {'default_ministry_or_not': True}

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

check out Settings/Parameters/Company Defaults or Company Properties. There you can define defaults.

Or do you need the default values in a module?

Regards, 

Ingo

UPDATE (I can't post another message, so I must edit my old one):

Did you try in the module the _defaults statement?

_defaults = { 

            'state':'draft', 

}

Or maybe in the view you could change the default with properties:

<function model="ir.values" name="set_default">

        <value>sale.order</value>

        <value>picking_policy</value>

        <value>one</value>

</function>

 

الصورة الرمزية
إهمال
الكاتب

In module