Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to Change State by Current Date

Odoberať

Get notified when there's activity on this post

This question has been flagged
datestateOdoo13.0
4 Replies
8010 Zobrazenia
Avatar
Boby

Hello.

I want to change state by current date, when choose current date the state automaticaly move (ex from draft to expired)?

How can i do that, thanks

1
Avatar
Zrušiť
Avatar
Boby
Autor Best Answer

Thank you for guiding me using Scheduled Action Paresh.

I adding the the model=ir.cron in my .xml and adding python function to change the state from active to expired.

didn't work with:

    record.cop_expiry < datetime.datetime.today()
beside of using it, i'm using this:

    record.cop_expiry <= fields.Date.today():

It works well to me

0
Avatar
Zrušiť
Avatar
Paresh Wagh
Best Answer

Hi Boby:

You can define a Scheduled Action which will run every day after midnight and update the previous day's draft records to expired.

To define the Scheduled Action, you need to activate developer mode and go to Settings > Technical > Scheduled Actions.

0
Avatar
Zrušiť
Boby
Autor

With Scheduled Actions how can i know when current date is match with the expired date?

I have this model:

class xapiens_employee(models.Model):

_inherit = 'hr.employee'

certificate_state = fields.Selection(string="COP Status", selection=[

('draft', 'Draft'),

('expired', 'Expired')], readonly=True, default='draft')

class certificate_proficiency(models.Model):

_name = 'hr.certificate.proficiency'

_description = 'Certificate Proficiency'

_rec_name = 'certificate_name_cop'

cop_emp_id = fields.Many2one('hr.employee', string="COP Employee Name")

cop_file_name = fields.Char(String="File Name COP")

certificate_name_cop = fields.Many2one('hr.certificate.proficiency.name', string="Certificate Name")

cop_number = fields.Char('Number')

cop_issue = fields.Date('Issued')

cop_expiry = fields.Date('Expiry'))

When Date Today is match with cop_expiry, the certificate_state move to expired

Paresh Wagh

Based on your description of what you are trying to do, you need to check for records where expiry date is before the date on which the job runs.

record.cop_expiry < datetime.datetime.today()

Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Odoo 13: Post Inventory valuation in past dates
date inventory Odoo13.0
Avatar
Avatar
Avatar
Avatar
3
nov 25
7863
How to get/load Date from Datetime in Odoo 13 Solved
date datetime Odoo13.0 odoo13
Avatar
Avatar
1
okt 21
8750
odoo 16 dashboard select specific date range Solved
date
Avatar
Avatar
Avatar
3
jún 25
2420
How to get Creation Date for created Customer? Solved
date
Avatar
Avatar
1
jan 25
18940
Odoo 13. Don't close a wizard when Click a button Solved
Odoo13.0
Avatar
Avatar
Avatar
Avatar
4
máj 24
14063
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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