Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

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

Odebírat

Get notified when there's activity on this post

This question has been flagged
filtercontactsstateOdoo19.0
2 Odpovědi
206 Zobrazení
Avatar
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
Avatar
Zrušit
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)
]

Avatar
Vashmitha V
Nejlepší odpověď

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
Avatar
Zrušit
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

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
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
I want to filter Sales Orders by picking state, but 'picking_state', '=', 'confirmed' isn't working.
filter state
Avatar
Avatar
1
čvc 18
3719
Contacts as Vendors
filter contacts vendor
Avatar
Avatar
Avatar
Avatar
3
bře 24
5318
filter all contacts from "active" companies
accounting filter contacts
Avatar
Avatar
1
lis 22
2785
[domain filter] why using "employee_id.user_id = uid" as filter rather than "employee_id = uid" Vyřešeno
filter domain contacts
Avatar
Avatar
2
bře 18
12327
[Solved] Filtering res.partner for contact (child_ids) - Odoo8 Vyřešeno
filter error contacts
Avatar
Avatar
3
čvn 15
13124
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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