From 4a97df0989f527e792a5e9d3cb7ec6056ecc2578 Mon Sep 17 00:00:00 2001 From: Mark Stopka Date: Sun, 9 Dec 2018 11:53:24 +0100 Subject: [PATCH 1/3] Remove res_partner reference from module init. --- l10n_cs/__init__.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/l10n_cs/__init__.py b/l10n_cs/__init__.py index f71423d..6935188 100644 --- a/l10n_cs/__init__.py +++ b/l10n_cs/__init__.py @@ -1,7 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Copyright (C) 2018 PERLUR Group (). +# Copyright (C) 2012 - 2018 PERLUR Group (). +# Copyright (C) 2018 Optimal 4 s.r.o. (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -18,8 +19,4 @@ # ############################################################################## -def _preserve_tag_on_taxes(cr, registry): - from odoo.addons.account.models.chart_template import preserve_existing_tags_on_taxes - preserve_existing_tags_on_taxes(cr, registry, 'l10n_cs') - -import res_partner +from . import models \ No newline at end of file From 0329aeacb34187eb5582142579da65536999d037 Mon Sep 17 00:00:00 2001 From: Mark Stopka Date: Sun, 9 Dec 2018 11:56:30 +0100 Subject: [PATCH 2/3] Update copyright and dependencies. --- l10n_cs/__manifest__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/l10n_cs/__manifest__.py b/l10n_cs/__manifest__.py index 42dad32..b557563 100644 --- a/l10n_cs/__manifest__.py +++ b/l10n_cs/__manifest__.py @@ -1,7 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Copyright (C) 2012 - 2017 PERLUR Group (). +# Copyright (C) 2012 - 2018 PERLUR Group (). +# Copyright (C) 2018 Optimal 4 s.r.o. (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -21,19 +22,19 @@ { 'name': 'Czech - Accounting', - 'version': '2.0', + 'version': '2.1', 'category': 'Accounting', 'description': """ This is the latest Czech Odoo (OpenERP) localisation necessary to run Odoo accounting for Czech businesses with: ============================================================================================================ - a Chart Of Accounts for Czech Republic - - VAT tax structure with VATs for years 2010, 2011, 2012, 2013 and 2014 + - VAT tax structure with VATs for years 2018 - a few other adaptations""", 'author': 'PERLUR Group and Optimal4', 'price': '100', 'currency': 'EUR', 'website': 'https://go.perlur.cloud/odoo-packages/', - 'depends': ['base_iban', 'base_vat', 'l10n_multilang'], + 'depends': ['account', 'base_iban', 'base_vat', 'l10n_multilang', 'contacts'], 'data': [ 'partner_view.xml', 'data/account_type.xml', From 358dbc30d54b026b01b76719ad2ec80be86f8a13 Mon Sep 17 00:00:00 2001 From: Mark Stopka Date: Sun, 9 Dec 2018 12:58:57 +0100 Subject: [PATCH 3/3] * Refactor ORM model * Rename account_tax.xml to account_tax_data.xml --- l10n_cs/__manifest__.py | 2 +- .../{account_tax.xml => account_tax_data.xml} | 0 l10n_cs/models/models.py | 16 ++++------------ l10n_cs/models/res_partner.py | 17 +++++++---------- 4 files changed, 12 insertions(+), 23 deletions(-) rename l10n_cs/data/{account_tax.xml => account_tax_data.xml} (100%) diff --git a/l10n_cs/__manifest__.py b/l10n_cs/__manifest__.py index b557563..b2c1169 100644 --- a/l10n_cs/__manifest__.py +++ b/l10n_cs/__manifest__.py @@ -41,7 +41,7 @@ 'data/account_template_entrepreneurs.xml', 'data/account_tax_code.xml', 'data/account_chart.xml', - 'data/account_tax.xml', + 'data/account_tax_data.xml', 'data/account_fiscal_templates.xml', 'wizard/l10n_cs_wizard.xml', ], diff --git a/l10n_cs/data/account_tax.xml b/l10n_cs/data/account_tax_data.xml similarity index 100% rename from l10n_cs/data/account_tax.xml rename to l10n_cs/data/account_tax_data.xml diff --git a/l10n_cs/models/models.py b/l10n_cs/models/models.py index e720793..b10eb3a 100644 --- a/l10n_cs/models/models.py +++ b/l10n_cs/models/models.py @@ -1,7 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Copyright (C) 2012 STOPKA Consulting s.r.o. (). +# Copyright (C) 2012 - 2018 PERLUR Group (). +# Copyright (C) 2018 Optimal 4 s.r.o. (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -18,14 +19,5 @@ # ############################################################################## -from openerp.osv import fields, osv - -class res_partner(osv.osv): - _inherit = 'res.partner' - - _columns = { - 'company_registry': fields.char('Company Registry', size=64), - } - -res_partner() - + from odoo import models, fields, api + \ No newline at end of file diff --git a/l10n_cs/models/res_partner.py b/l10n_cs/models/res_partner.py index a6938f6..ca88401 100644 --- a/l10n_cs/models/res_partner.py +++ b/l10n_cs/models/res_partner.py @@ -18,14 +18,11 @@ # ############################################################################## -from openerp.osv import fields, osv +from odoo import models, fields, api -class res_partner(osv.osv): - _name = 'res.partner' - _inherit = 'res.partner' - - _columns = { - 'company_registry': fields.char('Company Registry', size=64), - } - -res_partner() +class ResPartner(models.Model): + _inherit = 'res.partner' + company_registry = fields.Char('Company Registry') + @api.model + def _company_registry(self): + return super(ResPartner, self)._company_registry() + ['company_registry']