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

How to override completely the create method of pos_session class?

By
Pascal Tremblay
on 2/2/16, 8:17 PM 464 views

Hello all, 

I just want to override completely the create method of pos_session class in my custom module.

But because the original create method use return super(), I don't manage it. My new create method always return and use the old one because of the super.

I don't want to use the original create method anymore.

Here is a part of my override code :

class pos_session(osv.osv):
    _inherit = 'pos.session'
    def create(self, cr, uid, values, context=None):
     [...]
        
        res = super(pos_session, self).create(cr, uid, values, context=context) 
        return res


Thanks to help

1

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 2/2/16, 8:44 PM

I think this line will do the job instead :

res = osv.osv.create(self, cr, uid, values, context=context)

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: 2/2/16, 8:17 PM
Seen: 464 times
Last updated: 2/2/16, 8:44 PM