Skip to Content
Menu
This question has been flagged
2 Replies
6897 Views

Class OtDesciption(models.Model):

         ot_description = fields.Many2one('ot.model', string="Descripción")

        quantity = fields.Integer('Cantidad')

        value = fields.Float('Valor Unitario')

        description = fields.Text('Descripción')


Class Ot(models.Model):

    quotation = fields.Many2one('budget.model')

    description = fields.One2many('ot.model.description', 'ot_description', string="Descripción")


The model 'budget.model' has the fields value, description. So how I can related the field quotation to description.

Avatar
Discard
Best Answer

Hi, wildhen


Thanks for writing this question but your question is little bit confusing.

Like what I am understanding, you want to show description field of budget.model field then you can write below syntax inside ot.model,

bud_description = fields.Char('quotation.description')
Else if you want to use ot.model description field. Then instead of making complex structure you can simply define many2one field inside ot.description and one2many inside budget.model,
Class OtDesciption(models.Model):
    qt_description = fields.Many2one('budget.model')
Class Budget(models.Model):  
    description= fields.One2many('ot.model.description', 'qt_description', string="Descripción")


Feel free to ask in case you have any confusion related to the above points.

And also let me know if I am not getting your question.


Thanks,

Ashish Singh (Team Lead)

Webkul Software Private Limited

Avatar
Discard
Best Answer

Hi Ashish,

   Can you please help to add custom field from MPS view form into MRP view form too.

   I do not see any relations between MPS vs MRP

Thanks,

Avatar
Discard