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 | etc.
I try to add a button in a list; the view appears, the button appears too but it is not clickable. It's like in a ghost state and I am unable to have the focus on it.
Here the code :
<record id="pkg-cfg_lines_tree_tree" model="ir.ui.view"> <field name="name">pkg-cfg.tree</field> <field name="model">pkg-cfg_lines</field> <field name="view_mode">form</field> <field name="view_type">form</field> <field name="arch" type="xml"> <tree string="Tree" version="7.0" > <field name="pname" readonly="1" /> <field name="chse" readonly="1"/> <button name="add_line" string="Add" type="object" icon="gtk-go-forward" /> </tree> </field> </record>
and the python code for the function :
def add_line(self, cr, uid, ids, context): print "ENTER IN pkg-cfg_lines.add_line" return True
When I try to click on the button, the action is never called....
I also tried using a button with action type for the button :
< button name="%(add_line)d" string="Add" type="action" icon="gtk-go-forward" />
with the following action :
<record id="add_line" model="ir.actions.server"> <field name="type">ir.actions.server</field> <field name="name">Testing</field> <field name="condition">True</field> <field name="state">code</field> <field name="model_id" ref="model_sale_configure_container"/> <field eval="5" name="sequence"/> <field name="code">action=obj.add_line(context=context)</field> </record>
Any ideas ?
Thanks in advance, Marc
You need to be in the reading mode, not the edit mode of your entry. We have the same issue.
So I can you launch the view in reading mode ?
Did you manage to solve your issue ? Marc Cassuto (SFL)
Yes, we have made some dirty hack : In place of the button, we have put a checkbox (fields.boolean) with an onchange on it.
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 8/10/13, 8:15 PM|
|Seen: 2837 times|
|Last updated: 3/16/15, 8:10 AM|