Odoo Help


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.


Akhil P Sivan

--Akhil P Sivan--
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 5/1/16, 12:03 PM


vals is a dictionary containing the values to create a new record or write to a record in the model. 

I hope you are working in Odoo 8 new api.

In that case, if you want to override create():


class AccountJournal(models.Model):
    _inherit = "account.journal"
    def create(self, vals):         
        rec_id = super(AccountJournal, self).create(vals)
        ...     #do your stuff    
        return rec_id

and for write():


class AccountJournal(models.Model):
    _inherit = "account.journal"
    def write(self, vals):         
        res = super(AccountJournal, self).write(vals) 
        ...    #do your stuff
        return res

Hope this helps

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

2 follower(s)


Asked: 5/1/16, 10:27 AM
Seen: 374 times
Last updated: 8/16/16, 2:58 AM