I want to filter out state '=' 'open' contracts in odoo 19 but there aren't see any options or replacement to this field in odoo19, i faced this when migrating a module from odoo18 to odoo 19??
I appreciate your own answers instead of AI, because AI ans are not working.
contracts = self.env['hr.contract'].search([('employee_id', '!=', False), ('state', '=', 'open')])error occured in this state = open part, How can I solve this ?? hr.contract =>hr.version i know that then state???


Hello,
In Odoo 19, the hr.contract model has been replaced with hr.version. Please review this model and update your condition, as the state field is no longer available in this version.
Hope this helps.
Which records you want based on this condition?
i want to filter the open contracts ,not all contracts because there are archive contracts and other contracts no? i think now you understand? doesn't it?
Understand, but I review and compare methods with Odoo 19 version and found that in current version it is use active field. and also used date fields..
Example Filter for “Open Contracts” in Odoo 19
domain = [
('active', '=', True),
('date_start', '<=', date_to),
'|',
('date_end', '=', False),
('date_end', '>=', date_from)
]