
from openerp import fields, models


class MedicalPatient(models.Model):
    _inherit = 'medical.patient'
    insurance_plan_ids = fields.Many2many(
        string='Insurance Plans',
        comodel_name='medical.insurance.plan',
        help='Past & Present Insurance Plans',
    )


from openerp import fields, models


class MedicalPatient(models.Model):
    _inherit = 'medical.patient'
    insurance_plan_ids = fields.One2many(
        string='Insurance Plans',
        comodel_name='medical.insurance.plan',
        inverse_name='patient_id',
        help='Past & Present Insurance Plans',
    )

Fix incorrect relation in medical_insurance
Fix incorrect relation in medical_insurance

  
  from openerp import fields, models
  
  
  class MedicalPatient(models.Model):
      _inherit = 'medical.patient'
-     insurance_plan_ids = fields.Many2many(
+     insurance_plan_ids = fields.One2many(
          string='Insurance Plans',
          comodel_name='medical.insurance.plan',
+         inverse_name='patient_id',
          help='Past & Present Insurance Plans',
      )
  
Fix incorrect relation in medical_insurance
## Code Before:

from openerp import fields, models


class MedicalPatient(models.Model):
    _inherit = 'medical.patient'
    insurance_plan_ids = fields.Many2many(
        string='Insurance Plans',
        comodel_name='medical.insurance.plan',
        help='Past & Present Insurance Plans',
    )

## Instruction:
Fix incorrect relation in medical_insurance
## Code After:

from openerp import fields, models


class MedicalPatient(models.Model):
    _inherit = 'medical.patient'
    insurance_plan_ids = fields.One2many(
        string='Insurance Plans',
        comodel_name='medical.insurance.plan',
        inverse_name='patient_id',
        help='Past & Present Insurance Plans',
    )
