Sign in
Try it free
  • Apps
    Websites
    Build great user experience
    • Website Builder
    • eCommerce
    • Blogs
    • Forums
    • Slides
    • Live Chat
    Sales
    Boost your success rate
    • Sales
    • CRM
    • Invoicing
    • Point of Sale
      • Shops
      • Restaurants
      • Hardware
    • Subscriptions
    • Sign
    Operations
    It's all about efficiency
    • Accounting
    • Project
    • Human Resources
      • Recruitment
      • Employees
      • Expenses
      • Appraisal
      • Fleet
      • Leaves
    • Inventory
    • Purchase
    • Manufacturing
      • MRP
      • PLM
      • Maintenance
      • Quality
    • Helpdesk
    Productivity Tools
    Great Tools = Happy People
    • Communication
      • Discuss
      • Mailing Lists
      • Notes
    • Timesheet
    • Email Marketing
    • Events
    • Survey
    • Appointments
    • Marketing Automation
    Third party apps | Odoo Studio | Odoo Cloud Platform NEW
  • Tour
  • Pricing
  • Community
  • Docs

Odoo 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 management | MRP | etc.

Take the tour
Help
  • Trending
  • Newest
  • People
  • Tags
  • Badges
Ask a Question
0

Create a related filed from res.company to hr.employee !

fields related_fields
By
el mehdi
on 11/11/16, 7:44 AM • 662 views

Hello, 

I have created a boolean filed in Res.company and I want to use the same filed of  hr.employee.

Thanks 

 

  • Flag
  • Reply
  • Comment
  • Share

Hello Mehta,

 Thanks for the answer.

I try your code

my_filed_emp = fields.Boolean(string='  ',related='company_id.my_filed_com') 
i only have another boolean filed, the fields are not related.

Thanks 


el mehdi
on 11/14/16, 6:29 AM
4

Jignesh Mehta

--Jignesh Mehta--

https://in.linkedin.com/in/jignesh-mehta-6892567b
3028
| 6 5 8
Surat, India
--Jignesh Mehta--


Jignesh Mehta
On 11/12/16, 12:01 AM

Hello el mehdi,


First You can add field in res.company using _inherit

You can inherit the hr.employee model and add boolean field which is related to company.

Ex:-


class Company(models.Model):
     _inherit = 'res.company'

     boolean_field_com = fields.Boolean('Boolean String Company')


class Employees(models.Model):

     _inherit = 'hr.employee'

     boolean_field_emp = fields.Boolean('Boolean String Employee', related='company_id.boolean_field_com')


Hope it works for you.

Thanks,



  • Comment
  • Flag

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

Thanks for your subscription!
1 follower(s)

Stats

Asked: 11/11/16, 7:44 AM
Seen: 662 times
Last updated: 11/15/16, 7:57 AM
Community
  • Github
  • Download
  • Runbot
  • Translations
  • Mailing Lists
  • Forum
Services
  • Odoo Cloud Platform
  • Support
  • Upgrade
  • Find a partner
  • Become a partner
  • Training center
  • Education
  • Security
About us
  • Our company
  • Contact
  • Events
  • Blog
  • Customers
  • Jobs
  • Legal | Privacy
  • English
    • 简体中文
    • Nederlands
    • Français
    • Deutsch
    • Italiano
    • Português (BR)
    • Español

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

Live Webinar on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Watch now