From 68a9b8f1907a3a27f4e15396ee6609db551cb312 Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 28 Jul 2025 13:20:57 +0200 Subject: [PATCH] LaOsaCoop/Odoo16#47 remove lines with qty <= 0 --- .../wizards/purchase_order_recommendation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/purchase_order_product_recommendation_supermarket/wizards/purchase_order_recommendation.py b/purchase_order_product_recommendation_supermarket/wizards/purchase_order_recommendation.py index c5c0871..b9ac414 100644 --- a/purchase_order_product_recommendation_supermarket/wizards/purchase_order_recommendation.py +++ b/purchase_order_product_recommendation_supermarket/wizards/purchase_order_recommendation.py @@ -200,6 +200,12 @@ class PurchaseOrderRecommendationSupermarketWizard(models.TransientModel): ) return res + def action_accept(self): + super().action_accept() + for line in self.order_id.order_line: + if line.product_qty <= 0: + line.unlink() + def _get_days_out_of_stock(self, product): """ Returns the number of days between date_begin and date_end