From 94264148818c4b188cc299f33f5a900b3046d2e0 Mon Sep 17 00:00:00 2001 From: nans Date: Wed, 21 Jul 2021 13:22:28 +0200 Subject: [PATCH 1/2] [IMP] contract: add date_start field on contracts --- contract/models/contract.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contract/models/contract.py b/contract/models/contract.py index 0004aa941..b1c159b32 100644 --- a/contract/models/contract.py +++ b/contract/models/contract.py @@ -70,6 +70,9 @@ class ContractContract(models.Model): date_end = fields.Date( compute='_compute_date_end', string='Date End', store=True ) + date_start = fields.Date( + compute='_compute_date_end', string='Date Start', store=True + ) payment_term_id = fields.Many2one( comodel_name='account.payment.term', string='Payment Terms', index=True ) @@ -299,6 +302,10 @@ class ContractContract(models.Model): date_end = contract.contract_line_ids.mapped('date_end') if date_end and all(date_end): contract.date_end = max(date_end) + date_start = False + if contract.contract_line_ids: + date_start = min(contract.contract_line_ids.mapped('date_start')) + contract.date_start = date_start @api.depends( 'contract_line_ids.recurring_next_date', From 5b3dd5cdb03fba24f49ee5bf9ffae5a7aebef335 Mon Sep 17 00:00:00 2001 From: nans Date: Wed, 21 Jul 2021 13:29:44 +0200 Subject: [PATCH 2/2] [IMP] contract: add kanban, calendar, graph, pivot, activity views on contract --- contract/views/contract.xml | 75 +++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/contract/views/contract.xml b/contract/views/contract.xml index fe6ab44ac..b6c400994 100644 --- a/contract/views/contract.xml +++ b/contract/views/contract.xml @@ -322,13 +322,82 @@ - + + contract.contract.calendar + contract.contract + + + + + + + + + contract.contract.graph + contract.contract + + + + + + + + contract.contract.pivot + contract.contract + + + + + + + + contract.contract.kanban + contract.contract + + + + + + + +
+
+
+ + + + + +
+
+
+
+ + + + +
+
+
+ +
+
+
+
+
+
+
+
+
Customer Contracts contract.contract form - tree,form + tree,kanban,form,calendar,pivot,graph,activity [('contract_type', '=', 'sale')] {'is_contract':1, 'search_default_not_finished':1, @@ -367,7 +436,7 @@ Supplier Contracts contract.contract form - tree,form + tree,kanban,form,calendar,pivot,graph,activity [('contract_type', '=', 'purchase')] {'is_contract':1, 'search_default_not_finished':1,