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í
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Kov
    • Nábytek
    • Jídlo
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • IT hardware a podpora
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • 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 make the enter key work as tab key?

Odebírat

Get notified when there's activity on this post

This question has been flagged
webclientdevelopmentjquery
4 Odpovědi
33748 Zobrazení
Avatar
Andreas Tolstov

For example in view_list_editable.js:483 by Sale Order creation.

keyup_ENTER: function () {
        return this._next();
    },

Something like what does't worked for me:

$(':input').bind('keypress', function(event) {
    if(event.which === 13) {
        $(this).nextAll(':input').first().focus();
    }
});
6
Avatar
Zrušit
Avatar
Andreas Tolstov
Autor Nejlepší odpověď

I will answer my question myself. If your customer want to use ENTER button as a TAB button in product list of sale order, you must edit view_list_editable.js:483

keyup_ENTER: function () {
    return this._next();
},

and put where something like that:

keyup_ENTER: function (e) {
        var source_field = $(e.target).closest('[data-fieldname]').attr('data-fieldname');
        var fields_order = this.editor.form.fields_order;
        var field_index  = _(fields_order).indexOf(source_field);            
        var fields       = this.editor.form.fields;
        var field;
        do {
            if (++field_index >= fields_order.length) {
                e.preventDefault();
                return this._next();
            }
            field = fields[fields_order[field_index]];
        } while (!field.$el.is(':visible'));
        field.focus();
        return $.when();
    },

it's mainly from keydown_RIGHT func. because it has same logic. It's work's only for text fields. For text-area field you must handle stopPropagation() for ENTER key event in text-area fields in view_form.js

6
Avatar
Zrušit
Rishabh

this code is not working......please help..

Avatar
Med Said BARA
Nejlepší odpověď

https://www.odoo.com/forum/help-1/how-to-make-the-enter-key-work-as-tab-key-in-form-view-134811

0
Avatar
Zrušit
Avatar
Benjamin Ujvari-Cseh
Nejlepší odpověď

If you don't want to use the "Enter" key, you can use the "+" key from the numpad which is just above.

This is interesting because you keep the default behavior of "Enter" key as long as you don't have "+" character in your field. If you have it, you can use the other "+" key, which doesn't come with the same keycode.

The only problem is when you type with this key: it adds the character '+' on the field. But you can disable this with this code:

    keydown_NUMPAD_ADD: function (e) {
        e.preventDefault();
        return $.when();
    }

In order to have the same behavior of "Tab" key, just use @tolstoj code:

    keyup_NUMPAD_ADD: function (e) {
        var source_field = $(e.target).closest('[data-fieldname]').attr('data-fieldname');
        var fields_order = this.editor.form.fields_order;
        var field_index  = _(fields_order).indexOf(source_field);            
        var fields       = this.editor.form.fields;
        var field;
        do {
            if (++field_index >= fields_order.length) {
                e.preventDefault();
                return this._next();
            }
            field = fields[fields_order[field_index]];
        } while (!field.$el.is(':visible'));
        field.focus();
        return $.when();
    },

With this, if you switch name field with quantity field in sale orders lines in editable mode for example, behavior will be this:

  • Enter product code
  • Type "+" numpad key
  • Enter quantity
  • Type "Enter" numpad key
  • And so on...

It will be even better if you have set pricelist, because you just need to enter product's code and quantity and you can create a new record.

This stays in view_list_editable.js so you don't have to worry with other views behavior.

Best regards, Benjamin

0
Avatar
Zrušit
Avatar
Sody
Nejlepší odpověď

HI,

I would like to block ENTER only on open page, in grid where can user create new position.

How to do this ?

 

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
Importable Module Controller (Using XML Data Files)
webclient development debug
Avatar
0
dub 25
1360
web_editor add font size options in texts
webclient development configuration
Avatar
0
led 25
1795
How to make the enter key work as tab key in form view? Vyřešeno
webclient javascript jquery
Avatar
Avatar
2
čvn 18
9718
Can I create a link or url to a specific item or area of Odoo?
webclient development url
Avatar
Avatar
1
dub 15
8262
Show variant specific description on product site ecommerce Vyřešeno
webclient development portal ecommerce
Avatar
1
srp 25
2206
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