From 1fd226a7ea85c168618332c890db9e97fdafff61 Mon Sep 17 00:00:00 2001 From: Raf Ven Date: Mon, 5 Mar 2018 20:31:53 +0100 Subject: [PATCH] account_move_template: Migration to 11.0 --- account_move_template/README.rst | 32 ++- account_move_template/__init__.py | 1 - account_move_template/__manifest__.py | 9 +- account_move_template/models/__init__.py | 1 - .../models/account_document_template.py | 5 +- .../models/account_move_template.py | 1 - account_move_template/view/move_template.xml | 218 +++++++++--------- account_move_template/wizard/__init__.py | 1 - .../wizard/select_template.py | 7 +- .../wizard/select_template.xml | 128 +++++----- 10 files changed, 213 insertions(+), 190 deletions(-) diff --git a/account_move_template/README.rst b/account_move_template/README.rst index 0884459a..e28415de 100644 --- a/account_move_template/README.rst +++ b/account_move_template/README.rst @@ -1,3 +1,8 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +===================================================== Account Move Template - Templates for Journal Entries ===================================================== @@ -22,10 +27,15 @@ If you spotted it first, help us smashing it by providing a detailed and welcome Credits -------- +======= + +Images +------ + +* Odoo Community Association: `Icon `_. Authors: -~~~~~~~~ +-------- * Davide Corio * Lorenzo Battistini @@ -33,8 +43,24 @@ Authors: * Franco Tampieri Contributors: -~~~~~~~~~~~~~ +------------- * Jalal ZAHID (port to v10) * Alex Comba (Port to V8) * Guewen Baconnier +* Raf Ven (port to v11) + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/account_move_template/__init__.py b/account_move_template/__init__.py index e6c4fb1b..6af4c2a7 100644 --- a/account_move_template/__init__.py +++ b/account_move_template/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 See manifest # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html diff --git a/account_move_template/__manifest__.py b/account_move_template/__manifest__.py index d88f1315..d1d47105 100644 --- a/account_move_template/__manifest__.py +++ b/account_move_template/__manifest__.py @@ -1,17 +1,20 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 See manifest +# Copyright 2018 Raf Ven # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': "Account Move Template", - 'version': '10.0.2.0.0', + 'version': '11.0.1.0.0', 'category': 'Generic Modules/Accounting', 'summary': "Templates for recurring Journal Entries", 'author': "Agile Business Group,Odoo Community Association (OCA), Aurium " "Technologies,Vauxoo", 'website': 'https://github.com/OCA/account-financial-tools', 'license': 'AGPL-3', - 'depends': ['account_accountant', 'analytic'], + 'depends': [ + 'account', + 'analytic', + ], 'data': [ 'security/ir.model.access.csv', 'view/move_template.xml', diff --git a/account_move_template/models/__init__.py b/account_move_template/models/__init__.py index d88800d5..beb062b4 100644 --- a/account_move_template/models/__init__.py +++ b/account_move_template/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 See manifest # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html diff --git a/account_move_template/models/account_document_template.py b/account_move_template/models/account_document_template.py index 0a9f1bc5..55fc4751 100644 --- a/account_move_template/models/account_document_template.py +++ b/account_move_template/models/account_document_template.py @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 See manifest # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from odoo import models, fields, api, exceptions, _ -from odoo.tools.safe_eval import safe_eval from functools import partial import re +from odoo import models, fields, api, exceptions, _ +from odoo.tools.safe_eval import safe_eval class AccountDocumentTemplate(models.Model): diff --git a/account_move_template/models/account_move_template.py b/account_move_template/models/account_move_template.py index 0360fc53..4f61c4f8 100644 --- a/account_move_template/models/account_move_template.py +++ b/account_move_template/models/account_move_template.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 See manifest # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html diff --git a/account_move_template/view/move_template.xml b/account_move_template/view/move_template.xml index 4055ceac..aa668cb1 100644 --- a/account_move_template/view/move_template.xml +++ b/account_move_template/view/move_template.xml @@ -1,120 +1,120 @@ - - account.move.template.line.tree - account.move.template.line - - - - - - - - - - - - - + + account.move.template.line.tree + account.move.template.line + + + + + + + + + + + + + - - account.move.template.line.form - account.move.template.line - -
- + + account.move.template.line.form + account.move.template.line + + + + - - - - - - - - - - - + + + + + - - - - - - - account.move.template.form - account.move.template - -
-
-
- -
-
- + + - -
-
- - - -
-
-
-
- - - account.move.template.tree - account.move.template - - - - - - - - - - account.move.template.search - account.move.template - - - - - - - - - +
+ +
+
- - Move Templates - account.move.template - form - tree,form - - + + account.move.template.form + account.move.template + +
+
+
+ +
+
+ + + + +
+
+ + + +
+
+
+
- + + account.move.template.tree + account.move.template + + + + + + + + + + account.move.template.search + account.move.template + + + + + + + + + + + + + Move Templates + account.move.template + form + tree,form + + + +
diff --git a/account_move_template/wizard/__init__.py b/account_move_template/wizard/__init__.py index 7ba1ace6..c7919455 100644 --- a/account_move_template/wizard/__init__.py +++ b/account_move_template/wizard/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Agile Business Group sagl () diff --git a/account_move_template/wizard/select_template.py b/account_move_template/wizard/select_template.py index f0e5b3ab..389989f7 100644 --- a/account_move_template/wizard/select_template.py +++ b/account_move_template/wizard/select_template.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 See manifest # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from odoo import models, fields, api import time +from odoo import models, fields, api class WizardSelectMoveTemplate(models.TransientModel): @@ -14,7 +13,7 @@ class WizardSelectMoveTemplate(models.TransientModel): line_ids = fields.One2many( 'wizard.select.move.template.line', 'template_id') state = fields.Selection( - [('template_selected', 'Template selected')], 'State') + [('template_selected', 'Template selected')]) @api.multi def load_lines(self): @@ -59,7 +58,7 @@ class WizardSelectMoveTemplate(models.TransientModel): move = self._create_move(name, journal.id, partner) moves = moves + move for line in self.template_id.template_line_ids.filtered( - lambda j: j.journal_id == journal): + lambda l, j=journal: l.journal_id == j): lines.append((0, 0, self._prepare_line(line, amounts, partner))) move.write({'line_ids': lines}) diff --git a/account_move_template/wizard/select_template.xml b/account_move_template/wizard/select_template.xml index ad73a813..ad9266bb 100644 --- a/account_move_template/wizard/select_template.xml +++ b/account_move_template/wizard/select_template.xml @@ -1,80 +1,80 @@ - - Select Move Template - wizard.select.move.template - -
- + + Select Move Template + wizard.select.move.template + + + + - - - - - - + - - -
-
- -
-
- - - Select Move Template Line - wizard.select.move.template.line - -
- - - - - + -
-
-
+ + + +
+
+ +
+
- - Select Move Template Line - wizard.select.move.template.line - - + + Select Move Template Line + wizard.select.move.template.line + +
+ - - - + +
+
+
- - Select Move Template - wizard.select.move.template - form - form - - new - + + Select Move Template Line + wizard.select.move.template.line + + + + + + + + + + - + + Select Move Template + wizard.select.move.template + form + form + + new + - + + +