Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

hide popup form default save/cancel buttons

By
zilvinas
on 11/8/16, 10:42 AM 134 views

Hi,

In v9 i was created popup form and added my custom Save and Cancel buttons, now in v10 that form shows both, my created Save  Cancel and default Save Cancel

.

how to hide default buttons? i have tried on .py file which calls form add:

'flags': {'form': {'action_buttons': False},}

but nothing changed.


my code:

return 
{
'name': _('Choose agreement type'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'sale.order',
'view_id': form.id,
'type': 'ir.actions.act_window',
'target': 'new',
'res_id': self.id,
'flags': {'form': {'action_buttons': False},}
}

form:

<record id="wizard_state_agreement" model="ir.ui.view">            
<field name="name">sale.order.wizard_state_agreement</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<form string="Please chose agreement type">
<sheet>
<group>
<field name="agreement_choose"/>
</group>
</sheet> <div>
<button name="change_state_agreement" string="Save" type="object" class="btn btn-primary"/>
<button special="cancel" string="Cancel" class="btn btn-default"/>
</div>
</form>
</field>
</record>





2

Hilar AK

--Hilar AK--
778
| 4 1 7
Italy
--Hilar AK--


Hilar AK
On 11/9/16, 1:09 AM

Try  to replace :

this is the code that add save and cancel buttons,

<footer> <button name="write" type="object" string="Save"/> or <button name="cancel" string="Cancel" special="cancel" class="oe_link"/> </footer>

so replace the footer using xpath

Hello, i have tried xpath, but it wont work. Worked for me only changing wizard view <footer>

<button name="change_state_agreement" string="Save" type="object" class="btn btn-primary"/>

<button special="cancel" string="Cancel" class="btn btn-default"/>

</footer>

zilvinas
on 11/9/16, 3:43 AM

you can replace the the footer then by <xpath expr="//footer" position = "replace"></xpath>

Hilar AK
on 11/9/16, 10:59 PM

also try the action by removing 'flags': {'form': {'action_buttons': False},}

Hilar AK
on 11/9/16, 11:01 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/8/16, 10:42 AM
Seen: 134 times
Last updated: 11/9/16, 1:09 AM