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

Is it not possible to remove a list-view column with no values?

By
Jeff Beidler
on 1/22/15, 5:07 PM 561 views

I'm trying to override the list view for Products.  I would like to drop the "Status" column, which appears to be displaying the "state" field from product.template.  I had no problem removing the "Product Type" column, but for "Status", Odoo says:

Error: NameError: name 'state' is not defined

http://localhost:8069/web/static/lib/py.js/lib/py.js:370

The field is listed in the original view, and the column displays just fine.  Looking in the database table, I see that there are no values in the state column (all are null) for all records.  Why can't I remove the column, then?

It's being called for and if it is not defined (or has been removed) you will get that error. Rather than beat your brains our trying to delete it, just hide is with the invisible attribute in the view Like Ivan suggested below.

John Baldwin
on 1/22/15, 11:31 PM
0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/22/15, 11:10 PM

Sometimes the field is needed for other stuff like domain, setting dynamic attributes, etc.  What you can do is to keep the field and make it invisible (put invisible="1" in the field tag).

That's what I ended up doing. Was just wondering why Odoo would complain after removing it. Makes sense, if it's being looked at by some other piece of code.

Jeff Beidler
on 1/23/15, 11:29 AM
2

Hardikgiri Goswami

--Hardikgiri Goswami--
1123
| 2 1 5
Rajkot, India
--Hardikgiri Goswami--

OpenERP/Odoo Customization/Integration Expert / Python Programmer

Skype ID : hardikgiri.goswami

Hardikgiri Goswami
On 1/23/15, 12:00 AM

Hello Jeff,

Suggestion of Ivan is appriaciable. But now first you need to get back that state by updating product module from settings.

Then you can apply the solution given by Ivan.

Regards.

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: 1/22/15, 5:07 PM
Seen: 561 times
Last updated: 3/16/15, 8:10 AM