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

I have 2 models with a relation one2many and many2one.

fieldmodel A = one2many model B

fieldmodel B = many2one model A

For every record B, I want to get the id of the record A (associate to B) generated by default when i open the field B

Any help please 

อวตาร
ละทิ้ง

" generated by default" means generated form demo data ?

ผู้เขียน

It means that the id of field A appears automatically (by default) when i click on the record B

you can search in B using this domain 

self.pool.get(model.a).search(cr, uid, [('m2o filed ', 'in',  [currentids] )],context=context)

ผู้เขียน

Thanks. But where i will define this domain

ผู้เขียน

Where i have to add this domain please ??