Odoo Help


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 685 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?

Baiju KS
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

Baiju KS

--Baiju KS--
| 5 5 8
Kochi, India
--Baiju KS--
ODOO technical

        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

Baiju KS
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 - 21South

--Ludo - 21South--
| 2 2 5
Zwijndrecht, Netherlands
--Ludo - 21South--


Ludo - 21South
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).

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.


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)


Asked: 11/10/14, 2:01 AM
Seen: 685 times
Last updated: 3/16/15, 8:10 AM