Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

how to fix this syntax error when I am running the hr_holidays module in odoo14

Subscribe

Get notified when there's activity on this post

This question has been flagged
syntaxhr_holidaysv14
3 Replies
4556 Views
Avatar
Joy MA

I downloaded the odoo14 files from GitHub and successfully installed the hr_hodidays app, but when clicking on this app in the menu, the contents of the module cannot be displayed and an error is reported

File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/addons/base/models/ir_http.py", line 237, in _dispatch

    result = request.dispatch()

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/http.py", line 683, in dispatch

    result = self._call_function(**self.params)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/http.py", line 359, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/service/model.py", line 94, in wrapper

    return f(dbname, *args, **kwargs)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/http.py", line 347, in checked_call

    result = self.endpoint(*a, **kw)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/http.py", line 912, in __call__

    return self.method(*args, **kw)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/http.py", line 531, in response_wrap

    response = f(*args, **kw)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/addons/web/controllers/main.py", line 1377, in call_kw

    return self._call_kw(model, method, args, kwargs)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/addons/web/controllers/main.py", line 1369, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/api.py", line 392, in call_kw

    result = _call_kw_model(method, model, args, kwargs)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/api.py", line 365, in _call_kw_model

    result = method(recs, *args, **kwargs)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/models.py", line 1526, in load_views

    for [v_id, v_type] in views

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/models.py", line 1526, in <dictcomp>

    for [v_id, v_type] in views

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/addons/web/models/models.py", line 220, in fields_view_get

    r = super().fields_view_get(view_id, view_type, toolbar, submenu)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/models.py", line 1614, in fields_view_get

    xarch, xfields = view.postprocess_and_fields(etree.fromstring(result['arch']), model=self._name)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/addons/base/models/ir_ui_view.py", line 851, in postprocess_and_fields

    arch, name_manager = self._postprocess_view(node, model, validate=validate)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/addons/base/models/ir_ui_view.py", line 863, in _postprocess_view

    self.postprocess(node, [], editable, name_manager)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/addons/base/models/ir_ui_view.py", line 963, in postprocess

    self.postprocess(child, current_node_path, node_info['editable'], name_manager)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/addons/base/models/ir_ui_view.py", line 963, in postprocess

    self.postprocess(child, current_node_path, node_info['editable'], name_manager)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/addons/base/models/ir_ui_view.py", line 963, in postprocess

    self.postprocess(child, current_node_path, node_info['editable'], name_manager)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/addons/base/models/ir_ui_view.py", line 958, in postprocess

    transfer_node_to_modifiers(node, node_info['modifiers'], self._context, current_node_path)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/addons/base/models/ir_ui_view.py", line 66, in transfer_node_to_modifiers

    modifiers.update(ast.literal_eval(attrs))

  File "/Users/joy/.pyenv/versions/3.7.3/lib/python3.7/ast.py", line 46, in literal_eval

    node_or_string = parse(node_or_string, mode='eval')

  File "/Users/joy/.pyenv/versions/3.7.3/lib/python3.7/ast.py", line 35, in parse

    return compile(source, filename, mode, PyCF_ONLY_AST)

Exception


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/http.py", line 639, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/Users/joy/Desktop/Internship_test/odoo-14.0/odoo/http.py", line 315, in _handle_exception

    raise exception.with_traceback(None) from new_cause

  File "<unknown>", line 1

    {'invisible': '('holiday_type', '!=', 'employee')'}

                                ^

SyntaxError: invalid syntax


Why does the official file also have errors, I don't know why there are syntax errors, and how do I solve this problem

0
Avatar
Discard
Joy MA
Author

Thanks for all the answers, now I know how to fix this error, but I thought this error occurs in the unknown file type, and I couldn't find this unknown type file, how can someone tell me how to trace this error? Thanks.

Ibrahim Zool Odoo

search in your all custom addons by this ({'invisible': '('holiday_type', '!=', 'employee')'})

and just modify it .

Avatar
Ibrahim Zool Odoo
Best Answer

you have custom xml code ({'invisible': '('holiday_type', '!=', 'employee')'}) modify it to following :

correct syntax :

'invisible': [('holiday_type', '!=', 'employee')]

1
Avatar
Discard
Avatar
Jainesh Shah(Aktiv Software)
Best Answer

Hello @Joy

Hope you are doing well.

If the issue is related to the syntax of  {'invisible': '('holiday_type', '!=', 'employee')'}

then there are 2 problems :

1. The value tuple is in single quotes which makes it a string so remove it.

2. Normally we write domain inside a list format so you can enclose your domain tuple in the list.

Eg:

{'invisible': [ ('invoice_without_email', '=', False)]}

So your final code line should be {'invisible': [('holiday_type', '!=', 'employee')]}

Regards,

Thanks

Regards,


   

Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

3
Avatar
Discard
Avatar
Kiran K
Best Answer

Hi,

The issue is with your syntax, 

attrs="{'invisible':[('holiday_type','!=','employee')]}"

Hope it helps,

Kiran 

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

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

Sign up
Related Posts Replies Views Activity
Record rule not working odoo 14
record_rules hr_holidays v14
Avatar
1
Nov 21
2455
Js Classes
js syntax v14
Avatar
0
May 21
2791
How I can fix this error? File "<unknown>", line 1 {'invisible': '('holiday_type', '!=', 'employee')'}
hr_holidays unknown v14
Avatar
Avatar
1
Mar 21
4370
How to use invoice_terms from setting for an invoice in a new module
invoice account.move syntax v14
Avatar
Avatar
1
Nov 21
3818
Attached PDF file is not formatted properly
v14
Avatar
Avatar
1
Dec 25
386
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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