Odoo Help


2 Answers

Cybrosys Techno Solutions Pvt.Ltd Hindistan

--Cybrosys Techno Solutions Pvt.Ltd--
Cybrosys Techno Solutions Pvt.Ltd
| 7 6 10
Calicut, Hindistan
--Cybrosys Techno Solutions Pvt.Ltd--

Cybrosys Technologies is a private limited ISO certified company in Technology and Software Engineering sector. We serve as one of the best and trusted Odoo official partner, providing ultimate Customization and Implementation services in Odoo ERP. A frequent contributor to Odoo Apps, our customized free apps are downloaded by more than one lakh users. Most of our apps augment the potentialities of Odoo and are trending in the Odoo app store.

Cybrosys keeps privilege to be one among the finest Odoo Official Partners with 200+ free apps contribution towards the Odoo community. Cybrosys also stands number one in Odoo-social Media Integration empowering every kind of business solutions.

We are also enriched with highly skilled UI/UX technical experts for Developing, Implementing and Designing, thereby providing ultimate benefit to our customer base.

Today Cybrosys has reached par excellent in Odoo Implementation and allied services, proving its credibility and reliability. Our proven services are used by customers sprawling across 160+ countries including Middle East, African continents, UK, Germany, Spain, Thailand, Hong Kong, New Zealand, Australia, Malaysia, Singapore, Egypt etc.

We are rapidly expanding our base with robust quality management and business process re-engineering to meet the ultimate customer desire.

To know more about Cybrosys Technologies and our Odoo Apps, Kindly visit:

Cybrosys Technologies 

Odoo Apps 

And inbox us your queries to odoo@cybrosys.com

Cybrosys Techno Solutions Pvt.Ltd Hindistan
29.01.2019 02:19


You can just add a boolean field in the form and update the boolean field value to True once the button is clicked. You can make the boolean field to True, once you clicked the button from the corresponding function that button calls.

Then Based on this Boolean field you can hide the button using attributes.

In the Python:

check = fields.Boolean("Check")

def set_button(self):
for rec in self:
rec.check = True
# rest of the code


<button name="set_button" type="object" icon="fa-globe" 
attrs="{'invisible': [('check', '=', True)}"/>



Yenthe Van Ginneken Belçika

--Yenthe Van Ginneken--
| 10 9 12
Turnhout, Belçika
--Yenthe Van Ginneken--

Yenthe Van Ginneken Belçika
29.01.2019 02:23

Hi Tom,

You can create an extra field on your model (a boolean) to check if the button has been clicked before or not. Depending on the boolean field you can show or hide the button then. Example Python:

class YourModel(models.Model):
    _name = 'your.model'
button_clicked = fields.Boolean(string='Button clicked')
@api.multi def your_button_action(self):
# This goes off when clicking your button - do your logic here.
self.button_clicked = True

Your XML:

<?xml version="1.0" encoding="utf-8"?>
        <record id='product_section_view_form' model='ir.ui.view'>
            <field name="name">product.section.form</field>
            <field name="model">product.section</field>
            <field name="arch" type="xml">
                <form string="Product section">
                    <!-- You can for example hide the button once it is clicked like this:
                    attrs="{'invisible': [('button_clicked', '=', True)]}" 
<button name="your_button_action" string="Click here" type="object"/> </header> <sheet> <field name="button_clicked" invisible="1"/> </sheet> </form> </field> </record> </data> </odoo>

You can then check on this boolean its state in any function to see if it has been clicked or not before.


1 Comment
Mian Kamran Pakistan
30.01.2019 00:22
Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform 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.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now