Hello, I want to add a textbox on the button click in my odoo v15 form view any anyone has any idea how can I achieve this?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
HI,
First we need add following fields in your python file:
text_active = fields.Boolean()
description = fields.Text(string='description')
then need to add these field in the xml file, make the visibility of Text field is based on Boolean field and make Boolean field in invisible :
<field name="text_active" invisible ="1"/>
<field name="description" attrs="{'invisible':[('text_active','=',False)]}"/>
In xml file we need to add button in
<form>
<header>
<button name='button_to_visible' class="oe_highlight" type="object" string="button"/>
</header>
</form>
then after we need to define the button function in the python file:
def button_to_visible(self):
self.text_active = True
Regards
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