Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
- should it be move.state, instead of pick.state?
- and what about the case when user return some/all products?
If anyone have the same issue, I update the code and you can check it from the following gist.
That code will allow you to cancel PO if it already have some shipment 'done' and returned all the shipment ('done').
That code cover the following use cases:
- PO already have some delivery 'done', but suddendly the supplier have no stock of the remaining product in PO lines
- user mistakenly add wrong product in PO lines, but some delivery already 'done'
Typically, from the functional point of view, you can receive either all, none or some of the goods you ordered. There is also the option for the supplier to provide half of the goods in one go and the other half on backorder. So ultimately it is pretty hard to determine what has or has not been delivered yet and how you should handle the PO afterwards.
If you want to cancel the PO and base the decision on wheter or not goods have been delivered, you will have to decide if you should be able to cancel if a part of the order has already been delivered. If this is the case, use the related order moves. If you want only the entire to cancel, you should base that decision on the picking. Remember, 1 picking order can still hold 1 or more move lines related to a purchase order.
Note: This reasoning will only work if standard Odoo functionality is used. If you somehow modified the PO process, this might no longer be valid.
About This Community
This platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 11/4/14, 11:32 PM|
|Seen: 1169 times|
|Last updated: 3/16/15, 8:10 AM|