mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_request_purchase: Filter purchases that are linked only to requests
TT43414
This commit is contained in:
@@ -44,6 +44,7 @@ class StockRequest(models.Model):
|
|||||||
res = super().action_cancel()
|
res = super().action_cancel()
|
||||||
self.sudo().purchase_ids.filtered(
|
self.sudo().purchase_ids.filtered(
|
||||||
lambda x: x.state not in ("purchase", "done", "cancel")
|
lambda x: x.state not in ("purchase", "done", "cancel")
|
||||||
|
and x.stock_request_ids == self
|
||||||
).button_cancel()
|
).button_cancel()
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user