1
votes

I would like to move the description of the product on sale order line to the delivery order line (stock.pack.operation).

I added this code in the "action_confirm" of the sale.order

order.picking_ids.pack_operation_product_ids.write ({' my_field_in_stock_pack_operation': order_line.order.name})

for a product that is already successful. But if more than 1 will occur error..

is there a way or another solution?

i am using odoo 10

1

1 Answers

1
votes
for order in self:
    if order.picking_ids
        for picking in picking_ids:
            if picking.order_line.name:
                self.env['stock.move.operation.link'].write{'my_field_in_stock_pack_operation': picking.order_line.name})

OR on sale order confirm create [stock.picking] on action_confirm method where you can create description field.