diff --git a/contract_layout_category_hide_detail/__manifest__.py b/contract_layout_category_hide_detail/__manifest__.py index 35c123682..65f6ad991 100644 --- a/contract_layout_category_hide_detail/__manifest__.py +++ b/contract_layout_category_hide_detail/__manifest__.py @@ -7,15 +7,8 @@ "version": "12.0.1.0.0", "category": "Contract Management", "website": "https://github.com/OCA/contract", - "author": "Tecnativa, " - "Odoo Community Association (OCA)", + "author": "Tecnativa, " "Odoo Community Association (OCA)", "license": "AGPL-3", - "depends": [ - "contract", - "sale_layout_category_hide_detail", - ], - "data": [ - "views/abstract_contract_line.xml", - "views/contract.xml", - ], + "depends": ["contract", "sale_layout_category_hide_detail"], + "data": ["views/abstract_contract_line.xml", "views/contract.xml"], } diff --git a/contract_layout_category_hide_detail/models/abstract_contract_line.py b/contract_layout_category_hide_detail/models/abstract_contract_line.py index 8083acd33..8511c425a 100644 --- a/contract_layout_category_hide_detail/models/abstract_contract_line.py +++ b/contract_layout_category_hide_detail/models/abstract_contract_line.py @@ -1,17 +1,11 @@ # Copyright 2020 Tecnativa - Ernesto Tejeda # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields +from odoo import fields, models class ContractAbstractContractLine(models.AbstractModel): - _inherit = 'contract.abstract.contract.line' + _inherit = "contract.abstract.contract.line" - show_details = fields.Boolean( - string="Show details", - default=True - ) - show_subtotal = fields.Boolean( - string="Show subtotal", - default=True - ) + show_details = fields.Boolean(string="Show details", default=True) + show_subtotal = fields.Boolean(string="Show subtotal", default=True) diff --git a/contract_layout_category_hide_detail/models/contract_line.py b/contract_layout_category_hide_detail/models/contract_line.py index 8e6e65fb1..baa975cf9 100644 --- a/contract_layout_category_hide_detail/models/contract_line.py +++ b/contract_layout_category_hide_detail/models/contract_line.py @@ -6,7 +6,7 @@ from odoo import api, models class ContractLine(models.Model): - _inherit = 'contract.line' + _inherit = "contract.line" @api.multi def _prepare_invoice_line(self, invoice_id=False, invoice_values=False): @@ -16,7 +16,6 @@ class ContractLine(models.Model): # 'vals' will be equal to {} if vals: vals.update( - show_details=self.show_details, - show_subtotal=self.show_subtotal, + show_details=self.show_details, show_subtotal=self.show_subtotal, ) return vals diff --git a/contract_layout_category_hide_detail/views/abstract_contract_line.xml b/contract_layout_category_hide_detail/views/abstract_contract_line.xml index b33cbb77f..aed10e5ad 100644 --- a/contract_layout_category_hide_detail/views/abstract_contract_line.xml +++ b/contract_layout_category_hide_detail/views/abstract_contract_line.xml @@ -1,18 +1,22 @@ - + contract.abstract.contract.line.hide.details contract.abstract.contract.line - + - - + + - diff --git a/contract_layout_category_hide_detail/views/contract.xml b/contract_layout_category_hide_detail/views/contract.xml index 3a5b114f6..46ec6a079 100644 --- a/contract_layout_category_hide_detail/views/contract.xml +++ b/contract_layout_category_hide_detail/views/contract.xml @@ -1,15 +1,15 @@ - + - contract.contract.form.hide.details contract.contract - + - - + + attrs="{'invisible': ['|', ('display_type', '!=', 'line_section'), ('show_details', '!=', True)]}" + /> - diff --git a/setup/contract_layout_category_hide_detail/odoo/addons/contract_layout_category_hide_detail b/setup/contract_layout_category_hide_detail/odoo/addons/contract_layout_category_hide_detail new file mode 120000 index 000000000..25fe67c40 --- /dev/null +++ b/setup/contract_layout_category_hide_detail/odoo/addons/contract_layout_category_hide_detail @@ -0,0 +1 @@ +../../../../contract_layout_category_hide_detail \ No newline at end of file diff --git a/setup/contract_layout_category_hide_detail/setup.py b/setup/contract_layout_category_hide_detail/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/contract_layout_category_hide_detail/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)