Skip to Content
Menu
This question has been flagged
1 Reply
3241 Views

Hi,

i have a  model wich is transient :

class ProjectMakeQuotation(models.TransientModel):

_name = "project.make.quotation"

 and sale order model inherited :

class SaleOrder(models.Model):

_inherit = "sale.order"

quotation_type_id = fields.Many2one('project.make.quotation', string='Quotation Type', readonly=True) 

I want to add the field  quotation_type_id  in the tree view of sale.order

I done like this :

<xpath expr="//tree/field[@name='partner_id']" position="after">

<attribute name="quotation_type_id"/>

    </xpath>

i got error that says : AssertionError: Many2One relationships from non-transient Model to TransientModel are forbidden

How can i do to solve it please ??



Avatar
Discard
Best Answer

Hi,

Transient models are not stored in the database.   It is normally used to define the model for a wizard, where the data has to be stored temporarily . All the data in transient tables are flushed frequently. So it's not at all a good solution to use ref. of such transient tables in non-transient tables. 


Thanks

Avatar
Discard
Author

Thanks for the explanation @Niyas.