Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda

I need to create a type of one2one between several models, does someone have a clue how to manage this? Here are the facts:

  • I have the default model crm.lead
  • Now i need to add more two models e.g.
    • crm.lead.foo and crm.lead.bar
    • Both new models are linked to the crm.lead object using a field lead_id as many2one
    • lead_id = fields.Many2one('crm.lead', string='Lead', ondelete='cascade')
  • Now in the crm.lead i need to add the relation by sth like a "one2one" that doesn't exist.
  • I think the best/better way is to add the relation with a Many2one field from the crm.lead to link it to the foo and bar (writing the value on create)
    • crm_lead_foo = fields.Many2one('crm.lead.foo')
  • Basically the link works and i can choose the foo/bar and edit it's fields
  • But the edit does only work when opening the foo/bar in a new form
  • I need to show the form of the crm.lead.foo form inline in the crm.lead form, is there any widget that can manage this?


Note:
I know, I would be able to add all needed fields as related fields into the crm.lead form to make them working inline. But I need to add several new models (not only 2) with many fields each. Additionally i will need to add the models based on the opportunity_id also in the sale.order and the project.project forms.... so i'm looking for a clean solution without adding much trash to my core models.


Thank you for your help and ideas!

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Sep 18
4292
1
Okt 15
5975
3
Mei 24
14909
0
Des 21
3191
0
Mar 16
3008