コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
19798 ビュー

it says I must first cancel the order, So I click cancel. Then it says I must "first cancel all receptions related to the purchase order". So, I went ahead and canceled the delivery, but it still gives me the same message.

アバター
破棄
最善の回答

go into each order line in the purchase order and delete them, that will help you discover which line still has a reception attached to it. Then cancel it.

アバター
破棄
著作者

I don't understand. I can no longer edit the purchase order. What am I deleting?

You could go to warehouse/deliver/receive by order and cancel the incoming shipment that corresponds to the PO. Next step is to cancel the PO

著作者

I did cancel the shipment corresponding to the PO, but it still will not cancel the PO

Make sure you are cancelling the INCOMING SHIPMENT. In your question you typed that you cancelled the DELIVERY, which is related to the SALES ORDER, not the PURCHASE ORDER.

著作者

Yes. I did cancel the incoming shipment and not the delivery. Sorry about that confusion.

@ Lars. Thanks I got my problem solved with your help.

最善の回答

Hello Robert,
You need to cancel first all the invoices related to particular purchase orders. Also, cancel all the receipt stock pickings.
you can do like this. Here the self is particular purchase order.

picking_order = self.env["stock.picking"].search([
('partner_id', '=', self.partner_id.id),
('origin', '=', self.name)])
for picking in picking_order:
if picking.state != 'cancel':
​picking.action_cancel()
if self.invoice_ids:
for invoice in self.invoice_ids:
invoice.button_draft()
​invoice.button_cancel()
record.button_cancel()

Kind Regards,


アバター
破棄

I'm newbee on odoo. Could you let me know how to run your script? I'm using odoo v16.x (online). Thanks in advance.

最善の回答

You can manully delete them from data base.

check the model name  goto the respective table

and delete the record 

also delete other related records like receipt , delivery details


アバター
破棄
最善の回答

Just an indication for those like me who have the same problem but who do *not* have installed the warehouse module, you won't be able to see the menu "Warehouse".

Then to cancel the order proceed as follow :

- Purchases / Invoice Control / Incoming shipments

- cancel the appropriate line

- then go back to the order and you will be able to cancel it.

Kind regards

アバター
破棄

How can I cancel the purchase order that has receive product? I mean shipment has "done".