Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

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

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
filtercontactsstateOdoo19.0
2 Replies
193 Rodiniai
Portretas
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
Portretas
Atmesti
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
Autorius

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

Portretas
Vashmitha V
Best Answer

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
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

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

Registracija
Related Posts Replies Rodiniai Veikla
I want to filter Sales Orders by picking state, but 'picking_state', '=', 'confirmed' isn't working.
filter state
Portretas
Portretas
1
liep. 18
3717
Contacts as Vendors
filter contacts vendor
Portretas
Portretas
Portretas
Portretas
3
kov. 24
5315
filter all contacts from "active" companies
accounting filter contacts
Portretas
Portretas
1
lapkr. 22
2784
[domain filter] why using "employee_id.user_id = uid" as filter rather than "employee_id = uid" Solved
filter domain contacts
Portretas
Portretas
2
kov. 18
12322
[Solved] Filtering res.partner for contact (child_ids) - Odoo8 Solved
filter error contacts
Portretas
Portretas
3
birž. 15
13118
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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