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