Reputation: 805
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
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:
Upvotes: 1