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í
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • 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
    • Services for Partners
    • 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

How to display a pivot view after a form view depending of a field ?

Odebírat

Get notified when there's activity on this post

This question has been flagged
fieldbuttonformviewpivot
2 Odpovědi
12981 Zobrazení
Avatar
MIADI

Hello,

In a personal module, I want to do something special.

When I click on the menuitem, I want to show a form view where I have one field. This field is a many2one field.

When I select a value for this field, I want to click on a button (not the create button, so I don't want to create a record) and after the click, I want to show a pivot view depending of the value of the field selected.


There are my codes :

class miadi_tarifs(models.Model):
    _name = 'miadi.tarifs'
    
    code = fields.Char(string='Code', default='', required=True)
    libelle = fields.Char(string='Libellé', default='', required=True)
class miadi_lignesTarifs(models.Model):
    _name = 'miadi.lignestarifs'
    
    code_tarif = fields.Many2one('miadi.tarifs', 'Price Code', default='', required=True, ondelete='cascade')
    produit_id = fields.Many2one('product.product', 'Product', required=True, ondelete='cascade')
    conditionnement_id = fields.Many2one('miadi.packaging', 'Packaging', required=True, ondelete='cascade')
    prix_unitaire = fields.Float('Unit Price', default=0)

Actually, in the pivot view return by a function, I have in first column the "code_tarif", in second column the "produit_id", in row the "conditionnement_id" and that is display for the cases is the "prix_unitaire". What I want is to display the pivot view with only the "produit_id" in column depending the "code_tarif" value selected in the previous for view.

I hope you will understand me and you will be able to help me.

I'm on Odoo 10

Thanks

0
Avatar
Zrušit
Avatar
MIADI
Autor Nejlepší odpověď

Hi Mohammed,

I tried your code and it works.

Thank you very much

0
Avatar
Zrušit
Avatar
Mohammed Amal N
Nejlepší odpověď

Hi,

I hope what you want is a wizard before you want to open pivot view.

You can use a transient model if you don't want to save the record(it is used in case of wizards).

class WizardModel(models.TransientModel):
_name = 'wizard.model.name'

your_many2one= fields.Many2one('ref.model')

    @api.multi
    def open_pivot_view(self):
        print self.your_many2one
      return {
      'type': 'ir.actions.act_window',
    'name': 'Name of view',
    'res_model': 'model.tobe.opened',
    'domain': [],
      'view_mode': 'pivot',
      'context': {}
    }

then action for your menu from which this wizard needs to be called should be:

<act_window id="launch_the_wizard"
            name="Launch the Wizard"
            src_model="context.model.name"
            res_model="wizard.model.name"
            view_mode="form"
            target="new"
            key2="client_action_multi"/>

then define a normal form view for your wizard(wizard.model.name) with a button name=open_pivot_view

You can give domain and context according to your many2one field

0
Avatar
Zrušit
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
Non-dict expression Vyřešeno
button formview
Avatar
Avatar
2
čvc 22
3615
Process a file using JS on client
javascript button formview
Avatar
0
bře 24
1872
Show a button in form view, when in view mode, and hide in edit mode Vyřešeno
hide button formview
Avatar
Avatar
Avatar
Avatar
3
led 24
15233
How to display form or tree view with some fields when click is made on button?
treeview button formview
Avatar
Avatar
2
bře 15
7967
Create new record by opening a new form on a button click Vyřešeno
form button formview odoo12
Avatar
Avatar
Avatar
2
čvc 23
784
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