My question is that when purchase method is made to order, the sale order will create a purchase order same quantity of your sale order. but when I cancel sale order so how to cancel purchase order or purchase order line which is specific sale order.
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
This question has been flagged
Hello Harshit,
In odoo 11 you can use the origin field on the purchase order.
Example: The SO11 creates a purchase order with code PO33 and field "origin" with the SO11 value.
You can override the cancel method on the sale order like this:
class SaleOrder(models.Model):
_inherit='sale.order'
@api.multi
def action_cancel(self):
purchase_order = self.env['purchase.order'].search([('origin','=',self.name)])
if purchase_order:
purchase_order.button_cancel()
res = super(SaleOrder, self).action_cancel()
return res
Hope it helps.
Gabriel Caceres Cabriza Thank You for answering but its more than one sale order that time origin looks like SO001, SO002... so in that make to order process its seems to look like that so If I cancel SO001 so how to cancel the specific purchase order line with Qty
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Nov 24
|
262 | ||
|
1
Oct 24
|
328 | ||
|
4
Oct 24
|
323 | ||
Connect Odoo with unopim
Solved
|
|
2
Oct 24
|
360 | |
|
2
Dec 24
|
661 |