Skip to Content
Menu
This question has been flagged
3067 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
Avatar
Discard

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

Author

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

Author

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