Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

How to add an option to the "action" drop-down menu in tree view?

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
actiontree_viewodoov11
1 Atsakyti
27637 Rodiniai
Portretas
Daniele Morelli

I am using Odoo v.11 EE.

I'm following the "create a module" tutorial on the official docs (https://www.odoo.com/documentation/11.0/howtos/backend.html), so I made a 'course' module and a 'session' module etc, with no great issues.

If i go to the tree view for courses, and check some entries, an "Action" menu appears with a number of options (in this case, "Export" and "Delete"). I'd like to add a new option and bind it to some backend logic to be executed on the selected elements.

I found some hints online (e.g: https://stackoverflow.com/questions/36285497/how-to-add-entry-to-more-menu-or-top-menu-to-add-action-on-multiple-selections), but it doesn't seem to be working on odoo11.

Is there a standard way to accomplish that?

EDIT:

For now I managed to insert a button like the following

<button name="mymethod" string="My Method" type="object" class="oe_highlight"/> 

and I binded it to a simple @api.multi method in the model:

    @api.multi
def mymethod(self):
print("TEST")
return True

This works (i.e. when the button is clicked i see the "TEST" string in the console), but still I need to understand how to bind the method to an option in the "Action" drop-down (not to a button).

I managed to do a window action linked to an option in the "Action" drop-down (If i'm not wrong this is accomplished by setting the key2 field as "client_action_multi"), but what I need is a server action, so, by analogy, I tried to define it as follows:

<record model="ir.actions.server" id="act_new_sub_menu_lol">
<field name="name">CANT MAKE THIS WORK</field>
<field name="model_id" ref="model_openacademy_course"></field>
<field name="src_model">openacademy.course</field>
<field name="key2">client_action_multi</field>
<field name="view_mode">tree</field>
<field name="target">new</field>
<field name="view_type">tree</field>
</record>

But no option appears in the drop-down.


Thank you in advance for any help.

0
Portretas
Atmesti
Niyas Raphy (Walnut Software Solutions)

See this: https://www.youtube.com/watch?v=yGKYPtAeP7k

Portretas
subbarao
Best Answer

<act_window id="action_set_invoice_done"

            name="Your menu name"

            src_model="menu will display on this model"

            res_model="wizard model"

            view_type="form" view_mode="form"

            key2="client_action_multi" target="new"

/>


Example: Under Invoice tree i added set done menu

<act_window id="action_set_invoice_done"

            name="Set Done"

            src_model="account.invoice"

            res_model="set.invoice.done"

            view_type="form" view_mode="form"

            key2="client_action_multi" target="new"

            groups="account.group_account_manager"/>

1
Portretas
Atmesti
Daniele Morelli
Autorius

Thank you for your answer! I guess, then, that i have to make a wizard/popup appear when the option is clicked? I was looking for a way to directly call a server-side method, but I think I can cope with that anyway. Thank you again.

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

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

Registracija
Related Posts Replies Rodiniai Veikla
Button to open form. V11 Solved
action buttons odoov11
Portretas
Portretas
2
kov. 19
3800
How to add an header section in a tree view? Solved
header tree_view odoov11
Portretas
Portretas
1
spal. 18
8873
How to let a dopdown option appear only in tree-view or only in form-view? Solved
action views drop_down odoov11
Portretas
Portretas
1
gruod. 22
5816
Need Advice For Migrate Thousands of Messy SKUs
action
Portretas
0
lapkr. 25
8
Pickup Date for E-Commerce Solved
action
Portretas
Portretas
Portretas
2
lapkr. 25
150
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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