Odoo Help

Welcome!

This community 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.

0

why the selection values is (false)!?

By
Samer Al-Sarhan
on 2/15/16, 8:27 AM 365 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')
@api.model
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

samer,
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...

Pawan
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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