Odoo Help

0

Which methods I need to implement for successful inheriting other model (res.partner, hr.employee)?

By
Nemanja Dragovic
on 8/15/14, 7:45 AM 1,014 views

I want to edit some models trough inheriting. I don't know which methods I need to implement. I saw in other modules that there are methods like copy, on_create, etc. Can anyone help me?

Nemanja, this purely depends on the model you want to use. You want _inherit or _ineherits? Specify your question in a little detailed manner.

Serpent Consulting Services Pvt. Ltd.
on 8/15/14, 8:40 AM

I know the difference between _inherit and _inherits, it's written in technical memento. I need help with understanding basics of writing new model or inheriting existing. Under basic I meen which methods I need to implement for my model. For example I have model people, and when my user click Save on adequate view I need to write data to few other tables, of course based on data that my user entered. How can I catch this event, and how can I achieve this?

Nemanja Dragovic
on 8/15/14, 10:29 AM

_inherit seems right for you. Which methods to override depends on your need. create() for creatin new record, write() for updating data of record, unlink() when you remove that record! fields_view_get() when you want to alter the view archirecture dyamically!

Serpent Consulting Services Pvt. Ltd.
on 8/19/14, 8:54 AM
0

Ludo - Neobis

--Ludo - Neobis--
2407
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 8/15/14, 8:47 AM

Basically you only need to override methods that you would like to use. If you for example only want to add fields, you can just define them. If you want something done when saving or creating a record, you need to inherit the appropriate method. Every object has a set of methods which are defined here:

https://doc.odoo.com/trunk/server/api_models/ (as soon as it gets back online)

Can you give me an example of overridden create method?

Nemanja Dragovic
on 9/6/14, 7:20 AM

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

Question tools

2 follower(s)

Stats

Asked: 8/15/14, 7:45 AM
Seen: 1014 times
Last updated: 3/16/15, 8:10 AM