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

how to changes field types in BOM from one2many to float ?

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

Hi,

You need to redefine the field to change the field type using inheritance. 

E.g. :
Original one2many field:

class mrp_bom(osv.osv):
    _name = 'mrp.bom'
    _description = 'Bill of Material'
    _columns = {
       'bom_lines': fields.one2many('mrp.bom', 'bom_id', 'BoM Lines'),
    }
mrp_bom()
Do the following to change the field type to float:
class mrp_bom(osv.osv):
    _name = 'mrp.bom' 
   _description = 'Bill of Material'
    _inherit='mrp.bom'
    _columns={
        'bom_lines': fields.float(''BoM Lines'),
    }
mrp_bom()
Hope this may help you.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

error, i cant login, because error in mrp.login

in _inherit='mail.thread' should i change into _inherit='mrp.bom' ??

please help me

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 17
4541
Concatenate two fields in a third one แก้ไขแล้ว
2
ส.ค. 24
2455
0
ม.ค. 24
1220
3
ก.ย. 23
2316
Custom float field auto rounding? แก้ไขแล้ว
4
ก.ย. 18
5009