Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Discuss
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

How to bypass company dependent field in M2O Selection

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
multicompanycompany_idcompanydependent
4 Replies
6234 Tampilan
Avatar
Aadeel S. Puri

Hello Dear Odoers,

I need some help I have created a related field in my model 

location_dest_id = fields.Many2one('stock.location', string='To', domain="[('usage', '=', 'internal')]", required=True)

Currently it shows stock locations from the company assigned to a user, I want to show all records in stock location for user selection.

Please help.

0
Avatar
Buang
Avatar
Aadeel S. Puri
Penulis Jawaban Terbai

I have found a solution by changing the field from many2one to selection and computing selection records. with that, I can able to select stock location from other companies as well.

def _location_selection(self):
domain = [('usage', '=', 'internal')]
locations = self.env['stock.location'].sudo().search(domain)
return list(map(lambda location: (str(location.id), ', '.join([location.complete_name, location.company_id.name])), locations))
location_dest_id = fields.Selection(
selection=lambda self: self._location_selection(),
string="To",
help="Destination Stock Location.",
required=True
)


0
Avatar
Buang
Avatar
Adil Akbar
Jawaban Terbai

Hi, 

You can see following for this, it has complete explanation for company_dependent fields alongwith access restriction and python code:

https://youtu.be/GkNgc-fZO-I

Hope it helps,

Thanks

0
Avatar
Buang
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Jawaban Terbai

Hi,

Add "check_company=False" in your code

location_dest_id = fields.Many2one('stock.location', string='To', domain="[('usage', '=', 'internal')]", required=True, check_company=False)

Regards

0
Avatar
Buang
Aadeel S. Puri
Penulis

Hi,
Thanks for your response, I have added check_company=False no difference. user has to select both companies in order to get locations.
I want user to select location from B Company regardless of allowed company to the user.
I am using 13 CE.

Avatar
jjjaberi0n
Jawaban Terbai

Hi, im trying understand your code. Can you tell me what is the purpose of the model that has field 'location_dest_id'?

That model has many-to-one relationship with model 'stock.location', right? So how does this relationship help with your object that is showing all records in stock location?

0
Avatar
Buang
Aadeel S. Puri
Penulis

Thanks for your response.
I have built inter warehouse stock transfer module. Which is working flawlessly, but there is a problem. In my case we are working with a multi-company environment.

Suppose
User A assigned to -> Company A
User B assigned to -> Company B
User C assigned to -> Company C

Stock.Location
WH/Stock1 | Company A
WH/Stock2 | Company B
WH/Stock3 | Company C

Now User A has logged in and open the form which contains mainy2one stock.location field
He can able to see in many2one selection WH/Stock1, Until unless I give him all the companies access, and he selects all companies he won't be able to see other locations.

I want him to able to see all locations in that particular many2one field all the available locations regardless of companies he is assigned.

Currently Odoo has a very ridiculous approach in terms of inter companies stock transfer, It didn't have branch management so we are using companies as branches. I have built this module inspired by the Microsoft Dynamics RMS stock transfer mechanism, which is way more easier to work, less prone to user mistakes, and highly flexible on reporting.

Hope you understand my pain :(

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
How to get current company in xml?
xml company_id companydependent
Avatar
Avatar
5
Jun 20
6554
Domain for sale.order.line to show only products that belongs to selected company_id Diselesaikan
sale.order.line sale.order.form multicompany company_id
Avatar
Avatar
1
Mar 16
13306
Clarification on Creating Companies and Users in the Odoo Database
multicompany
Avatar
Avatar
Avatar
2
Jul 25
3023
Multi Company set up
multicompany
Avatar
Avatar
Avatar
3
Jul 25
3519
How many levels of sub-entities does the multicompany functionality of the accounting software support? Diselesaikan
multicompany
Avatar
Avatar
1
Jul 25
2610
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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