Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

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

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
filtercontactsstateOdoo19.0
2 Réponses
192 Vues
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
Ignorer
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
Auteur

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
Meilleure réponse

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
Ignorer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
I want to filter Sales Orders by picking state, but 'picking_state', '=', 'confirmed' isn't working.
filter state
Avatar
Avatar
1
juil. 18
3717
Contacts as Vendors
filter contacts vendor
Avatar
Avatar
Avatar
Avatar
3
mars 24
5315
filter all contacts from "active" companies
accounting filter contacts
Avatar
Avatar
1
nov. 22
2784
[domain filter] why using "employee_id.user_id = uid" as filter rather than "employee_id = uid" Résolu
filter domain contacts
Avatar
Avatar
2
mars 18
12322
[Solved] Filtering res.partner for contact (child_ids) - Odoo8 Résolu
filter error contacts
Avatar
Avatar
3
juin 15
13117
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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