Odoo Help


why the selection values is (false)!?

Samer Al-Sarhan
on 2/15/16, 8:27 AM 456 views

Dear All,

am trying to compute the values of selection field , from another model but am getting false as value in the selection field any idea why ? 

pricing = fields.Selection(selection='_get_selection')
def _get_selection(self):
     program_obj = self.env['diet.program'].search([('id', '=', self.diet_program_id.id)]) r_price = program_obj.price
     wf_price = program_obj.price_without_fridays
 ww_price = program_obj.price_without_weekends
     prist_list = [('1', str(r_price)), ('2', s    tr(wf_price)), ('3', str(ww_price))]     return prist_list

Please check did u got any value for 'program_obj'??
and then please check is there any record exist for 'self.diet_program_id' in "diet.program" object...

on 2/16/16, 1:05 AM

yes there is, and i can pind the value for self.diet_program_id in a char field but when i pind it to selection it give a false as value

Samer Al-Sarhan
on 2/16/16, 5:28 AM

yes there is, and i can bind the value for 'self.diet program_id' in a char field but when i bind it to selection it give a false as value

Samer Al-Sarhan
on 2/16/16, 5:31 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/15/16, 8:27 AM
Seen: 456 times
Last updated: 2/15/16, 1:38 PM