From 4ecc9c3b42e5542f001a84fee940c81111167cd5 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Sun, 15 May 2022 18:48:36 +0200 Subject: [PATCH] [IMP] contract: Add contract lines entry point for reporting --- contract/models/abstract_contract_line.py | 4 +- contract/views/contract.xml | 7 ++ contract/views/contract_line.xml | 100 ++++++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletion(-) diff --git a/contract/models/abstract_contract_line.py b/contract/models/abstract_contract_line.py index 2df6d97510..8b3fa62b80 100644 --- a/contract/models/abstract_contract_line.py +++ b/contract/models/abstract_contract_line.py @@ -17,8 +17,10 @@ class ContractAbstractContractLine(models.AbstractModel): _description = "Abstract Recurring Contract Line" product_id = fields.Many2one("product.product", string="Product") - name = fields.Text(string="Description", required=True) + partner_id = fields.Many2one( + comodel_name="res.partner", related="contract_id.partner_id" + ) quantity = fields.Float(default=1.0, required=True) product_uom_category_id = fields.Many2one( # Used for domain of field uom_id comodel_name="uom.category", diff --git a/contract/views/contract.xml b/contract/views/contract.xml index d2ac27cc31..0cac09f3c6 100644 --- a/contract/views/contract.xml +++ b/contract/views/contract.xml @@ -686,4 +686,11 @@ action="action_supplier_contract" sequence="99" /> + + + + Contracts + + + diff --git a/contract/views/contract_line.xml b/contract/views/contract_line.xml index 51deb9f675..814bb9b748 100644 --- a/contract/views/contract_line.xml +++ b/contract/views/contract_line.xml @@ -182,4 +182,104 @@ + + + + contract.line report tree view (in contract) + contract.line + + + + + + + + + + + + + + + + + + + + + + + + + + + + contract.line search view (in contract) + contract.line + + + + + + + + + + + + + + + + + + + + + + Supplier Contract Lines + contract.line + tree,form + [('contract_id.contract_type', '=', 'purchase')] + + {'search_default_group_by_contract': 1} + + + + + + + Customer Contract Lines + contract.line + tree,form + [('contract_id.contract_type', '=', 'sale')] + + {'search_default_group_by_contract': 1} + + + + + + + Customer Contract lines + + + + + + Supplier Contract lines + + + + +