I have the following function in the hr_evaluation_interview class:
@api.onchange('evaluation_id') def onchange_evalID(self): self.deadline=self.env.cr.execute('SELECT date FROM hr_evaluation_evaluation where id=119')
Note. I just suggest id=119 in the request for testing purposes.
When I give self.deadline=datetime.now.strftime(%Y-%m-%d %H:%M:%S") , it works fine and changes the value of the deadline field when the value of the evaluation_id field changes. Again for simple testing.
I really need to execute a query similar to what I mentioned. However, when I execute this query, nothing prints in the deadline field. When I check the log, I see this warning:
WARNING db_name openerp.models: Cannot execute name_search, no _rec_name defined on hr_evaluation.evaluation
I tried to check online why this warning, but did not get any help. Am I doing something wrong? How to accurately execute a request from @api.onchange(self) ?
source share