Skip to Content
Menu
This question has been flagged

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(
'stock.picking',
required=True,
default=lambda self: self.env.context['active_id'],
)

XML:

<?xml version="1.0" encoding="utf-8" ?>
<openerp>
        <data>
                <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">
                                <tree>
                                        <field name="stock_picking_id"/>
                                </tree>
                        </field>
                </record>
        </data>
</openerp>

Avatar
Discard
Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
4
Mar 16
4057
2
Feb 16
2565
1
Feb 16
21274
0
Jan 16
3265
1
Sep 15
3039