Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
10228 Tampilan

Hi,

How and when is dummy field used and can you explain in detail about dummy field.

The dummy field is defined in product.product object as:

'pricelist_id': fields.dummy(string='Pricelist', relation='product.pricelist', type='many2one'),

also why use dummy when you can use many2one field like:

'pricelist_id': fields.many2one('product.pricelist','Pricelist',),

Thanks in advance

Avatar
Buang
Penulis

and also used at stock.product_product for fields 'location_id','warehouse_id'.

Jawaban Terbai

fields.dummy  is like fields.function, but always return null value, when you read or when you search.

Dummy fields can be used for backward compatibility. E.g. you don't need pricelist_id field anymore, but some other modules have a reference to this field. So, instead of deleting field, you can replace one to dummy field.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
3
Mei 25
1900
1
Apr 25
1434
3
Sep 24
14397
2
Feb 24
2596
1
Jul 23
2824