Odoo Help

Welcome!

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

0

Make a boolean field editable in a tree view with the possibility of open a form view when clicking on a row ??

By
AbdelAli MERZOUGUI
on 3/5/15, 8:10 AM 993 views

I have a tree view in a page on product.product object, the tree columns are "is_out_of_stock", "product_child_reference", "unit_price", 

I'm trying to make field "is_out_of_stock" editable while check/uncheck the box, and open the form view when I click on the other columns

Any suggestions for this case ?

0
AbdelAli MERZOUGUI
On 3/6/15, 3:12 AM

Thank you Vasanth for your suggestion, in fact I've already tried this, and I got just the "is_out_of_stock" checkbox editabel, otherwise when I click on "product_child_reference" or "unit_price", I don't get the form view of the child product record, 

I've found another way to do it and IMHO, it's better, In fact I've added a button in the tree list, which call a method which trigger a on_change function, this last do a write on the current record and return a dictionary like {'value': {'is_out_of_stock': not current_is_out_of_stock}}

AbdelAli MERZOUGUI
on 3/6/15, 5:03 AM
2

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
On 3/5/15, 11:57 PM

Hi, you can make the tree view as editable and make the required field as editable and other fields as readonly in the tree view using attrs,readonly ,etc

try this:

<tree string="Product" editable="bottom">

<field name="is_out_of_stock"/>

<field name="product_child_reference" readonly="1"/>

<field name="unit_price" readonly="1"/>

</tree>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/5/15, 8:10 AM
Seen: 993 times
Last updated: 3/16/15, 8:10 AM