Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

I want to filter out state '=' 'open' contracts in odoo 19

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
filtercontactsstateOdoo19.0
2 Răspunsuri
179 Vizualizări
Imagine profil
Kalana Piyumantha

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

0
Imagine profil
Abandonează
Codesphere Tech

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.

Codesphere Tech

Which records you want based on this condition?

Kalana Piyumantha
Autor

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?

Codesphere Tech

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)
]

Imagine profil
Vashmitha V
Cel mai bun răspuns

Hello there,

contracts = self.env['hr.contract'].search([('employee_id', '!=', False), ('state', '=', 'open')])

For this equlant,

contracts = self.env['hr.version'].search([('employee_id', '!=', False), ('is_in_contract', '=', True)])

Because is_in_contract is True when date_start <= Today <= date_end, to mention is that the contract is in running/open state as per the concept of Odoo 18.


Those contracts can be configured in the Payroll tab.


And you can check using a filter to find. Employees with a current contract is in Running or expired. 

Hope this helps you.

0
Imagine profil
Abandonează
Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

Hi,

In Odoo 19, the hr.contract model is deprecated and hr.version model is there instead.And the state field is also deprecated. So if you need the contracts according to the condition, use the code referenced instead.

contracts = self.env['hr.version'].search([('employee_id', '!=', False), ('is_in_contract', '=', True)])

 

Hope it helps.


0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
I want to filter Sales Orders by picking state, but 'picking_state', '=', 'confirmed' isn't working.
filter state
Imagine profil
Imagine profil
1
iul. 18
3717
Contacts as Vendors
filter contacts vendor
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
mar. 24
5312
filter all contacts from "active" companies
accounting filter contacts
Imagine profil
Imagine profil
1
nov. 22
2783
[domain filter] why using "employee_id.user_id = uid" as filter rather than "employee_id = uid" Rezolvat
filter domain contacts
Imagine profil
Imagine profil
2
mar. 18
12320
[Solved] Filtering res.partner for contact (child_ids) - Odoo8 Rezolvat
filter error contacts
Imagine profil
Imagine profil
3
iun. 15
13111
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now