Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3730 Weergaven

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 ?

Avatar
Annuleer

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,

Auteur
Hello 

Jack Dane 

Hope you are well.
Thanks for your response. 
Actually I want ....
Above program I select date and under date related field will come but i want that I select date and which_line these two field when match these two field then these two field's related field value will come.
Kindly help me

On Wed, Dec 9, 2020 at 11:24 PM Jack Dane <jackd@flowbird.co.uk> wrote:

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,

Sent by Odoo S.A. using Odoo.

Beste antwoord

add this in view

<field name="which_line" attrs="{'invisible':[('date_select','=',False)]}"/>

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
6
jun. 20
12467
4
mei 24
12472
1
apr. 24
3114
0
nov. 23
1905
1
sep. 23
2013