Multi-Company Configuration In OpenERP 7

OpenERP 7 support multi company configuration in which there can be number of sub companies under a main company or another company itself. The modules installed in my OpenERP 7 are :

 

 

  • Sales

  • Purchase

  • Accounting

  • Warehouse

    First step of creating a multi-company configuration is defining the companies in OpenERP. This can be done from Setting -> Companies -> Companies. If you can’t see this menu, please make sure that the user has all the required access rights configured. Create a new company. To create a sub-company under a main company, create a sub company and assign the main company in the field “Parent Company”. I have created a main company “Main Company” and a “Sub Company 1” and “Sub Company 2” under “Main Company” and “Sub Company 1 Sub” under “Sub Company 1”. The hierarchy is shown in the figure below:

Company Hierarchy

Chart Of Account Configuration:

    Now we have to set up the chart of account for each company. To configure chart of account go to Setting -> Configuration -> Invoicing. This will give all the accounting details regarding the company. A screen shot of this menu item is shown below:

Char of Account Configuration

    Select the company for which the chart of account has to be configured in field “Select Company” field. If the company has no chart of account configured earlier, a field “Template” in the group “Chart of Account” will be made visible. Select the chart of account for the company and press “Apply” button on top of the view. I we want to install a chart of account apart from that currently installed in OpenERP, click on “Install more chart of account” which lists all the chart of account that are available in OpenERP. User can install any chart of account as he likes.

Location Configuration :

    Location Configuration can be done from Warehouse -> Configuration -> Locations. Configure locations for each company. There is a fields called “Company in Location where we can select the company for which he location corresponds. Each company has its own locations configured. The screen shot of the location view is shown below:

Location Configuration

Warehouse Configuration :

Warehouse Configuration can be done from Warehouse -> Configuration -> Warehouses. Configure warehouses for each company. I have creates separate warehouses for each company. The screen shot of the warehouse view is shown below:

Warehouse Configuration

Shop Configuration :

Shop Configuration can be done from Sales -> Configuration -> Shops. Configure a shop for each company. The screen shot of the tree view of the shops configured is shown below:

Shop Configuration

Product Configuration :

Each product can be configured as a global product or product for each individual company. Product can e created and modified form the menu Sales -> Products -> Products. For my example, i am creating 5 products in which one is a global product and other 4 belongs o each company. Lets the product be “Product Global” which is a global product with no company assigned, “Product Sub Company 1” which belong to “Sub Company 1”, “Product Sub Company 2” which belong to “Sub Company 2”, “Product Sub Company 1 Sub” which belong to “Sub Company 1 Sub” and “Product Main Company” which belong to “Main Company”. Each product can be assigned to a company by setting the fields “Company” in the product form view. If the fields is not set, it will be treated as a global product and will be visible be all the company. The kanban view of the product when logged in as an Administrator is shown below:

Product Kanban View When Logged in as Administrator

User Configuration :

In OpenEPR, we can configure the users for separate companies. Users can be created and configured from the menu Settings -> Users -> Users. To create a new users go to this menu and click “Create”. New form view to create the user will be shown. In this view we have the provision to specify the name, login, company, language, access rights, etc for each user. I am creating 4 users who belong to 4 separate companies. Let the users be “Main Company User” who belong to “Main Company”, “Sub Company 1 User” who belong to “Sub Company 1”, “Sub Company 2 User” who belong to “Sub Company 2” and “Sub Company 1 Sub User” who belong to “Sub Company 1 Sub” company. User can be specified to each company by setting the field “Company” in the user form view. The user can only be assigned to companies which are specified in the field “Allowed Companies” in “Access Rights” tab in user form view. To set the password for the user, click in “Change Password” button in the user form view. A pop up will be displayed which prompt the user to enter the password. The tree view of the user is shown below:

OpenERP Users

    Now the configuration of OpenERP for multi-company configuration of product is complete. Similarly we can configure Address Book also. By setting the fields “Company”, we can assign the Partners in to separate companies.

OpenERP follows sharing between companies based on:

“Share with your parent and children,
not with brother and sister”

ie; user can see information in our case products that belong to itself and also its parents and child company but not of the other companies. For example, if we login as “Sub company 1 User”, we will be able to see the products and address book that belong to itself, its parent company “Main Company” and also its child company “Sub Company 1 Sub”. The kanban view of the product when logged in as “Sub company 1 User” is given below:

Product When Logged in as Sub Company 1 User

Similarly if we are logged in as “Sub Company 2 User”, we will be able to view all the product belonging to itself and “Main Company”. If we are logged in as “Main Company user”, we will be able to view all the product since all other companies are child company to “Main Company”. The screen shot of product when logged in as “Sub Company 2 User”, “Sub Company 1 Sub User”, “Main Company” are shown below:

Product When Logged in as Sub Company 2 User

Product When Logged in as Sub Company 1 Sub User

Product When Logged in as Main Company User

    The product listed when creating the sale order or purchase order depends on the product company and user company. The product listed when logged in as “Sub Company 2 User” is shown below:

Product List in Sale Order

Comments

L. Arnold: Thank you for the article. It is quite through and well presented. My question is whether you have to have separate Users for each company, or whether a User in the Root company can create Quotations, orders etc, for a Sub Company? It seems like most of the code is set up this way but I am not seeing a way to create an order (in my Admin or SubAdmin role) for any company but the one I am assigned to. I will see if I can "disconnect" from a main company but it seems I have not found that yet. Thanks again.".

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Anonymous says:

    Hi Prajul,
    Great article. Do you know how to enable Shops? I don’t see it available under configurations even though I have the appropriate modules setup already.
    Thanks.

    1. Prajul P T says:

      Hi,

          Please make sure that the module sale_stock is insalled. After installing the module check the option "Manage multiple locations and warehouse" in "Settings -> Configuration -> Warehouse" is enabled. Then the menu will be visible.

       

      Thanks

      1. Ajmal Khan says:

        Its a great article..I followed all the steps but the SubCompany 1 user cannot create invoice or sale orders even i give all the permissions..the error is
        “Access Denied
        The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
        (Document type: Partner, Operation: read) ”
        Can you help me to get ride of this bug??

        1. Prajul P T says:

          Hi Ajmal,

                 Please check weather the company field in the partner form view is properly configured. User can have permission to access partners belonging to his company and his child company.

          1. Diya Rana says:

            Hello Prajul,
            Its one of the best article and help us the new user to OpenERP 7.
            Now my isssue is:
            I follow all the configuration as you mentioned above. But now user from child company dont have any access to create customer also even dont have any read permission. I already tried to configure these settings many way. But dont get success that how I can get the customer creation permission. I configure child company user which have all access. But still the error remaining same.
            “””””””””””””””Access Denied
            The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
            (Document type: Partner, Operation: read) “””””””””””””””””
            Please reply soon as my rest of work is stopped due to this problem.
            Thanks in advance.
            Diya Rana

  2. Anonymous says:

    Hi Prajul,
    I would like to know about following: please help me.
    If the user is accountant in finance and accounting, that user want to know and see about payroll in openERP 7. So, how can i do that?
    best regards,
    anonymous

    1. Prajul P T says:

      Hi,

           If the user is assigned as Officer in Human Resource group, he could see the details of the employee payslip. If you want to see and configure payroll, the user should be assigned as Manager for the group Human Resources.

      1. Anonymous says:

        But my boss want to be ” Account can access payroll but not give manager permission for human resources and then account must be employee in hr.” but i can’t do that.
        Thanks regards,
        kothudevil

        1. Prajul P T says:

          Hi,

              That might require some customisation to be made if you want a permenant solution. Or else you could give acess to group Human Resources/Employee from "Settings -> Users -> Groups" based on your requirement.

          1. Myat Thu says:

            Hi Prajul,
            Now i have a probelm concerned with security issue. When i was clicked compute sheet button in payslip as a HR Manager (Administration is “Access Right”), there has an error occured. the error is “Document Type: payslip, Operation: Create”. So where can i configure this error.
            Please Help me!!!
            Best Regards,
            MYAT THU

          2. Prajul P T says:

            Hi,

                 In OpenERP, the payslip of the employee can be generated by the "Responsible User" of the particular employee or the "Responsible User" of the manager of the department to which  the employee belong. There is a record rule set for group Manager and Officer of Human Resource in payslip. So please make sure that the user who is trying to generate the payslip is a manager of the department to which the employee belong.

          3. Myat Thu says:

            Thanks PRAJUL. I will try for that.

          4. Myat Thu says:

            Hi Prajul,
            I write the python code for sick leave calculation in payslip.
            but it didn’t work.This is following:
            totalnoofday = Employee.leave_date_to – Employee.leave_date_from
            result = totanoofday * contract.wage / hr.payslip.worked_days_line_ids
            What i want to do is ” i want to get the result of total amount for leave days”.
            please reply me Prajul.

          5. Prajul P T says:

            Hi,

                 I think you can calculate the amount from the client side itself. First you have to define a contact for the employee. The contract will have the details like the base wage, allowance etc. Also in contract you need to define the salary structure for the employee. The salary structure will have the salary rules which is used to calculate the salary of the employee. In salary structure you can define the deduction of the leave. In salary rule Computation amount type as "Python Code". For example if i want to find the net salary after deducing the amount for leave. I am calculating the amount to be deduce for a leave based on the base amount and number of working days for that month ie; if number of working days is 24 and base salary is 24000, the amount deduced for a single day leave will be 24000 / 24 = 1000. this can be declared in a salary rule using the formula :

            – ((contract.wage / worked_days.WORK100.number_of_days) * worked_days.Unpaid.number_of_days)

             

            where contract is the contract defined for the customer and contract.wage fetched base salary defined in that contract, work_days is the "Worked Days" one2many in the employee payslip "Work Days & Input" tab. Each line in this one2many can be referenced using the value "Code". For example worked_days.WORK100 will fetch the value from this one2many with code "WORK100".

          6. Myat Thu says:

            Thank you very much, Prajul. It was a great help and you help me to solve my misery.

          7. Myat Thu says:

            Hi Prajul,
            I also have a question again.
            When i was produce pay slip as a HR manager (Access right), there is an error occured which is the “Document Type: payslip, Operation Create”.
            So, I want to know when can i find document type in openERP 7.
            Best Regards,
            Myat Thu

          8. Prajul P T says:

            Hi,

                 The access error is coming from payslip. In OpenERP, the payslip of the employee can be generated by the "Responsible User" of the particular employee or the "Responsible User" of the manager of the department to which  the employee belong. There is a record rule set for group Manager and Officer of Human Resource in payslip. So please make sure that the user who is trying to generate the payslip is a manager of the department to which the employee belong.

          9. Lee Trotman says:

            I have been exploring for a little bit for any high-quality articles or blog posts on this sort of house .
            Exploring in Yahoo I at last stumbled upon this site.
            Reading this information So i’m satisfied to exhibit that I have a very
            just right uncanny feeling I came upon exactly what I needed.
            I such a lot unquestionably will make sure to do not fail to remember this site and give it a look regularly.

          10. Prajul P T says:

            Hi,
            Thank you very much…. Happy to know that my blog helped you…

  3. Anonymous says:

    When I’m trying to add a user to sub company I get this error
    “Error occurred while validating the field(s) company_id,company_ids: The chosen company is not in the allowed companies for this user”
    Any idea?

    1. Prajul P T says:

      Hi,

          In users form view you could find a field named "Allowed Companies". Add the company you are trying to assign to the user to this field. User can be assigned to the companies assigned to him in this field.

  4. MikeU says:

    Hi there. I’m trying to setup a new chart of accounts for my second company but I do not get the invoicing Settings menu. I also do not get the Company Structure menu. I am the administrator so I can’t see it being a security issue.
    My settings menus are as follows:
    Sales
    Purchases
    Warehouse
    Manufacturing
    Project
    Accounting
    Human Resources
    Knowledge
    General Settings
    Companies
    Companies
    I also have enabled “Manage multiple companies” within the General Settings.
    Mike

    1. Prajul P T says:

      Hi,

          If you are going to configure chart of account for your new company, go to "Settings -> Configuration -> Invoicing". Here in Chart Of Account section you could see a dropdown field "Select Company" in which you could select the company. Select your newly created company from this dropdown field. If no chart of account is configured for this company, A new field will be visible as "Template" where you can select the installed chart of account in OpenERP. If you want to install a new chart of account, just click "Install more chart templates" where you could select the template you want.

      1. L. Arnold says:

        My experience is that the “Invoicing” module name changes to Accounting once the primary Chart of accounts is installed, so attaching a Chart to a Sub Company will likely be done under “Accounting” config rather than Invoicing after that.

    2. Anonymous says:

      Hi ……
      I have one daut suppose if i have 1 main company and 3 sub companies..
      my question is how to add customers to this 1+3 companies use multi companie scenario ,,
      if main comapany(Adminstrator) customers are – customer1,customer2,customer3,…n
      But in
      comp1-customer1 and customer2
      comp2-customer3,customer4
      my question is how comp1 admin access only the customer1 and customer2 comp2 admin cannot access comp 2 customers.
      same for comp 2 CUSTOMERS
      Main comp adminstrator can access all the customers..
      Pls help……

  5. L. Arnold says:

    Thank you for the article. It is quite through and well presented.
    My question is whether you have to have separate Users for each company, or whether a User in the Root company can create Quotations, orders etc, for a Sub Company?
    It seems like most of the code is set up this way but I am not seeing a way to create an order (in my Admin or SubAdmin role) for any company but the one I am assigned to.
    I will see if I can “disconnect” from a main company but it seems I have not found that yet.
    Thanks again.

  6. Antonio says:

    Hello Mr Prajul,
    This is the best article I found out about this multicompany issue.
    I would like to discuss the following situation:
    Just to organize the products we sell, I have 3 companies:
    one of the companies (company C) sells all products but the other 2 (A and B) only sells one type of product each one. All my employees work for all companies.
    I’ve OpenERP installed with multicompany and defined a shop for each company.
    Company A -> Shop A -> Sells products A
    Company B -> Shop B -> Sells products B
    Company C -> Shop C -> Sells products A, B and C
    My situation is the following:
    * When my salesman wants to create an order for company A, he just selects shop A and creates the order for that shop
    * When he wants to create an order for company B, he just selects shop B and creates the order for that shop.
    If he needs to order mixed products, than he “puts” the order for the shop C from the Company that sells all products.
    Does this work?
    The employees have access (Allowed Companies) to all companies. They have only one login. They belong to company C.
    Each company has its accounting, stocks, warehouses and so one.
    Does this work?
    I thank for your help on this.
    Regards
    Antonio

  7. Anonymous says:

    Hi Prajul,
    Your blog is interestig. I have tested the this and working fine. But when i tried to create 2 Main companies(No parent company associated with this company) and created users for those. But those users aere not able to create any records when logedin, I am getting an error message as
    “Access Denied
    The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
    (Document type: Partner, Operation: read)”
    can you help me to know why its happening so.

  8. dalai says:

    hello.. openerp hr manager can see not allowed company employers and contract. how to only access allowed company employers and contract ? help me

    1. Prajul P T says:

      Hi,

          I think the better option for your requirement will be to create a record rule.

      • For that please go to "Settings > Technical > Security > Record Rules".
      • Create a new record with name, Object as hr.employee, Rule definition as ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)], Groups as Human Resources / Manager. Check the fields Apply for Create, Read, Write and delete based on your requirement.
      • Save the record. When you log in again as the hr manager, he can view only the employees of his company.

      For Contracts you could use the same method except the Rule definition as ['|',('employee_id.company_id','child_of',[user.company_id.id]),('employee_id','=',False)]

       

      Hope this helps…

      1. dalai says:

        Thank you very much, Prajul. It was a great help and you help me

      2. Anonymous says:

        Hi,
        How can i manager view only his department employee HELP ME Prajul P T
        For example sales Manager M1 view only his emloyee emp1, emp2 and finance Manager M2 view only his employee emp3 emp4 PLEASE HELP?????

  9. Raj says:

    Hi,
    I have created Multiple companies. 1 parent company, 2 sub companies & under one sub company i have given 5 sub companies.
    now i need to assign chart of accounts to all the sub companies. for 5 sub companies. i have one chart of accounts template named ” my clients ” and for the 2 sub companies i have COA template named ” My sub companies “.
    now the problem i am facing is in the chart of accounts template i have same code for the masters in COA of both templates. its not allowing me to assign the COA for companies. can you please suggest any method how to resolve it.
    should the COA need to renumbered. or any changes has to be applied in the settings.

  10. ashokdhudla says:

    Access Denied
    The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
    (Document type: Location, Operation: read)
    i am getting this error when i enable pricelists for my multi-store set up of open erp

    1. Prajul P T says:

      Hi,

          Error is due to the user not having access to location. Please check if the user have access to location. In shops there is a warehouse as configuration. Please check if the location of the warehouse belong to the user company if you are using multi company.

  11. Anonymous says:

    Hello Sir, I’ve gone through your blog and it really helped me a lot in implementing openerp.I really thanks a lot to you and your in depth explanation about multi-companies wonderful blog. But now I have a requirement where I need to have different sale order and invoice numbering series.
    Eg: If Company A is the parent company and company B and C is its sub-company then If a sale order created by company B, then the Sale order series should be SO-B-001 and sale order created by company C, then the sale order series should be SO-C-001 can this be achieved by any type of configuration or what are the things we need to customize to make it possible

    1. Prajul P T says:

      Hi,

          There is no need of any python code level modification for this. You can configure this from OpenERP client itself. Go to Settings > Technical > Sequences and Identifiers > Sequences. Here you can see an entry named "Sales Order". If you open this record, you can see a field called "Company". You can set this field to the company for which you need to use this sequence for. Similarly you can create and assign sequences for each company based on the format you want.

  12. Anonymous says:

    Hello Sir:
    How to make multiple invoices on a sale order when it contains products from different companies?
    My configuration is: – Main Company has: sub company 1, sub company 2. These companies has many products. I wish make multiple invoices when I create a sale order if it contains products from different companies. For example: Sale order contains: – Product A: sub company 1. – Product B: sub company 2. This sale order should make two invoices but in one sale order. Help me, please, I’m new in OpenERP.

  13. Anonymous says:

    Dear Prajul,
    The exact same blog appears in Serpent Solutions website: http://www.serpentcs.com/serpentcs-multi-company-configuration-in-openerpv7
    I wonder who copied ?
    Mike

    1. Prajul P T says:

      Hi,

          Thank You for bringing this to our notice. The base OpenERP is common so the configuration such as multi company configuration as I explained in the blog will common. So concept in both the blogs may be the same. If you read the two blogs, you can see that the wording are also different. So you cannot say that one of us copied from other. If you have some other query about muticompany configuration, we will be happy to help….

      1. Steve Istvan Novak says:

        Yeah I am second to him. Someone just copied the other.

  14. Ram says:

    Dear Prajul,
    Thanks for sharing valuable information on Multi company concept with OpenERP.
    I have create One parent company and 2 child companies.
    Created a User and given access to both the child companies in the allowed companies field. And also only enable the sales module for the user as Manager.
    When i log in as the above user then i don’t Sales order belonging to both the companies. Only the sales orders of the company he is associated with are getting listed.
    Where is that am going wrong. Please help me.
    Cheers
    Ram

© 2020 Zesty Beanz Pvt Ltd All Rights Reserved.