[FIX] sale_project: fix the display of non-service product

Before this commit, non-service SOl was not displayed on
project update right-side panel view but non-SOLs products
contribute to the project's profitability,
e.g. you install a new kitchen -> you sell the installation service
and the furniture for the kitchen.

So in this commit include the non-service SOLs to the project
update panel.

task-2992368

X-original-commit: 49558c2f15d38bee870766421d237e5228f02718
Part-of: odoo/odoo#109111
This commit is contained in:
hiroh-odoo
2023-01-05 10:31:02 +01:00
committed by Prakash Prajapati
parent 195dcdacb8
commit c02c3d5dc1
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -283,8 +283,8 @@ class Project(models.Model):
} for sol_read in sols.with_context(with_price_unit=True).read(['display_name', 'product_uom_qty', 'qty_delivered', 'qty_invoiced', 'product_uom'])]
def _get_sale_items_domain(self, additional_domain=None):
sale_line_ids = self._fetch_sale_order_item_ids()
domain = [('id', 'in', sale_line_ids), ('is_downpayment', '=', False), ('state', 'in', ['sale', 'done']), ('display_type', '=', False)]
sale_orders = self._get_sale_orders()
domain = [('order_id', 'in', sale_orders.ids), ('is_downpayment', '=', False), ('state', 'in', ['sale', 'done']), ('display_type', '=', False)]
if additional_domain:
domain = expression.AND([domain, additional_domain])
return domain
@@ -171,7 +171,7 @@ class TestSaleProject(TransactionCase):
self.assertIn(task.sale_line_id, self.project_global._get_sale_order_items())
self.assertEqual(self.project_global._get_sale_orders(), sale_order | sale_order_2)
sale_order_lines = so_line_order_task_in_global + sale_line_1_order_2 # exclude the Section and Note Sales Order Items, only choose the ones related to project_global
sale_order_lines = sale_order.order_line + sale_line_1_order_2 # exclude the Section and Note Sales Order Items
sale_items_data = self.project_global._get_sale_items(with_action=False)
self.assertEqual(sale_items_data['total'], len(sale_order_lines))
expected_sale_line_dict = {