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

[v14] I edited a button and now I'm getting a strange Warning while Odoo is loading...

Subscribe

Get notified when there's activity on this post

This question has been flagged
buttonsimili
3 Replies
4783 Views
Avatar
Hugo

Hi,

 

On Vendors form view (res.partner) there are buttons showing:

 "# Quotations"    "# Supplier Bill"    "# Purchases"   etc


 I want those buttons to be visible only to admins

 

My code works fine but I'm getting a WARNING on odoo.log:

WARNING database odoo.addons.base.models.ir_ui_view: A simili button must be in tag a/button/select or tag `input` with type button/submit/reset or have class in btn-group/btn-toolbar/btn-ship


What is causing this simili button warning? Is there a fix for it?

 

My code:

≤record id="edit_edited_res_partner_buttons_named_purchased" model="ir.ui.view"≥
    ≤field name="name"≥edit.partner.buttom.purchased≤/field≥
    ≤field name="model"≥res.partner≤/field≥
    ≤field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/≥
    ≤field name="arch" type="xml"≥
        ≤xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes"≥
            ≤attribute name="groups"≥__import__.group_menu_admin≤/attribute≥
        ≤/xpath≥
    ≤/field≥
≤/record≥

 

Thanks in advance

0
Avatar
Discard
Avatar
Malay Khamar (Serpent Consulting Services Pvt. Ltd.)
Best Answer

Hi Hugo,


EDIT:

The issue raised from your

tag class 'btn-secondary'. If you remove the class or replace it with any class from the ('btn-group', 'btn-toolbar', 'btn-ship'), then it will not raise any error


if you are using any class which is starts with 'btn', then system must check the validations on it. you must follow some rules to define it.


1) It (class) must be in tag  ≤a≥,  ≤button≥,  ≤select≥
2) OR If its in input tag ≤input≥,  then type must be in ('button', 'submit', 'reset')
3) if it will not follow above two , then the tag must have only these classes ('btn-group', 'btn-toolbar', 'btn-ship') in it . Not the 'btn-secondary'.

 
tag class , If you remove the class or replace it with any class from the ('btn-group', 'btn-toolbar', 'btn-ship'), then it will not raise any error.

Hope it will help you.
Please vote the answer.

1
Avatar
Discard
Hugo
Author

I did not work...

I've tested your code and the warning persists
I've also tested replacing "groups" attribute with "invisible" attribute and I still get the warning messa

My code:
≤record id="edit_edited_res_partner_buttons_named_purchased" model="ir.ui.view"≥
___≤field name="name"≥edit.partner.buttom.purchased≤/field≥
___≤field name="model"≥res.partner≤/field≥
___≤field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/≥
___≤field name="arch" type="xml"≥
______≤xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes"≥
_________≤attribute name="invisible"≥1≤/attribute≥
______≤/xpath≥
___≤/field≥
≤/record≥

Malay Khamar (Serpent Consulting Services Pvt. Ltd.)

Hi Hugo
Please check the updated answer

Muhammad Ihza Putra Handayani

<button class="transparent-button" name="contact_wizard" type="object" string="Business directory" invisible="parent_id or last_satisfaction in [1 , 2 , 3 , 4 , 5]">
<img src="/certification_app/static/src/img/Satisfaction client défaut.png" style="width:80px"/>
</button>

please help me im encountered the same error too, above is an example code of one of my error
i have tried add the btn-group in class but still the same i also try add alt but the result is still the same

Avatar
Muhammad Bilal
Best Answer

I thinks it's raise due to attribute that you have added give the external_xml id in groups attribute


0
Avatar
Discard
Hugo
Author

It did not work...

I tested by replacing "groups" attribute with "invisible" attribute and I still get the warning messa

My code:
≤record id="edit_edited_res_partner_buttons_named_purchased" model="ir.ui.view"≥
___≤field name="name"≥edit.partner.buttom.purchased≤/field≥
___≤field name="model"≥res.partner≤/field≥
___≤field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/≥
___≤field name="arch" type="xml"≥
______≤xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes"≥
_________≤attribute name="invisible"≥1≤/attribute≥
______≤/xpath≥
___≤/field≥
≤/record≥

Avatar
Hugo
Author Best Answer

EDIT: I may have found the source of the problem, but I still don't know how to solve it

It seems that the error started when I created a particular button inside res.partner's kanban:

- If I remove this button's code ALL of the "simili button" warning disapear


The code:

≤record id="edit_res_partner_form" model="ir.ui.view"≥
≤field
name="name"≥edit.partner.form≤/field≥
≤field
name="model"≥res.partner≤/field≥
≤field
name="inherit_id" ref="base.view_partner_form" /≥
≤field
name="arch" type="xml"≥
    ≤xpath
expr="//t[@t-name='kanban-box']" position="replace"≥
        ≤t
t-name="kanban-box"≥
            ≤div
t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'"≥
                ≤div
class="o_kanban_image"≥
                    ≤a
role="button" type="object" class="btn-group" string="Called"≥
                        ≤div
class="btn-secondary"≥
                            ≤span≥Cliente called
≤/span≥
                        ≤/div≥
                    ≤/a≥
                ≤/div≥
            ≤/div≥
        ≤/t≥
    ≤/xpath≥
≤/field≥
≤/record≥


0
Avatar
Discard
Hugo
Author

Found the problem!

It seems that using ≤div class="btn-secondary"≥ caused the "simili button warning" not only for the button itself, but for every button created by that particular module. Must be a rare minor bug.

My fixed code:

≤a role="button" type="object" class="btn-group btn-secondary" string="Liguei"≥
Liguei
≤/a≥

Malay Khamar (Serpent Consulting Services Pvt. Ltd.)

Hi Hugo,

The issue raised from your <div> tag class 'btn-secondary'. If you remove the class or replace it with any class from the ('btn-group', 'btn-toolbar', 'btn-ship'), then it will not raise any error

if you are using any class which is starts with 'btn', then system must check the validations on it. you must follow some rules to define it.

1) It (class) must be in tag <a>, <button>, <select>
2) OR If its in input tag <input>, then type must be in ('button', 'submit', 'reset')
3) if it will not follow above two , then the tag must have only these classes ('btn-group', 'btn-toolbar', 'btn-ship') in it . Not the 'btn-secondary'.

The issue raised from your <div> tag class , If you remove the class or replace it with any class from the ('btn-group', 'btn-toolbar', 'btn-ship'), then it will not raise any error.

Hope it will help you.
Please vote the answer.

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
Opening new window with button in OpenERP Solved
button
Avatar
Avatar
1
Jan 24
15315
button in systray
button
Avatar
Avatar
2
Mar 18
5940
how can i restict auto data saving while clicking on custom button in odoo10?
button
Avatar
0
Jan 18
4210
Modify / override button action in header of form ?
button
Avatar
Avatar
2
Feb 24
27075
Send eMail template through code
button
Avatar
3
Feb 25
57929
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