Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4958 มุมมอง

i have one function field with type integer. i want to set default value for it ? how it is possible ?

i used that field in other module with one2many relation and display it in tree view under other module.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

- first make the functional field writable (if you don't like it to be writable by the end user, then addtionally you'll need to set it as readonly in view)

in v7.0 it may be something like:

    def _set_my_field(self, cr, uid, ids, field_name, field_value, arg, context=None):
        pass

 

    'my_field': fields.function(_compute_my_field, fnct_inv=_set_my_field, method=Truestring="My Field", type="integer")

- then set default value by the ordinary way as for other fields...

อวตาร
ละทิ้ง