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

override save button

By
shafeequemonp
on 2/27/14, 7:54 AM 3,954 views

its may be a silly question..i need to override the save button in WAREHOUSE->DELIVERY ORDERS->PRODUCT INLINE but unfortunately i couldn't find the create function file .can anyone help me to find the file

4

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 2/27/14, 6:26 PM

When you click on Save button it calls two methods.

  1. create: When you are creating a new record.
  2. 'write': When you are updating a record.

    You can override these two methods by inherit the object.

    class stock_picking_out(osv.Model):
        _inherit = 'stock.picking.out'
    
        def create(cr, uid, vals, context=None):
            #your code
            res_id = super(stock_picking_out, self).create(cr, uid, vals, context=context)
            #your code
            return res_id
    
        def write(cr, uid, ids, vals, context=None):
            #your code
            super(stock_picking_out, self).wite(cr, uid, ids, vals, context=context)
            #your code
            return True
    

This is how you can override the methods.

If you want to see these methods in server here: def create and def write

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

0 follower(s)

Stats

Asked: 2/27/14, 7:54 AM
Seen: 3954 times
Last updated: 3/16/15, 8:10 AM