Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

ver.14: filter Many2one field with another Many2one field selected.

Odebírat

Get notified when there's activity on this post

This question has been flagged
many2onefilter_domainv14
1 Odpovědět
7319 Zobrazení
Avatar
SmithJohn45

hello all,

requirement: want to have same zone to select Rider the Customer is in. (both are in same table) --in below code, last line contains rider_id field, first condition is working fine--

it is showing error as below (searched here and google for "Invalid composed field" but no luck):

Invalid composed field user_id.zone_id in field rider_id default domain ([('category_id.name','ilike','rider'),('zone_id','=',user_id.zone_id)])

definitely i am doing wrong here, please help to correct it.

my model:

class Orders(models.Model):
    _name = 'tests.testsorders'
    _rec_name = 'name'
    _description = "Tests Orders"
    order_date = fields.Date(string="Order Date", required=True, default=datetime.today())
    name = fields.Char(string="Description")
    customer_id = fields.Many2one('res.partner', string="Customer",
                              domain="[['category_id.name','ilike','customer']]", 
                                required=True)
     status = fields.Selection([
        ('pending', 'Pending'),
        ('incomplete', 'InComplete'),
        ('complete', 'Complete')
    ], required=True, string="Order Status", default='pending')
    rider_id = fields.Many2one('res.partner', string="Rider",
                               domain="[('category_id.name','ilike','rider'),
                                ('zone_id','=',customer_id.zone_id)]", required=True)

regards

0
Avatar
Zrušit
Avatar
Karan BK
Nejlepší odpověď

I think you're getting this error because you're using zone_id which is the field in the customer_id which is in res.partner table not tests.testsorders.
Adding a onchange on customer_id will solve the issue.

@api.onchange("customer_id")
def _onchange_customer_id(self):
res = {
'domain': {
'rider_id': [('zone_id', '=', self.customer_id.zone_id.id)]
}
}
return res


I hope this works for you.

Karan BK

Junior Odoo Developer

Tel: +353 1 886 5684 (IE) +44 121 285 5684 (UK)  +91 964 381 7554 (IN)

Target Integration | CRM • ERP • Cloud

Website | LinkedIn | Twitter | Facebook | YouTube | Instagram

0
Avatar
Zrušit
SmithJohn45
Autor

thanks @Karan BK for help, but my domain filter contains 2 filters, first is ('category_id.name','ilike','rider') , can i use it as is with what you have mentioned or something to modify? i knew it is very very basic but i am from Oracle, python framework is very new for me, various things i still failed to understand.

SmithJohn45
Autor

also this change not worked as it is showing all entries from res.partner ( not from same Zone as Customer's )

SmithJohn45
Autor

sorry, it works... my fault spelling mistake :)

SmithJohn45
Autor

all done now... thanks again for your help :)

👈️ Rks

In odoo 14 ,domain on onchange is deprecated.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Hide some possible choices in a Many2one field
many2one v14
Avatar
Avatar
Avatar
2
dub 23
3591
Odoo 14: How i can set Domain filter on Many2one type field Vyřešeno
many2one v14
Avatar
Avatar
Avatar
2
úno 25
41916
hide many2one record when changing condition
many2one v14
Avatar
Avatar
Avatar
2
lis 22
3531
Odoo 14: set filter of Many2one field onchange of another Many2one field
many2one v14
Avatar
Avatar
1
úno 22
8516
Many2one field is not showing record name on Saving form Vyřešeno
many2one v14
Avatar
Avatar
2
pro 21
4952
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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