mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX] stock_request: set stock request order state to done when partially delivered
This commit is contained in:
@@ -23,7 +23,7 @@ Stock Request
|
||||
:target: https://runbot.odoo-community.org/runbot/153/13.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module was written to allow users to request products that are
|
||||
frequently stocked by the company, to be transferred to their chosen location.
|
||||
|
||||
@@ -243,7 +243,9 @@ class StockRequestOrder(models.Model):
|
||||
|
||||
def check_done(self):
|
||||
for rec in self:
|
||||
if not rec.stock_request_ids.filtered(lambda r: r.state != "done"):
|
||||
if not rec.stock_request_ids.filtered(
|
||||
lambda r: r.state not in ["done", "cancel"]
|
||||
):
|
||||
rec.action_done()
|
||||
return
|
||||
|
||||
|
||||
@@ -10,3 +10,4 @@
|
||||
* Steve Campbell <scampbell@opensourceintegrators.com>
|
||||
|
||||
* Héctor Villarreal <hector.villarreal@forgeflow.com>
|
||||
* Oriol Miranda <oriol.miranda@forgeflow.com>
|
||||
|
||||
@@ -1117,3 +1117,5 @@ class TestStockRequestBase(TestStockRequest):
|
||||
self.assertEqual(sr2.qty_cancelled, 4)
|
||||
self.assertEqual(sr3.state, "done")
|
||||
self.assertEqual(sr3.qty_cancelled, 5)
|
||||
# Set the request order to done if there are any delivered lines
|
||||
self.assertEqual(order.state, "done")
|
||||
|
||||
Reference in New Issue
Block a user