I want the add a selection field to my model. In this selection i want the see companies. I tried something like this but didn't work.
res_comp = fields.Many2one(comodel_name="res.company", string="TEST")
asd = fields.Selection(related="res_comp", readonly=False)
How Can I do someting like that.
And I have a one problem too. For example user select a company "A". I want the use this selection "A" inside of function. How can i use this. For example.
res_comp = fields.Many2one(comodel_name="res.company", string="TEST")
asd = fields.Selection(related="res_comp.name", readonly=False)
def test_func(self):
print(asd)
But it's can't print the asd.
I need help about this two problem. Thank you for time.