I have a many2one field into "stock.picking", i want to override the name_get so as to get another field, and not the name field of stock.picking, I'm enable to find name_get method for stock_picking so as to override it ? What is the risks of this and how to do it carefully ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
First of all, stock.picking did not overrided the name_get method, it uses the name_get of the orm, so I overrided it myself by doing :
def name_get(self, cr, uid, ids, context=None):
if not ids:
return []
if context is None: context = {}
return [(r['id'], (str( r['num_bl']) or '')) for r in self.read(cr, uid, ids, ['num_bl'], context, load='_classic_write')]
where num_bl is the field that you want to replace the name field with.
Knowing that the purpose of it it's change the field to display. There is a lot of overrides, as much as there are a lot of customization with overrides.
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ