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

Show some text in the form view of odoo?

Odoberať

Get notified when there's activity on this post

This question has been flagged
pythonxmlformviewodooV8
8756 Zobrazenia
Avatar
Uppili Arivukkannu

I want to display some text in the form view of odoo. The text should be displayed below the sheet. I have one field name "state" it is a boolean value. If the state is true the it should display some text and if it is false it should display some text in the form view.

The hr_attendance module has validation to import a file into odoo the validation contains three "if" condition I have edited this condition so that it will import the record even it is wrong and it will show the field in red color in tree view.

Here is the code

hr_attendance.py

def _altern_si_so(self, cr, uid, ids, context=None):
    """ Alternance sign_in/sign_out check.
    Previous (if exists) must be of opposite action.
    Next (if exists) must be of opposite action.
    """
    for att in self.browse(cr, uid, ids, context=context):
        # search and browse for first previous and first next records
        prev_att_ids = self.search(cr, uid, [('employee_id', '=', att.employee_id.id), ('name', '<', att.name),
                                             ('action', 'in', ('sign_in', 'sign_out'))], limit=1, order='name DESC')
        next_add_ids = self.search(cr, uid, [('employee_id', '=', att.employee_id.id), ('name', '>', att.name),
                                             ('action', 'in', ('sign_in', 'sign_out'))], limit=1, order='name ASC')
        prev_atts = self.browse(cr, uid, prev_att_ids, context=context)
        next_atts = self.browse(cr, uid, next_add_ids, context=context)
        # check for alternance, return False if at least one condition is not satisfied
        if prev_atts and prev_atts[0].action == att.action:

            return self.write(cr, uid, ids, {'state': True})
        if next_atts and next_atts[0].action == att.action:  # next exists and is same action
            return self.write(cr, uid, ids, {'state': True})
        if (not prev_atts) and (not next_atts) and att.action != 'sign_in':  # first attendance must be sign_in
             return self.write(cr, uid, ids, {'state': True})
        else:
            return self.write(cr, uid, ids, {'state':False})

    return True

_constraints = [
    (_altern_si_so, 'Error ! Sign in (resp. Sign out) must follow Sign out (resp. Sign in)', ['action'])]

hr_attendance_view.xml

<field name="arch" type="xml">
            <tree string="Employee attendances" colors="red:state == True;black:state == False">
                <field name="name"/>

Now I want to display some text in the form view. If I click the wrong field(which displays red color in the tree view) the form view will be open. I want to display a text below the form view sheet. So that the text describes what is the error in the field.

Thanks...

0
Avatar
Zrušiť
Uppili Arivukkannu
Autor

Is this possible or not? Is there any way to show some text below the form view?

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
How to add restriction to Users in Odoo
python xml odooV8
Avatar
Avatar
1
nov 22
3930
Document type: account.analytic.account, Operation: read
python xml odooV8
Avatar
Avatar
1
feb 21
8118
How to know menu parent id? Solved
python xml odooV8
Avatar
Avatar
1
jan 16
7524
How to open a form with ir.action.server which executes python code Solved
python xml form formview
Avatar
Avatar
2
jan 22
49726
Open form in view mode? Solved
action xml form view
Avatar
Avatar
Avatar
Avatar
Avatar
4
dec 21
33454
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