vbt
vbt

Reputation: 805

Odoo Tab Index is not working for Wizard Buttons

I have one Print button in my Wizard.I can focus on other fields by using tab.But for the Print button it is not possible.I want to focus to Print button and when I click Enter , I need to press the button. I tried like this :

First Try

XML

        <group>
          <field name = "xn_barcode" />
          <field name = "price"/>
          <button name="generate" tabindex="1" type="object" string="Print"/>
        </group>
        <footer>
          <button name="generate" tabindex="1" type="object" string="Print"/>
        </footer>

My button name is generate I tried by using tabindex attribute. And I tried placing this button inside group and footer.

Second Try(Also mentioned for EasyOdoo's reply)

I refered a wizard in Account Invoice.(account.account_invoice_confirm_view) (Invoice Tree>Action>Confirm Draft Invoice) There it is working.What I find out while comparing is that, that wizard does not have any field in it.(Only <p> tag with some data found in that wizard) And I tried my wizard with no fields in it and it is working.But I want fields in my wizzard.What to do?I think its an odoo issue.

Odoo's Confirm Draft Invoices Wizard's Code

<form string="Confirm Draft Invoices">
     <p class="oe_grey">
      Once draft invoices are confirmed, you will not be able
      to modify them. The invoices will receive a unique
      number and journal items will be created in your chart
      of accounts.
      </p>
      <footer>
         <button string="Confirm Invoices" name="invoice_confirm" type="object" default_focus="1" class="btn-primary"/>
         <button string="Cancel" class="btn-default" special="cancel"/>
      </footer>
 </form>

Please Help me. Thanks in Advance.

Upvotes: 2

Views: 865

Answers (1)

Charif DZ
Charif DZ

Reputation: 14751

Try this:

<field name="arch" type="xml">
    <form>
        <sheet>
            <group>
              <field name = "xn_barcode" />
              <field name = "price"/>
            </group>
        </sheet>
        <footer>
           <button name="generate" type="object" string="Print"/>
           <button string="Cancel" class="btn-secondary" special="cancel"/>
        </footer>
    </form>
</field>

Result should look like this:

You should see a result looks like this

Upvotes: 1

Related Questions