[FIX] delivery: is_all_service is False if you have a section line

If you create an sale order with a section line you see the button add delivery.

closes odoo/odoo#75570

X-original-commit: 1db92688d9e7bf0843edfd248ffef89c38bb66f0
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
Florent de Labarre
2021-08-31 08:47:10 +00:00
parent 4450f8b093
commit 99f6bf96ea
+1 -1
View File
@@ -18,7 +18,7 @@ class SaleOrder(models.Model):
@api.depends('order_line')
def _compute_is_service_products(self):
for so in self:
so.is_all_service = all(line.product_id.type == 'service' for line in so.order_line)
so.is_all_service = all(line.product_id.type == 'service' for line in so.order_line.filtered(lambda x: not x.display_type))
def _compute_amount_total_without_delivery(self):
self.ensure_one()