Odoo Help

0

0
1 Risposta
2
Avatar

Niyas Raphy India

--Niyas Raphy--
25548
| 7 7 11
Wayanad, Kerala, India
--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
Whatsapp : +917736136763
Happy to help :)

Niyas Raphy India
02/06/19, 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

Fai una domanda
Writer
Keep Informed
1 follower(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 E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now