Odoo Help


Nobody can answer why active_id does not work here

on 2/12/16, 8:15 AM 726 views

Nobody can answer this:

Why stock_picking_id field is not populated with the calling ID? (It is being called from a button in stock_picking form which launches the popup tree view):

# -*- coding: utf-8 -*-

from openerp import models, fields, api

class LabelPicking(models.TransientModel):
_name = "label.picking"
stock_picking_id = fields.Many2one(
default=lambda self: self.env.context['active_id'],


<?xml version="1.0" encoding="utf-8" ?>
                <record id="view_tree_label_picking" model="ir.ui.view">
                        <field name="name">Labels Dispatch Items Tree</field>
                        <field name="model">label.picking</field>
                        <field name="arch" type="xml">
                                        <field name="stock_picking_id"/>



| 6 4 7
Lodz, Poland

On 2/12/16, 8:45 AM

See this issue, maybe simillar problem: https://github.com/odoo/odoo/issues/4384

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

1 follower(s)


Asked: 2/12/16, 8:15 AM
Seen: 726 times
Last updated: 2/12/16, 8:45 AM