Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1053 Zobrazení

Hello,


In our multi company workflow we create purchase orders in one company that become sales orders in another company (vendor company). I want to show the status of the sales order on the originating purchase order. 

How can I show the sales order status field (‘state’) on the purchase order which created it?


thanks in advance

Avatar
Zrušit
Nejlepší odpověď

Hi,

If you don't have a Many2one field to the Sale Order in the Purchase Order create one.

sale_order_id = fields.Many2one('sale.order', string='Sales Order')
sale_order_state = fields.Char('Sale Order Status', related='sale_order_id.state')

Then, in the code after creating the Sale Order from Purchase Order, write the id of the new Sale Order in the Purchase Order. Add these fields in the Purchase Order view to see them in the Purchase Order.

Regards

Avatar
Zrušit