Search code examples
pythonodooodoo-10erp

Workaround for Many2One or One2Many relationships from non-transient Model to TransientModel in Odoo


I want to create a relationship between non transient model and transient model in ODOO-10. we have create a transient model which does some complex computations, now we want to display this data on a non-transient models form but could not achieve this because of transient and non-transient model relationship restrictions


Solution

  • The only relationship allowed between a normal Model and transien One is:

              T   ---- M2o   ----- > M
              M ------ M2M   ------> T
    

    So if you want a behavior like One2many use a Computed Many2many and fill it witch a simple search call.