Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
19826 Переглядів

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".