This question has been flagged
2 Replies
2398 Views

Hi

i have created custom module there is two fields RESOURCE_NAME = fields.Many2one('resource.resource' ,string="Resource Name")

and RESOURSE_TYPE=fields.Char(string="Resource Type")

i give dependency to resource module there is two fields resource_type and resource_name

here i want functionality like if i select

Resource Name

 then resource type should be automatically come in 

RESOURSE_TYPE field from resource module.

Thank You

Avatar
Discard
Best Answer

Hello Madan,


Try this :-

RESOURCE_NAME = fields.Many2one('resource.resource' ,string="Resource Name")

RESOURSE_TYPE=fields.Char(string="Resource Type", related='RESOURCE_NAME.resource_type')


Hope it works for you.


Thanks,

Avatar
Discard
Author

Thank you so much

Best Answer

Try this one same type:-

payment_method_id = fields.Many2one('account.payment.method', string='Payment Type', required=True)

payment_method_code = fields.Char(related='payment_method_id.code', readonly=True)

Avatar
Discard