Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Why this html button breaks with "this.do_execute_action(...) is undefined"?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
javascriptbuttonsodoov11
2 Antwoorden
6174 Weergaven
Avatar
Daniele Morelli

Hello. I am using odoo 11.

I have this simple button in my view:

<button string="CLICK ME CMON" id="my_fancy_id"/>

Suppose there is no javascript to be executed when the user clicks on it. I just want a simple bare html button which does nothing when clicked.

When I click it, i get:

Errore:
TypeError: this.do_execute_action(...) is undefined

http://172.16.8.176:8069/web/content/1408-e155614/web.assets_backend.js:469
Traceback:
execute_action@http://172.16.8.176:8069/web/content/1408-e155614/web.assets_backend.js:469:620
proxy/<@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3923:8
trigger@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3921:166
_trigger_up@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3927:340
_trigger_up@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3927:442
trigger_up@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3927:275
_callButtonAction@http://172.16.8.176:8069/web/content/1408-e155614/web.assets_backend.js:1319:1689
saveAndExecuteAction/<@http://172.16.8.176:8069/web/content/1408-e155614/web.assets_backend.js:1421:648
then/</</<@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:802:678
fire@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:796:281
add@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:797:467
then/</<@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:802:631
each@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:625:758
then/<@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:802:553
Deferred@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:803:189
then@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:802:518
saveAndExecuteAction@http://172.16.8.176:8069/web/content/1408-e155614/web.assets_backend.js:1421:529
_onButtonClicked@http://172.16.8.176:8069/web/content/1408-e155614/web.assets_backend.js:1422:340
proxy/<@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3923:8
trigger@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3921:166
_trigger_up@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3927:340
_trigger_up@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3927:442
trigger_up@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:3927:275
_addOnClickAction/<@http://172.16.8.176:8069/web/content/1408-e155614/web.assets_backend.js:1381:329
dispatch@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:892:378
add/elemData.handle@http://172.16.8.176:8069/web/content/979-ae745c8/web.assets_common.js:865:151


i suppose odoo is looking for some action/listener/handler attached to the button, and as it does not find it, it throws the error.

I see two possible solutions: finding a way to tell Odoo to ignore the problem and stop looking for listeners/actions/etc, or defining a dummy one so to make him happy. A pure client-side solution would be perfect for my case (i.e. without having to define calls to server code and the like).

Thank you in advance for your help....!




0
Avatar
Annuleer
Avatar
Cyril Gaspard (GEM)
Beste antwoord

Hi,

button defines in a view with type attribute has 2 possible values, or use other attribute like special="cancel" ...  without

to use a type you have choice between object or action

object is to make reference to a python function, action to an action to define in xml, the name attribute is the name of the function or %(xml_id)d of action

for your case, use object and define a function in the model used for your view

in xml :

<button string="Save" name="button_save" type="object"/>


in python, in class model of your view:


    @api.multi

    def button_save(self):

        self.ensure_one()

        pass

Regards

0
Avatar
Annuleer
Avatar
Jainesh Shah(Aktiv Software)
Beste antwoord

Hello Deniele,

Every button in odoo backend is always bind with an action or method(object).

hence it odoo backend is giving you these because you haven't bind your button with action or method properly.

Thanks.

3
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
How to hide the edit and create buttons conditionally? Opgelost
buttons odoov11
Avatar
Avatar
Avatar
3
nov. 19
19316
Why odoo doesn't seem to load javascript files defined in odoo-js-demo code?
javascript odoov11
Avatar
0
okt. 18
4694
on_click event on custom button using JavaScript. Opgelost
javascript buttons odoo12
Avatar
1
aug. 22
14985
How to use RPC query in JavaScript with search method in Odoo 11 / 12?
javascript rpc odoov11
Avatar
Avatar
1
sep. 21
21449
How to completely override payEvent function
javascript override odoov11
Avatar
Avatar
2
apr. 19
4379
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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