From a8ef7c939d66ad720fac20481e47333c0bbed777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=BE=20=D0=9A=D0=B0=D1=82?= =?UTF-8?q?=D1=8E=D1=85=D0=B0?= Date: Fri, 27 Oct 2017 15:57:31 +0300 Subject: [PATCH] [10.0] Added analytic tags to contracts This commit adds ability to specify analytic tags on contracts invoice lines, which will be propagated to invoice lines. --- contract/__manifest__.py | 2 +- contract/models/account_analytic_account.py | 2 ++ contract/models/account_analytic_invoice_line.py | 4 ++++ contract/views/account_analytic_account_view.xml | 1 + contract/views/account_analytic_contract_view.xml | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/contract/__manifest__.py b/contract/__manifest__.py index bb05c382..1e8b8492 100644 --- a/contract/__manifest__.py +++ b/contract/__manifest__.py @@ -9,7 +9,7 @@ { 'name': 'Contracts Management - Recurring', - 'version': '10.0.4.0.1', + 'version': '10.0.4.1.1', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "OpenERP SA, " diff --git a/contract/models/account_analytic_account.py b/contract/models/account_analytic_account.py index c9030117..f5e5dd0a 100644 --- a/contract/models/account_analytic_account.py +++ b/contract/models/account_analytic_account.py @@ -188,6 +188,8 @@ class AccountAnalyticAccount(models.Model): 'uom_id': line.uom_id.id, 'discount': line.discount, }) + # Add analytic tags to invoice line + invoice_line.analytic_tag_ids |= line.analytic_tag_ids # Get other invoice line values from product onchange invoice_line._onchange_product_id() invoice_line_vals = invoice_line._convert_to_write(invoice_line._cache) diff --git a/contract/models/account_analytic_invoice_line.py b/contract/models/account_analytic_invoice_line.py index 68e693c5..68df3d7c 100644 --- a/contract/models/account_analytic_invoice_line.py +++ b/contract/models/account_analytic_invoice_line.py @@ -65,6 +65,10 @@ class AccountAnalyticInvoiceLine(models.Model): help='Discount that is applied in generated invoices.' ' It should be less or equal to 100', ) + analytic_tag_ids = fields.Many2many( + 'account.analytic.tag', + string='Analytic Tags', + ) sequence = fields.Integer( string="Sequence", default=10, diff --git a/contract/views/account_analytic_account_view.xml b/contract/views/account_analytic_account_view.xml index 6a47a0d0..4904579c 100644 --- a/contract/views/account_analytic_account_view.xml +++ b/contract/views/account_analytic_account_view.xml @@ -82,6 +82,7 @@ + diff --git a/contract/views/account_analytic_contract_view.xml b/contract/views/account_analytic_contract_view.xml index 0071d9f1..a82dd149 100644 --- a/contract/views/account_analytic_contract_view.xml +++ b/contract/views/account_analytic_contract_view.xml @@ -41,6 +41,7 @@ +