class TargetSetup(models.Model):
_name = 'target.line'
_inherit = ['mail.thread', 'mail.activity.mixin']
_rec_name = 'date'
date = fields.Datetime(string="Date",default=datetime.today())
which_line = fields.Many2one('line.information',string="Line No")
production_target = fields.Integer(string="Production Target", required=True)
estimated_hour = fields.Float(string="Estimated Hour", required=True)
class LineDetails(models.Model):
_name = 'line.details'
_inherit = ['mail.thread', 'mail.activity.mixin']
date_select = fields.Many2one('target.line', string="Select Date")
target = fields.Integer(related='date_select.production_target',string="Production Target", required=False, )
estimated_time = fields.Float(related='date_select.estimated_hour',string="Estimated Hour")which_line = fields.Many2one(related='date_select.which_line', string="Line")
I want when I select date and which_line filed then show all related field .
How to do it can you help me please ?
Hello Arjun,
Could you give us more of an idea of what you are trying to achieve here please.
I can see based on the code that you are pulling information from "target.line" to "line.details" based on the Many2one date_select (target, estimated_time and which_line).
Are you now trying to pull data from "line.information" as related fields?
I don't fully understand what you mean by "show all related field".
Thanks,
Jack Dane