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

I want to create a one2one relation in two objects of openerp

hr.employee

and

hr.employee.medical.details

I know that one2one relation has been depricated from OpenERP version>5

While searching over internet found following two links helpful for the same :

http://forum.openerp.com/forum/topic7241.html

http://tutorialopenerp.wordpress.com/2014/04/23/one2one/ (don't know the language in which it's written but example is more than enough to explain)

So there are two methods to achieve one2one relation:

1) using inheritance by deligation and

2) using many2one fields in both the objects. For example 'employee_medical_detail_id':fields.many2one('hr.employee.medical.details', 'Medical Details') in hr_employee object

and

'employee_id':fields.many2one('hr.employee', 'Employee') in hr.employee.medical.details object

Questions : 1) When will we use one method over the other to achieve one2one functionality

2) Because i want to make one2one relationship and would like to show customized form directly instead of any 'Add an item' button. How can I do this in view file? so that only one entry is added?

อวตาร
ละทิ้ง
ผู้เขียน

Guys...please help. It's urgent.....

can you please tell some of fields in both tables? so that we can code it.

ผู้เขียน

Hi Remya, thanks for comment : In 'hr_employee' table fields are emp_code, education_ids, family_detail_ids, medical_detail_id and in 'hr.employee.medical.details' table fields are blood_group, medicine, allergies etc. and employee_id

ผู้เขียน คำตอบที่ดีที่สุด

I have solved the problem. If anybody is looking for solution, please check this post : 

http://dirtyhandsphp.blogspot.in/2014/10/openerp-one2one-relational-field-example.html

อวตาร
ละทิ้ง

Hy dirtyHandsPHP!
I try to open this blog link but this blog is not found, So please can u explain to me how to solve this issue in v14 or v16?

Related Posts ตอบกลับ มุมมอง กิจกรรม
How to inherit osv.osv_memory class? แก้ไขแล้ว
3
พ.ค. 15
5498
4
ก.พ. 25
2641
2
พ.ย. 24
19846
1
ส.ค. 24
2217
2
พ.ย. 24
3348