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

the meaning of company_ids?

Subscribe

Get notified when there's activity on this post

This question has been flagged
createusercompany_ids
1 Reply
8527 Views
Avatar
Zouhair

hi,

any can help to understand the field values['company_ids'] in res_users, it is used to create a new user.

im trying to create a new company with her user, i give an error:

You can not change the company as the partner/user has multiple user linked with different companies.
Traceback (most recent call last):
  File "C:\OpenERP-7.0\Server\server\.\openerp\netsvc.py", line 296, in dispatch_rpc
  File "C:\OpenERP-7.0\Server\server\.\openerp\service\web_services.py", line 626, in dispatch
  File "C:\OpenERP-7.0\Server\server\.\openerp\osv\osv.py", line 190, in execute_kw
  File "C:\OpenERP-7.0\Server\server\.\openerp\osv\osv.py", line 132, in wrapper
  File "C:\OpenERP-7.0\Server\server\.\openerp\osv\osv.py", line 199, in execute
  File "C:\OpenERP-7.0\Server\server\.\openerp\osv\osv.py", line 187, in execute_cr
  File "C:\OpenERP-7.0\Server\server\openerp\addons\game\res_player.py", line 44, in create_player
  File "C:\OpenERP-7.0\Server\server\openerp\addons\auth_signup\res_users.py", line 281, in create
  File "C:\OpenERP-7.0\Server\server\openerp\addons\mail\res_users.py", line 77, in create
  File "C:\OpenERP-7.0\Server\server\openerp\addons\base\res\res_users.py", line 804, in create
  File "C:\OpenERP-7.0\Server\server\openerp\addons\base\res\res_users.py", line 634, in create
  File "C:\OpenERP-7.0\Server\server\openerp\addons\base\res\res_users.py", line 311, in create
  File "C:\OpenERP-7.0\Server\server\.\openerp\osv\orm.py", line 377, in function_proxy
  File "C:\OpenERP-7.0\Server\server\openerp\addons\base\res\res_partner.py", line 506, in write
except_osv: (u'Aviso', u'You can not change the company as the partner/user has multiple user linked with different companies.')

my function on python:

def create_player(self, cr, uid, vals, context = None):
  """
    the vals data:
        login
        password
        active
        company_ids
        partner_id
        share
        warehouse_id
  """
  vals['company_ids'] = [[6, False, [vals['company_id']]]]<--------- Problem
  vals['name'] = vals['login']
  id = self.pool.get('res.users').create(cr, uid, vals, context=context)
  self._set_stock_responsable(cr, uid, id, context = None)
  return id

the value of values['company_ids'] is some thing like that [[6,False,[45]]].

thx.

0
Avatar
Discard
Avatar
Deepa Venkatesh
Best Answer

Company_ids is nothing but Allowed Companies.... A users' company which you are trying to map must be present in those allowed companies...
 

0
Avatar
Discard
Zouhair
Author

but now i cant create new users allowed only for my new company, any idea to solve that

OdooBot

Am not getting.... are u trying to create user in admin login ? ....
If so first U have to set company in allowed companies... later u can set same for company field....



From: Zouhair <relawda@hotmail.com>;
To: deep <deepa4lok@yahoo.com>;
Subject: Re: False
Sent: Thu, Sep 11, 2014 3:06:02 PM

but now i cant create new users allowed only for my new company, any idea to solve that

--
Zouhair
Sent by OpenERP S.A. using Odoo about Forum Post False
Zouhair
Author

yes, how i can set company in allowed companies?

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
how to create user by restful api Solved
code create user
Avatar
Avatar
1
Dec 22
6834
Can't create users in odoo 8.0 Solved
create user impossible
Avatar
Avatar
Avatar
Avatar
3
Feb 24
12149
Best Practices for creating Users and Employees without creating duplicate Contacts? Solved
create user employee duplicate
Avatar
Avatar
Avatar
Avatar
3
Dec 24
9342
How to Manually Create Users for Odoo 17 Community Edition Solved
community create user odoo
Avatar
Avatar
1
Aug 24
3325
odoo 15 Échec de rendu modèle QWeb :not all arguments converted during string formatting Traceback (most recent call last): Solved
create user render_template traduction
Avatar
Avatar
Avatar
Avatar
4
Jun 23
4118
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