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.


I want to inherit Receive product button and complete functionality in purchase order into my new custom form. What are the functions i needs to call there??

on 11/10/14, 2:01 AM 471 views

I created a custom form same like purchase order. I just want to implement receive invoice or incoming shipment only in that form.

What are steps i need to follow?

did you inherited purchase.order?

on 11/10/14, 4:08 AM


on 11/10/14, 4:23 AM

that is not a right solution for my requirement. So i decided to inherit only incoming shipment in my form. but i dont know, which are function used for incoming shipment

on 11/10/14, 4:24 AM


| 5 4 8
Kochi, India
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

On 11/11/14, 10:19 AM

Function for Recieve Product button is given below:-

    def view_picking(self, cr, uid, ids, context=None):
        This function returns an action that display existing pîcking orders of given purchase order ids.
        mod_obj = self.pool.get('ir.model.data')
        pick_ids = []
        for po in self.browse(cr, uid, ids, context=context):
            pick_ids += [picking.id for picking in po.picking_ids]

        action_model, action_id = tuple(mod_obj.get_object_reference(cr, uid, 'stock', 'action_picking_tree4'))
        action = self.pool.get(action_model).read(cr, uid, action_id, context=context)
        ctx = eval(action['context'])
            'search_default_purchase_id': ids[0]
        if pick_ids and len(pick_ids) == 1:
            form_view_ids = [view_id for view_id, view in action['views'] if view == 'form']
            view_id = form_view_ids and form_view_ids[0] or False
                'views': [],
                'view_mode': 'form',
                'view_id': view_id,
                'res_id': pick_ids[0]

            'context': ctx,
        return action


@Baiju, Thanks for your answer. I will let you know the update.

on 11/11/14, 11:48 PM

I have another doubt, i want to add item code or serial no in purchase.requisition.line. I successfully added a new field in purchase.requisition.line. but my automatic sequence code is not working.

on 11/11/14, 11:52 PM

Ludo - Neobis

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


Ludo - Neobis
On 11/10/14, 4:52 AM

Check out the code for stock. Use the debug tool in your web client to find the method this button uses (normally the ssame as the name) and find it in the code.

Chances are you will find it in the stock.picking class. Once you found that method, override it and see what variables are provided (I think values and perhaps a browse object).

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: 11/10/14, 2:01 AM
Seen: 471 times
Last updated: 3/16/15, 8:10 AM