Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

How to enforce a pop up window?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
form
3 Odpowiedzi
10699 Widoki
Awatar
Gavin Yap

Hi All,

I've created a pop up form and wishes to enforce user to fill in the details without them to close it until it is completed.

An example use case is like a EULA agreement, they have to agree before continuing into the application.

Is there a way to do that?



0
Awatar
Odrzuć
Awatar
Gavin Yap
Autor Najlepsza odpowiedź

My solution to my problem is to create a menu "eula" with sequence 0, that would trigger a server action.  Whenever a user logins, it will go to the first item of the menu item.  Thus by doing this, it will alway trigger the eula form I intend to display

<menuitem id="main_eula_menu"
name="EULA"
sequence="0"
action="ir_actions_server_eula_trigger"
/>

the menu would then trigger the server action below upon login.

<record id="ir_actions_server_eula_trigger" model="ir.actions.server">
<field name="sequence" eval="5"/>
<field name="state">code</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="model_eula_eula"/>
<field name="code">action = self.trigger(cr, uid, None, context)</field>
<field name="condition">True</field>
<field name="name">EULA Agreement</field>
</record>

the form below is used to allow user's to agree or disagree the eula.

<record id="view_form_eula" model="ir.ui.view">
<field name="name">view_form_eula</field>
<field name="model">eula.eula</field>
<field name="arch" type="xml">
<form>
<div>
<field name="content"/>
</div>
<footer>
<a href="/eula/agree" class="oe_button">I agree</a>
<a href="/web/session/logout?redirect=/web" class="oe_button oe_highlight">I disagree</a>
</footer>
</form>
</field>
</record>


the Eula model  which has a trigger method to be called by the server action

class Eula(models.Model):
_name = 'eula.eula'
name = fields.Char()
content = fields.Html(readonly=True)
agree = fields.Boolean(string="Agree", help="By checking this, you agree to the EULA.", default=False)
@api.multi
def trigger(self):
_logger.info("Enter Eula Trigger")
return {
'name': 'EULA Agreement',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'eula.eula',
'res_id': 1,
'type': 'ir.actions.act_window',
'target': 'new'
}

Finally a special route and controller to remove the eula menu if accepted.

class Eula(http.Controller):
@http.route('/eula/agree/', auth='user')
def index(self, **kw):
_logger.info(self);
model_datas = http.request.env['ir.model.data'].search([('module', '=', 'eula'), ('model', '=', 'ir.ui.menu')])
for model_data in model_datas:
model_name = model_data.model
model_id = model_data.res_id
model = http.request.env[model_name].search([('id', '=', model_id)])
model.sudo().unlink()
model_data.sudo().unlink()
eula = http.request.env['eula.eula'].search([('id', '=', 1)])
eula.agree = True
return werkzeug.utils.redirect("/")




0
Awatar
Odrzuć
Awatar
Tarek Mohamed Ibrahim
Najlepsza odpowiedź

Try to get this button using xpath expression from the fields_view_get of the wizard class.

Then via a loop set its invisible property to true 

check the code posted in the following two links, it would help expressing my idea

https://www.odoo.com/nl_NL/forum/help-1/question/i-unable-to-change-the-readonly-proprety-of-a-button-from-within-fields-view-get-method-89309 

https://www.odoo.com/nl_NL/forum/help-1/question/i-unable-to-change-the-properties-of-some-fields-from-within-fields-view-get-method-89215 

0
Awatar
Odrzuć
Gavin Yap
Autor

I investigate, it seems that the fields_view_get does not attribute to disable closing of the pop up form

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Can i create multiple forms for a single model using studio ? Rozwiązane
form
Awatar
Awatar
2
wrz 25
1184
How to make Odoo form readonly when the record has an specific state?
form
Awatar
0
sty 21
3202
How to add Fields in Form Rozwiązane
form
Awatar
Awatar
Awatar
5
lip 19
5639
Files
form
Awatar
Awatar
1
maj 16
4549
how to detect that the form is being opened Rozwiązane
form
Awatar
Awatar
2
cze 15
9326
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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