Odoo Aide

0

0
1 Answer
2
Avatar

Niyas Raphy

--Niyas Raphy--
24489
| 7 7 11
Wayanad, Inde
--Niyas Raphy--

Odoo Techno Functionalist

Feel free to connect :  niyasraphyk@gmail.com

Twitter:https://twitter.com/niyasraphy
LinkedIn: https://www.linkedin.com/in/niyasraphy/
FB:https://www.facebook.com/niyasraphy123

Happy to help :)

Niyas Raphy
02/06/2019 22:58

Hi,

You are getting this error because you are accessing the value from the field named history_ids in this line of the code before defining the field.

history_ids = history_obj.search([('name_id', '=', reg.name_id.id)], history_ids[0].date)


but, you haven't assigned what value should that variable hold. You should update your code such a way that you have to define the variable before using it.


for reg in self:
   history_ids = ?
 history_ids = history_obj.search([('name_id', '=', reg.name_id.id)], history_ids[0].date)
 history_ids = self.env['membership.history'].search([('name_id', '=', reg.name_id.id)], order='date desc')


Thanks

Poser une question
Writer
Keep Informed
1 Abonné(e)s
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now