Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2065 Переглядів
_name = 'bjit.hospital.cost'

item_name = fields.Many2one('bjit.hospital.charges.item', string="Cost, Charges and Fees ")
hospital_date = fields.Date(string="Date")
hospital_amount = fields.Float(string="Amount (BDT)", required=True)

linked_to_insurance = fields.Many2one('hr.insurance')

all_type = fields.Selection(related='linked_to_insurance.breakup_of_hospital')


@api.onchange('all_type')
def onchange_item_list(self):
for rec in self:
return {'domain': {'item_name': [('item_type', '=', rec.all_type)]}}

I have used the onchange function to pass a domain in the "item_name" field and the model is linked in another model with One2many. The onchange function is not working in tree view ( editable botton ) from One2Many field. The function is working as expexted in form view.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
черв. 22
2648
0
черв. 20
2896
0
лип. 16
4227
3
квіт. 25
4643
5
лист. 23
42958