Skip to Content
Menu
This question has been flagged
1 Reply
3577 Views

Hi everyone,


i've added a field num_picking in model account.move.line like this :

num_picking = fields.Char(compute = 'find_picking_number', store = "true", ...)


And in the 'find_picking_number', i try to find the good picking number but i can't find how to recover it from account.move.line to stock.picking!?


could someone help me ?

Vincent

Avatar
Discard
Best Answer

Hello, Vincent


This the example with 14.0 where you can find the link stock.move in account.move having stock_move_id and from there picking reference is there.

Code:

num_picking = fields.Char(compute = '_find_picking_number', store=True)


@api.depends('move_id', 'move_id.stock_move_id', 'move_id.stock_move_id.picking_id')

def _find_picking_number(self):

    for line in self:

        line.num_picking = line.move_id.stock_move_id.picking_id.name if line.move_id and         line.move_id.stock_move_id else False

Thanks..

For More Information Contact us :- https://kanakinfosystems.com/odoo-development-services

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 23
1120
0
Feb 23
1484
0
Mar 20
1836
4
Jan 16
5625
2
Oct 15
4745