Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

fill in one2many field automatically when select many2many_tags

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
treeviewone2manylistviewodoo11odoo11community
1 Antworten
9746 Ansichten
Avatar
ai

I want to select configuration_template_ids which has also app_configuration_ids (configuration_template_ids. app_configuration_ids) and how can I pass all selected configuration_template_ids. app_configuration_ids into the field  <field name="app_configuration_ids" />

The list of app_configuration_ids should dynamically add all configuration_template_ids. app_configuration_ids or remove when deselect it.

<page string="App Configs"> 
        <field name="configuration_template_ids" string="Choose Template" widget="many2many_tags" options="{'no_create_edit': True}"  />

  <field name="app_configuration_ids" />

</page>



0
Avatar
Verwerfen
Avatar
Khalid Hazam
Beste Antwort

You need to define app_configuration_ids in your model as a computed field which will get the union of those configuration_template_ids. then you can display it in your view.

app_configuration_ids = fields.Many2many('<app_configuration_model>', compute='get_app_configurations')

@api.depends('configuration_template_ids')
@api.one
def get_app_configurations(self)
    self.app_configuration_ids = self.configuration_template_ids.mapped('app_configuration_ids')

0
Avatar
Verwerfen
ai
Autor

thanks for your answer.

Unfortunately it does not work.

app_configuration_ids is one2many.

If I use compute I cannot edit app_configuration_ids anymore.

Khalid Hazam

Then you just need to remove the compute parameter and change the decorator to @api.onchange.

Though I'm not sure you will declare it as a one2many field. many2many seems for me the better option.

ai
Autor

app_configuration_ids = fields.One2many('ia.app.property', inverse_name='product_id', string='App Configs')

app_configuration_template_ids = fields.One2many('ia.app.configuration.template', store=False)

@api.onchange('app_configuration_template_ids')

def get_app_configurations(self): self.app_configuration_ids=self.app_configuration_template_ids.app_property_ids

I have change to onchange, but the method get_app_configurations will not trigger. Do u know why?

Khalid Hazam

It probably does trigger but since you have a One2many field you need to use the special syntax to update it:

self.write({'app_configuration_ids': [(6, 0, self.app_configuration_template_ids.app_property_ids.ids)]})

There is also a neat solution where you can instead declare the product_id as a related field in your 'ia.app.property' model:

product_id = fields.Many2one('product.product', related='app_configuration_template_id.product_id', store=True)

I haven't tried it but I think it will also work

ai
Autor

the problem is that I don't want to store it. just have the ids -> store= False

Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
Sub header for tree view
views treeview one2many listview
Avatar
Avatar
1
Sept. 21
3748
How to change the list view color for dates in odoo ?
treeview listview odoo11 decoration
Avatar
Avatar
Avatar
Avatar
3
Apr. 21
6640
Odoo 11 Treeview Report
treeview odoo odoo11 odoo11community
Avatar
0
Juni 20
3487
STICK one2many tree view headers
javascript treeview one2many listview tree
Avatar
1
Feb. 24
1777
Odoo 11 One2many and many2many field understanding
one2many many2many OdooExperience odoo11 odoo11community
Avatar
Avatar
1
März 19
4354
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Ausbildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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