Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

How do I create a message box/ dialog box in openerp 7 with 'Ok' and 'Cancel' buttons in it

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
python2.7openerp7
3 Besvarelser
6373 Visninger
Avatar
Openerp User

I was trying to create a message box/dialog box that pops up when an option is selected. The message box should allow the user select 'Ok' to proceed to a form and 'Cancel' to quit the process. I tried with tkMeassageBox but I kept getting this error 'No protocol specified TclError: couldn't connect display ":0"'.
So, I thought it might be that Tkinter doesn't work well with openerp. Is there a way to go about achieving this?

Thanks in advance

0
Avatar
Kassér
Sehrish

How to display confirmation display box / message box on button click.

Reference: https://goo.gl/6P7aR1

Avatar
Openerp User
Forfatter Bedste svar

@Med, but how do I incorporate the javascript in openerp?

I changed from workflow to object.

0
Avatar
Kassér
Med Said BARA

Tell us what you exactly want to do with this button.

Openerp User
Forfatter

I am working on the HR Leave Module(hr_holidays). Based on the requirements i am working with, when a user puts in a leave request, At the point of selecting a leave type e.g. 'Annual Leave', the system should do a check if the user has allocated leave days left. If user doesn't have any allocated days left, a pop-up should be displayed with a message informing the user to either apply for extra allocation or abort the process. If user clicks on 'Ok' it should redirect the user to the allocation request form but if the user clicks on 'cancel' it should exit the process of leave request. So thats why i need to put up a message box. Thanks

Med Said BARA

For the case of 'type=object', you need to add a button in your .xml file (this is easy to do), the second step is to write a function in python to handle the action needed when clicking this button (this is the hard part !).

Med Said BARA

I will extend my answer later.

Avatar
Med Said BARA
Bedste svar

Use Javascript rather than Python.

Google for:  JS confirm method ,  alertify.js , jquery-confirm ...

examples: https://www.jquery-az.com/javascript-confirm-alert-box-fancy-and-simple-with-5-online-demos/

                  https://www.bitdegree.org/learn/javascript-alert-box/


A good places where to start in openERP Web dev: https://media.readthedocs.org/pdf/openerp-web-v7/latest/openerp-web-v7.pdf

http://frederic.vanderessen.com/client-side-development-with-openerp/

http://openerpbay.blogspot.com/2013/02/javascript-css-and-jquery-in-openerp-70.html

https://www.odoo.yenthevg.com/tag/javascript/

(Answer modified after comment).

In OpenERP you can create 3 types of Buttons (related to the Button's type attribute):

1_ Type object

2_ Type workflow

3_ Type action

Read te following links

https://openerp-server.readthedocs.io/en/latest/03_module_dev_03.html#button

http://blog.odoobiz.com/2014/10/openerpodoo-call-function-on-button.html 

https://www.odoo.com/es_ES/forum/ayuda-1/question/add-button-to-form-view-85350


I think in your case you are dealing with the type="workflow".


To watch attentively:  Workflow add button                                       Customize workflows in Odoo

The best at last (but in French - an example for HR_Leave workflow modification):  http://laboiteatice.fr/ecotice/diapo/co/modifier_processus.html?mode=html


WARNING:

When customizing a workflow, be sure you do not modify an existing node or arrow, but rather add new nodes or arrows. If you absolutly need to modify a node or arrow, you can only change fields that are empty or set to the default value. If you don't do that, your customization will be overwrited at the next update or upgrade to a future version of OpenERP.

To be continued ...

 



 


0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Hide edit button according to status in openerp
python2.7 openerp7
Avatar
0
feb. 16
4476
How to get the sum of field in a column?
python2.7 openerp7
Avatar
0
aug. 15
6409
How to show two fields from the same table whith on change
python2.7 openerp7
Avatar
Avatar
1
mar. 15
1318
Currency by defaults Løst
python2.7 openerp7
Avatar
Avatar
Avatar
3
mar. 15
1106
How to fixed problem in import and export button?
python2.7 openerp7
Avatar
Avatar
1
mar. 15
5496
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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