Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

hide popup form default save/cancel buttons

Subscribe

Get notified when there's activity on this post

This question has been flagged
popupwindowodoo10
3 Replies
18622 Views
Avatar
zilvinas

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>





0
Avatar
Discard
Avatar
Yatrik Chauhan
Best Answer

Hi FarmingWolf,

Please include the following code in your wizard's form view to replace Odoo's default footer with your custom one.

<footer>

​<button name="<your custom method>" string="Save" type="object" class="btn btn-primary"/>

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

</footer>

Thanks

0
Avatar
Discard
Avatar
Hilar Andikkadavath
Best Answer

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

4
Avatar
Discard
zilvinas
Author

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>

Hilar Andikkadavath

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

Hilar Andikkadavath

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

Avatar
FarmingWolf
Best Answer

Hello, zilvinas,

I have a similar problem. I added my own button, and I want to hide the default button.

Have you resolved that problem?

0
Avatar
Discard
Yatrik Chauhan

Hi FarmingWolf,

Please include the following code in your wizard's form view to replace Odoo's default footer with your custom one.

<footer>

​<button name="<your custom method>" string="Save" type="object" class="btn btn-primary"/>

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

</footer>

Thanks

FarmingWolf

Hi Yatrik Chauhan,
Thank you for your reply!
This is my popup window source code, would you please indicate where the footer code should be added, or maybe in other source file? Thanks a lot!
<?xml version="1.0" encoding="utf-8"?>

<templates xml:space="preserve">

<t t-name="estate_lease_contract.ContractTerminateAction">
<div class="ms-1 mt-1">
<div class="align-self-center" style="display: flex; justify-content: center;">
<div>
<span>Data record will be terminated and archived!</span><br/>
</div>
</div>
<div class="align-self-center" style="display: flex; justify-content: center;">
<div class="col-sm-5 mt16" style="display: flex; justify-content: center;">
<button class="btn btn-primary mb16" t-on-click="() => this.onClickTerminateContract()" t-att-disabled="this.confirm_button_disable()">
<div class="mb16 mt16"> Terminate </div>
</button>
</div>
</div>
</div>
</t>
</templates>

※I have tried the followings:
1. adding the footer code in the <t> mark , and the default footer and button are still there.
2. adding the footer code out of the <t> mark, page error comes up:Failed to load resource: the server responded with a status of 404 (NOT FOUND)
3.adding the footer code in the popup's parent form view , and nothing changed...

Yatrik Chauhan

Hello FamingWolf,
Can you please try to change this code.

<?xml version="1.0" encoding="utf-8"?>

<templates xml:space="preserve">

<t t-name="estate_lease_contract.ContractTerminateAction">
<div class="ms-1 mt-1">
<div class="align-self-center" style="display: flex; justify-content: center;">
<div>
<span>Data record will be terminated and archived!</span><br/>
</div>
</div>
<div class="align-self-center" style="display: flex; justify-content: center;">
<div class="col-sm-5 mt16" style="display: flex; justify-content: center;">
</div>
</div>
</div>
<button class="btn btn-primary mb16" t-on-click="() => this.onClickTerminateContract()" t-att-disabled="this.confirm_button_disable()">
<div class="mb16 mt16"> Terminate </div>
</button>
</t>
</templates>

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
How to show a "popup" window on record creation like the chat window? Solved
chat popupwindow odoo10
Avatar
Avatar
5
Sep 19
9042
Create schedule action For sending emails
odoo10
Avatar
Avatar
Avatar
2
Jul 25
6438
How to send messages that are not shown in chatter? Solved
odoo10
Avatar
Avatar
Avatar
2
Oct 25
8788
How to ORDER BY? [Odoo 10] Solved
odoo10
Avatar
Avatar
2
Nov 24
29687
Dynamic domain functionality - possible to change domain of a field in another model with onchange? (Odoo 10) Solved
odoo10
Avatar
Avatar
Avatar
2
May 24
8385
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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