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

Name Error : Name 'time' is not defined

Subscribe

Get notified when there's activity on this post

This question has been flagged
errorv7namerror
12 Replies
48409 Views
Avatar
GuruDev

Hello all, I am getting an error while refreshing the page in V7

server/openerp/addons/base/ir/ir_ui_menu.py", line 336, in get_needaction_data dom = menu.action.domain and eval(menu.action.domain, {'uid': uid}) or []

erver/openerp/tools/safe_eval.py", line 241, in safe_eval return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict) File "", line 1, in <module> NameError: name 'time' is not defined

What may be the issue? Please help..

1
Avatar
Discard
Avatar
Lucio
Best Answer

Hi,

It seems that's a known bug: https://code.launchpad.net/~openerp-dev/openobject-server/7.0-opw-603382-ado 

I went through the the fix proposed and tested it and, at a first glance, it works!


Hope this helps!

0
Avatar
Discard
Avatar
Francesco OpenCode
Best Answer

Add this line at top of your code, with the other import lines:

import time

0
Avatar
Discard
GuruDev
Author

Dear Francesco and Keyur,Thank you for the reply, I tried this one, but my case is different. I am getting this error for Admin users only. All other users get expected result.

I was trying to create new Groups via GUI and to give acces rights in the Menus.

Avatar
Keyur
Best Answer

Hi GuruDev,

Maybe you have not imported time library in your py file. That's why it is giving error of time.

Hope it will work after importing time in py file.

0
Avatar
Discard
GuruDev
Author

Thanks for the reply, Keyur..

I should import it in the ir_ui_menu.py file? How to import? in the .py file.. import time is it ok?

Keyur

Have you created your custom module? Have you created any menu or apply domain on any action? I think the error comes because of the domain in action.

GuruDev
Author

I didint create any module. But I duplicated some groups and made some modification in acces. And also, I didnt add any domain.

Keyur

Basic addons are not error prone. Maybe there can be other reason. You should try different database maybe then it will work properly.

GuruDev
Author

Dear Keyur, I was creating a new user group for Approvals. I've added a new Menu item into the Existing Accounting-Menu and gave acces rights for this newly created user group. That menu item contains...an action---Purchase Orders Waiting for Approval.

This was the only change that I made.

Keyur

Can you please paste your action code here? I will try it in my custom module. Then I can figure out what exactly the problem is.

Krishna

hello Keyur...I need your help..i am adding domain in action the its giving error of time is not defined..I have defined import time in .py file..but of no use..Please help

Avatar
Krishna
Best Answer
 <record id="action_view_task" model="ir.actions.act_window">
            <field name="name">Tasks</field>
            <field name="res_model">project.task</field>
            <field name="view_mode">kanban,tree,form,calendar,gantt,graph</field>
            <field name="domain">[('date','=',time.strftime('%Y-%m-%d')),('user_id','=',uid)]</field>
            <field name="filter" eval="True"/>
            <field name="search_view_id" ref="view_task_search_form"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to create a new task.
              </p><p>
                OpenERP's project management allows you to manage the pipeline
                of tasks in order to get things done efficiently. You can
                track progress, discuss on tasks, attach documents, etc.
              </p>
            </field>
        </record>

This is my action code.

0
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
Error occurred while validating the field(s) arch: Invalid XML for View Architecture!
error v7
Avatar
Avatar
Avatar
3
Mar 15
9819
What is "ValueError: No such external ID currently defined in the system: note.note_stage_01"?
error v7
Avatar
0
Mar 15
4441
Broken Pipe error when trying to view module's description
error v7
Avatar
0
Mar 15
8796
TypeError: ClientWidget is null - bug ?
error v7
Avatar
Avatar
2
Mar 15
8131
Messaging Archives Warning: Access Denied
error v7 massaging
Avatar
Avatar
Avatar
Avatar
Avatar
9
Apr 19
11607
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