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

Error when accessing hr.applicant form.

Subscribe

Get notified when there's activity on this post

This question has been flagged
hrodoo17
1 Reply
2044 Views
Avatar
Marcos Pérez

I am creating some modules that inherit from hr.job and hr.applicant, basically what they do is that when a user applies to a record in hr.job, the record is created in hr.applicant and redirected to the form of the record that was just created.


When applying, the record is created in hr.applicant with all the data, but when rendering the view for the form, I get an error for the Grant Applicant role that says the following:


UncaughtPromiseError > OwlError
Uncaught Promise > An error occured in the owl lifecycle (see this Error's "cause" property)
OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
    Error: An error occured in the owl lifecycle (see this Error's "cause" property)
        at handleError (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:916:101)
        at App.handleError (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:1551:29)
        at Fiber._render (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:941:19)
        at Fiber.render (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:939:6)
        at ComponentNode.initiateRender (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:1008:47)

Caused by: EvalError: Can not evaluate python expression: (bool(not salary_expected_extra))
    Error: Name 'salary_expected_extra' is not defined
    EvalError: Can not evaluate python expression: (bool(not salary_expected_extra))
    Error: Name 'salary_expected_extra' is not defined
        at evaluateExpr (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:3058:54)
        at FormRenderer.evaluateBooleanExpr (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:3061:8)
        at FormRenderer.slot25 (eval at compile (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:1503:374), <anonymous>:170:26)
        at callSlot (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:1109:25)
        at InnerGroup.template (eval at compile (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:1503:374), <anonymous>:56:42)
        at Fiber._render (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:940:96)
        at Fiber.render (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:939:6)
        at ComponentNode.initiateRender (http://localhost:8888/web/assets/d35eeae/web.assets_web.min.js:1008:47)

However, if I also assign the same user the role of administrator or interviewer for the recruitment modules, the error disappears. What can I do?


Here is the code that generates the record in hr.applicant after the user clicks on the corresponding button in the kanban view of hr.job:


def action_create_application(self):
current_user = self.env.user
applicant_obj = self.env['hr.applicant']
for job in self:
existing_applicant = applicant_obj.search([
('job_id', '=', job.id),
('partner_id', '=', current_user.partner_id.id)
])
if existing_applicant:
raise UserError('Already applied for this Grant')
else:
applicant = applicant_obj.create({
'name': 'Application of %s to %s' % (current_user.partner_id.name, job.name),
'partner_name': current_user.partner_id.name,
'email_from': current_user.partner_id.email,
'partner_id': current_user.partner_id.id,
'job_id': job.id,
})
return {
'type': 'ir.actions.act_window',
'res_model': 'hr.applicant',
'view_mode': 'form',
'res_id': applicant.id,
'target': 'current',
}

Also this is my inherited view form:

<record id="view_hr_applicant_grant_applicant_form" model="ir.ui.view">
<field name="name">hr.applicant.grant.applicant.form</field>
<field name="model">hr.applicant</field>
<field name="inherit_id" ref="hr_recruitment.hr_applicant_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='stage_id']" position="replace">
<field name="state" widget="statusbar" options="{'clickable': '1', 'fold_field': 'fold'}"
invisible="not active and not emp_id"/>
</xpath>

<xpath expr="//field[@name='name']" position="attributes">
<attribute name="placeholder">Insert here a subject for your application</attribute>
</xpath>
</field>
</record>

If you need more information let me know. Thanks


0
Avatar
Discard
Avatar
Marcos Pérez
Author Best Answer

I found a solution!!!

In Odoo 17 CE in model hr.applicant this fields are defined like this:

salary_proposed_extra = fields.Char("Proposed Salary Extra", help="Salary Proposed by the Organisation, extra advantages", tracking=True, groups="hr_recruitment.group_hr_recruitment_user")

salary_expected_extra = fields.Char("Expected Salary Extra", help="Salary Expected by Applicant, extra advantages", tracking=True, groups="hr_recruitment.group_hr_recruitment_user")

salary_proposed = fields.Float("Proposed Salary", group_operator="avg", help="Salary Proposed by the Organisation", tracking=True, groups="hr_recruitment.group_hr_recruitment_user")

salary_expected = fields.Float("Expected Salary", group_operator="avg", help="Salary Expected by Applicant", tracking=True, groups="hr_recruitment.group_hr_recruitment_user")

My custom group does not have any reference to this group so, I decided to inherit this module and modify groups in these 4 fields setting parameter groups to False, and It worked. Hope other people find this helpful

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
[{(!!@Nombre~LAN~Colombia#)}] ¿Cómo se llama Avianca en Colombia?
hr
Avatar
0
Dec 25
4
Implementing HR Module? Solved
hr
Avatar
Avatar
1
Nov 25
384
gratis trainingssessies
hr
Avatar
0
Nov 25
6
Attendance Analysis – How to calculate Extra Hours with flexible start times
hr
Avatar
Avatar
2
Oct 25
887
block other users from editing a survey
hr
Avatar
Avatar
1
Oct 25
850
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