Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
19824 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Tác giả

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.

Tác giả

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.

Câu trả lời hay nhất

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,


Ảnh đại diện
Huỷ bỏ

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.

Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ

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