Dear All ,
please help out me how i can fill module B dropdown list from module A
please give example with sample code.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Dear All ,
please help out me how i can fill module B dropdown list from module A
please give example with sample code.
Thanks but if i have multiple fields in ModuleA then how i can get all fields in ModuleB ?
Use One2many instead of Many2one
this link might be helpful to you
My senario is given below please tell me how i get remaining fields flight_No and flight_destination in ModuleB
class ModuleA(models.Model):
_name = 'test.a'
_rec_name = 'flight_name'
flight_name = fields.Char(string="Flight")
flight_No = fields.Char(string="Flight No")
flight_destination = fields.Char(string="Flight destination")
Then in the Model B ,
class ModuleB(models.Model):
_name = 'test.b'
drop_down_field = fields.Many2one('test.a', string="Test")
in model b add :
flight_no = fields.Char(related='drop_down_field.flight_No', string='your string')
flight_destination = fields.Char(related='drop_down_field.flight_destination', string='your string')
Hi, Try as in the below code
class ModuleA(models.Model):
_name = 'test.a'
_rec_name = 'flight_name'
flight_name = fields.Char(string="Flight")
Then in the Model B ,
class ModuleB(models.Model):
_name = 'test.b'
drop_down_field = fields.Many2one('test.a', string="Test")
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Thanks Niyas Raphy,
please 1 more thing if i have multiple fields in ModuleA then how i can get all fields in ModuleB ?
please share code.
Sent: Wednesday, May 31, 2017 9:51:32 AM
To: Fawad Mazhar
Subject: Re: how populate dropdown list of Module B from Module A field in Odoo 10
A new answer on how populate dropdown list of Module B from Module A field in Odoo 10 has been posted. Click here to access the post :
See post
--
Niyas Raphy
Sent by Odoo S.A. using Odoo.