From c790a58825a5495aabb891db3108c777aef3ab55 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Mon, 13 Mar 2023 13:44:28 +0100 Subject: [PATCH] Improve PG statistics --- ext/custom-addons/dp_custom/models/sale.py | 8 ++++++++ .../dp_custom/views/sale_views.xml | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index 136d9bfe..92b6f49c 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -66,6 +66,10 @@ class SaleCart(models.Model): assembly_state = fields.Selection(ASSEMBLY_STATES, string="State PG") state = fields.Selection(order_states, string="State") in_company = fields.Boolean(default=False,compute='_in_company',store=False) + number_of_parts = fields.Integer(string='Anzahl Teile') + number_of_parts_open = fields.Integer(string='Teile offen') + number_of_fittings = fields.Integer(string='Anzahl Beschläge') + number_of_fittings_open = fields.Integer(string='Beschläge offen') @api.multi def _in_company(self): @@ -88,6 +92,10 @@ class SaleCart(models.Model): so.create_date AS create_date, so.assembly_state AS assembly_state, so.state AS state, + so.number_of_parts AS number_of_parts, + so.number_of_parts_open AS number_of_parts_open, + so.number_of_fittings AS number_of_fittings, + so.number_of_fittings_open AS number_of_fittings_open, so.partner_id AS partner_id, so.company_id AS company_id, c_u.user_id AS user_id diff --git a/ext/custom-addons/dp_custom/views/sale_views.xml b/ext/custom-addons/dp_custom/views/sale_views.xml index 02cb36fe..99cc534a 100644 --- a/ext/custom-addons/dp_custom/views/sale_views.xml +++ b/ext/custom-addons/dp_custom/views/sale_views.xml @@ -152,10 +152,12 @@ - - - - + + + + + + @@ -299,6 +301,8 @@ + + @@ -320,6 +324,9 @@ + + + @@ -363,6 +370,9 @@ + + +