0
votes

I have a problem, I made two custom fields in

  • Sale.order
  • Stock.picking

How to do when the sale order is confirmed, the field in stock.picking also filled? and the data was picked up from the field at sale.order I've made before.

I'm using odoo 10

Thanks

1
Just add compute field check here : odoo.com/documentation/10.0/reference/orm.html#fieldsHeroic

1 Answers

0
votes

Yeah, first, depend in your module of sale_stock, then, inherit the sales confirm button and search for the pickings associated:

@api.multi
def action_confirm(self):
    result = super(SaleOrder, self).action_confirm()
    for order in self:
        order.picking_ids.write({'your_field_in_picking': order.your_field_in_sale})

    return result

Put it in a class that inherits from sale.order