Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to cancel Purchase Order at time Confirm

By
Jagdish Panchal
on 9/21/13, 9:27 AM 1,850 views

Hi All,

On Confirm Button

When I have more than one PO line , i create new two new PO its working fine,

But i want delele or cancel existing PO when i click on Confirm button, How can i ?

I use wf_service.trg_validate(uid, 'purchase.order', ids[0], 'purchase_cancel', cr) but it give me error i alos try to unlink method it give me error.

thanks

0

Andreas Brueckl

--Andreas Brueckl--
5056
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 9/23/13, 6:28 AM

Before you can cancel a PO or SO you first have to cancel all related shippings.

In your case you have to

  • Search for stock.picking where purchase_id is the ID of your PO
  • Trigger Cancel of those pickings
  • Trigger Cancel of the PO

Thanks for the reply

Jagdish Panchal
on 9/23/13, 8:24 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 9/21/13, 9:27 AM
Seen: 1850 times
Last updated: 3/16/15, 8:10 AM