Odoo Help

0

0
3 Answers
1
Avatar

Marvin Taboada

--Marvin Taboada--

751
| 4 3 8
Cochabamba, Bolivia
--Marvin Taboada--
Marvin Taboada
2/9/14 16:27

Hello Dércio,

Overriding `name_get` is not necessary. If you don't declare any field with 'name' as its technical name, you should define `_rec_name` with the name of a column that appropriately identifies every record but is not necessarily unique. See the 'hr_evaluation.evaluation' object in the 'hr_evaluation' module as an example, and also see https://doc.openerp.com/trunk/server/03_module_dev_02/

OpenERP expects that all objects define (implicitly or explicitly) a column that is used as a "display name" for the object. This "display name" is used by default in several places, at searches (without specifying explicit filters for the search), at populating combo-boxes in relational fields, in the Audit Trail module to appropriately identify resources, etc.

The version you're using (6.1) attempts to access a 'name' key in the dictionary of results just after a `read`, that's why KeyError arises.

1 Comment
Dércio Duvane
3/9/14 04:26

Thanks for your reply Marvin. I've tried all those ways before. Yet still not working!

0
Dércio Duvane
3/9/14 04:25

Hello, guys as requested here's the link for the header of the py file. I didn't include the remaining methods because are working fine. 

http://bit.ly/1lHmAvE

 

 

 

0
Avatar

Ivan

--Ivan--

3410
| 6 3 9
Jakarta, Indonesia
--Ivan--
Ivan
3/9/14 04:49

I think it has something to do with the fact that 'name_parsed' field that you are using for _rec_name is a function field that is not stored.  AFAIK field used in _rec_name need to be physically existing in database (i.e. stored).

2 Comments
Dércio Duvane
3/9/14 05:02

Still no good! I have stored it and nothing, plus the _rec_name declaration is commented so it should use the name_get method

Ivan
3/9/14 05:40

Dércio Duvane, Odoo/OpenERP ORM must have a field that is designated to be the 'name' of the object model. By default it is either a field named 'name' or specified in _rec_name declaration. So, since the dotcom.venda object does not have a field named 'name', then you should uncomment the _rec_name declaration.

Ask a Question
Keep Informed
2 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.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now