From 24f57be03d6648dc0ebfd45286ed4ad7c6253127 Mon Sep 17 00:00:00 2001 From: Thomas Binsfeld Date: Tue, 28 May 2019 16:41:55 +0200 Subject: [PATCH] [REF] Contract Sale: split from analytic account [REF] Contract Sale: update translations --- contract_sale/__manifest__.py | 4 +-- contract_sale/i18n/contract_sale.pot | 2 ++ contract_sale/i18n/gl.po | 3 +- .../migrations/12.0.2.0.0/pre-migration.py | 32 +++++++++++++++++++ ...unt_security.xml => contract_security.xml} | 8 ++--- contract_sale/security/ir.model.access.csv | 14 ++++---- .../views/abstract_contract_line.xml | 18 +++++------ contract_sale/views/contract.xml | 2 +- contract_sale/views/contract_line.xml | 18 +++++------ contract_sale/views/contract_template.xml | 20 +++++------- 10 files changed, 74 insertions(+), 47 deletions(-) create mode 100644 contract_sale/migrations/12.0.2.0.0/pre-migration.py rename contract_sale/security/{account_analytic_account_security.xml => contract_security.xml} (66%) diff --git a/contract_sale/__manifest__.py b/contract_sale/__manifest__.py index b1655833..25155532 100644 --- a/contract_sale/__manifest__.py +++ b/contract_sale/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Contract from Sale', - 'version': '12.0.1.0.0', + 'version': '12.0.2.0.0', 'category': 'Sales', 'author': 'Tecnativa, ' 'Odoo Community Association (OCA)', @@ -14,7 +14,7 @@ ], 'data': [ 'security/ir.model.access.csv', - 'security/account_analytic_account_security.xml', + 'security/contract_security.xml', 'views/abstract_contract_line.xml', 'views/contract.xml', 'views/contract_line.xml', diff --git a/contract_sale/i18n/contract_sale.pot b/contract_sale/i18n/contract_sale.pot index 3ddf1e28..715a4dfb 100644 --- a/contract_sale/i18n/contract_sale.pot +++ b/contract_sale/i18n/contract_sale.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-29 10:00+0000\n" +"PO-Revision-Date: 2019-05-29 10:00+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" diff --git a/contract_sale/i18n/gl.po b/contract_sale/i18n/gl.po index c148bf6d..139fe485 100644 --- a/contract_sale/i18n/gl.po +++ b/contract_sale/i18n/gl.po @@ -1,11 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_sale +# * contract_sale # msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-29 10:00+0000\n" "PO-Revision-Date: 2019-02-04 18:50+0000\n" "Last-Translator: Marta Vázquez Rodríguez \n" "Language-Team: none\n" diff --git a/contract_sale/migrations/12.0.2.0.0/pre-migration.py b/contract_sale/migrations/12.0.2.0.0/pre-migration.py new file mode 100644 index 00000000..69665469 --- /dev/null +++ b/contract_sale/migrations/12.0.2.0.0/pre-migration.py @@ -0,0 +1,32 @@ +# Copyright 2019 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import logging + +from openupgradelib import openupgrade + +_logger = logging.getLogger(__name__) + + +def migrate(cr, version): + xmlids_to_rename = [ + ('contract_sale.account_analytic_account_own_salesman', + 'contract_sale.contract_contract_own_salesman'), + ('contract_sale.account_analytic_account_see_all', + 'contract_sale.contract_contract_see_all'), + ('contract_sale.account_analytic_contract_salesman', + 'contract_sale.contract_template_salesman'), + ('contract_sale.account_analytic_contract_sale_manager', + 'contract_sale.contract_template_sale_manager'), + ('contract_sale.account_analytic_invoice_line_saleman', + 'contract_sale.contract_line_saleman'), + ('contract_sale.account_analytic_invoice_line_manager', + 'contract_sale.contract_line_manager'), + ('contract_sale.account_analytic_contract_line_salesman', + 'contract_sale.contract_template_line_salesman'), + ('contract_sale.account_analytic_contract_line_manager', + 'contract_sale.contract_template_line_manager'), + ('contract_sale.account_analytic_account_contract_salesman', + 'contract_sale.contract_contract_salesman'), + ] + openupgrade.rename_xmlids(cr, xmlids_to_rename) diff --git a/contract_sale/security/account_analytic_account_security.xml b/contract_sale/security/contract_security.xml similarity index 66% rename from contract_sale/security/account_analytic_account_security.xml rename to contract_sale/security/contract_security.xml index 1833a1ce..6d1c6e64 100644 --- a/contract_sale/security/account_analytic_account_security.xml +++ b/contract_sale/security/contract_security.xml @@ -1,15 +1,15 @@ - + See Own Contracts - + ['|', ('user_id','=',user.id), ('user_id','=',False)] - + See All Contracts - + [(1,'=',1)] - - account.abstract.analytic.contract.line.form (in contract_sale) - account.abstract.analytic.contract.line - + + + contract.abstract.contract.line form view (in contract_sale) + contract.abstract.contract.line + - - sale.group_discount_per_so_line - - + + sale.group_discount_per_so_line + diff --git a/contract_sale/views/contract.xml b/contract_sale/views/contract.xml index 04c2d13c..1bf893b9 100644 --- a/contract_sale/views/contract.xml +++ b/contract_sale/views/contract.xml @@ -4,7 +4,7 @@ diff --git a/contract_sale/views/contract_line.xml b/contract_sale/views/contract_line.xml index 05f8581d..90c499a3 100644 --- a/contract_sale/views/contract_line.xml +++ b/contract_sale/views/contract_line.xml @@ -1,17 +1,15 @@ - - account.analytic.invoice.line.tree (in contract_sale) - account.analytic.invoice.line - + + + contract.template.line tree view (in contract_sale) + contract.line + - - sale.group_discount_per_so_line - - + + sale.group_discount_per_so_line + diff --git a/contract_sale/views/contract_template.xml b/contract_sale/views/contract_template.xml index adfc650a..1fd7de4d 100644 --- a/contract_sale/views/contract_template.xml +++ b/contract_sale/views/contract_template.xml @@ -1,19 +1,15 @@ - - Account Analytic Contract Form View (in - sale_contract) - - account.analytic.contract - + + + contract.template form view (in contract_sale) + contract.template + - - - sale.group_discount_per_so_line - - + + sale.group_discount_per_so_line +