From 03eab6a80832ac6196d08f5e4a63f125b43585d5 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 21 Nov 2012 09:56:48 +0100 Subject: [PATCH 01/89] Move my module account_analytic_required from extra-addons to account-analytic --- account_analytic_required/__init__.py | 24 ++++ account_analytic_required/__openerp__.py | 44 +++++++ account_analytic_required/account.py | 67 ++++++++++ account_analytic_required/account_view.xml | 24 ++++ .../i18n/account_analytic_required.pot | 94 ++++++++++++++ account_analytic_required/i18n/ar.po | 120 +++++++++++++++++ account_analytic_required/i18n/ca.po | 120 +++++++++++++++++ account_analytic_required/i18n/es.po | 122 ++++++++++++++++++ account_analytic_required/i18n/fr.po | 121 +++++++++++++++++ 9 files changed, 736 insertions(+) create mode 100644 account_analytic_required/__init__.py create mode 100644 account_analytic_required/__openerp__.py create mode 100644 account_analytic_required/account.py create mode 100644 account_analytic_required/account_view.xml create mode 100644 account_analytic_required/i18n/account_analytic_required.pot create mode 100644 account_analytic_required/i18n/ar.po create mode 100644 account_analytic_required/i18n/ca.po create mode 100644 account_analytic_required/i18n/es.po create mode 100644 account_analytic_required/i18n/fr.po diff --git a/account_analytic_required/__init__.py b/account_analytic_required/__init__.py new file mode 100644 index 0000000000..71b2d9b732 --- /dev/null +++ b/account_analytic_required/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +import account diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py new file mode 100644 index 0000000000..b7a9b7c541 --- /dev/null +++ b/account_analytic_required/__openerp__.py @@ -0,0 +1,44 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'Account analytic required', + 'version': '0.1', + 'category': 'Generic Modules/Accounting', + 'license': 'AGPL-3', + 'description': """This module adds an option "analytic policy" on account types. You have the choice between 3 policies : always, never and optional. + +For example, if you want to have an analytic account on all your expenses, set the policy to "always" for the account type "expense" ; then, if you try to save an account move line with an account of type "expense" without analytic account, you will get an error message. + +Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011. +""", + 'author': 'Akretion', + 'website': 'http://www.akretion.com/', + 'depends': ['account'], + 'init_xml': [], + 'update_xml': ['account_view.xml'], + 'demo_xml': [], + 'installable': True, + 'active': False, +} + diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py new file mode 100644 index 0000000000..6e47fddbaa --- /dev/null +++ b/account_analytic_required/account.py @@ -0,0 +1,67 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# @author Alexis de Lattre +# Developped during the Akretion-Camptocamp code sprint of June 2011 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields, osv +from tools.translate import _ + + +class account_account_type(osv.osv): + _inherit = "account.account.type" + + _columns = { + 'analytic_policy' : fields.selection([ + ('optional', 'Optional'), + ('always', 'Always'), + ('never', 'Never') + ], 'Policy for analytic account', help="Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Never', the accountant will get an error message if an analytic account is present."), + } + + _defaults = { + 'analytic_policy': lambda *a: 'optional', + } + +account_account_type() + + +class account_move_line(osv.osv): + _inherit = "account.move.line" + + def check_analytic_required(self, cr, uid, vals, context=None): + if vals.has_key('account_id'): + account = self.pool.get('account.account').browse(cr, uid, vals['account_id'], context=context) + if account.user_type.analytic_policy == 'always' and not vals.get('analytic_account_id', False): + raise osv.except_osv(_('Error :'), _("Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." % (account.code, account.name, vals.get('name', False)))) + elif account.user_type.analytic_policy == 'never' and vals.get('analytic_account_id', False): + cur_analytic_account = self.pool.get('account.analytic.account').read(cr, uid, vals['analytic_account_id'], ['name', 'code'], context=context) + raise osv.except_osv(_('Error :'), _("Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." % (account.code, account.name, vals.get('name', False), cur_analytic_account['code'], cur_analytic_account['name']))) + return True + + def create(self, cr, uid, vals, context=None, check=True): + self.check_analytic_required(cr, uid, vals, context=context) + return super(account_move_line, self).create(cr, uid, vals, context=context, check=check) + + def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): + self.check_analytic_required(cr, uid, vals, context=context) + return super(account_move_line, self).write(cr, uid, ids, vals, context=context, check=check, update_check=update_check) + +account_move_line() diff --git a/account_analytic_required/account_view.xml b/account_analytic_required/account_view.xml new file mode 100644 index 0000000000..def05a1e85 --- /dev/null +++ b/account_analytic_required/account_view.xml @@ -0,0 +1,24 @@ + + + + + + + + account_analytic_required.account_type_form + account.account.type + + + + + + + + + + diff --git a/account_analytic_required/i18n/account_analytic_required.pot b/account_analytic_required/i18n/account_analytic_required.pot new file mode 100644 index 0000000000..6724a8fcd3 --- /dev/null +++ b/account_analytic_required/i18n/account_analytic_required.pot @@ -0,0 +1,94 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.2\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2011-06-10 07:49+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Never', the accountant will get an error message if an analytic account is present." +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "This module adds an option \"analytic policy\" on account types. You have the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, set the policy to \"always\" for the account type \"expense\" ; then, if you try to save an account move line with an account of type \"expense\" without analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011.\n" +"" +msgstr "" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "" + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "" + diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po new file mode 100644 index 0000000000..9452af052f --- /dev/null +++ b/account_analytic_required/i18n/ar.po @@ -0,0 +1,120 @@ +# Arabic translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2012-02-08 07:01+0000\n" +"Last-Translator: husam \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-09-25 05:07+0000\n" +"X-Generator: Launchpad (build 16019)\n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "سياسة للحسابات التحليلية" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"ضع سياسة للحسابات التحليلية: إذا قمت بتحديد \"الاختياري\"، فان المحاسب حر في " +"وضع حساب تحليلي على حساب خط التحرك مع هذا النوع من الحساب، وإذا قمت بتحديد " +"\"دائما\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان هناك لا يوجد حساب " +"تحليلي، وإذا قمت بتحديد \"أبدا\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان " +"هناك حساب تحليلي موجود" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "إختياري" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" +msgstr "" +"هذه الوحدة تضيف خيار \"السياسة التحليلية\" على أنواع الحسابات. لديك خيار بين " +"3 سياسات: دائما، أبدا، واختياري.\n" +"\n" +"على سبيل المثال، إذا كنت تريد أن يكون لديك حساب تحليلي عن جميع النفقات " +"الخاصة بك، اختار النهج \"دائما\" من أجل نوع الحساب\"مصروف\"، ثم، إذا حاولت " +"حفظ الحركة في حساب مع حساب \"مصروف\" من دون حساب تحليلي، وسوف تحصل على " +"رسالة خطأ.\n" +"\n" +"طورت الوحدة بواسطة اتر أليكسيس دي alexis.delattre@akretion.com> Akretion-" +"Camptocamp من يونيو 2011\n" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "لا يمكنك انشاء حركة على الحساب" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "دائماً" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "أبدًا" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "مطلوب حساب تحليلي" + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "قيمة دائنة أو مدينة خاطئة في القيد المحاسبي !" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "لا يمكنك عمل حركة على هذا الحساب" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "عناصر دفتر اليومية" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "نوع الحساب" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "يجب ان تكون الشركة نفس فترتها وحسابها المتعلق بها." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "خطأ :" diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po new file mode 100644 index 0000000000..f812bd33e9 --- /dev/null +++ b/account_analytic_required/i18n/ca.po @@ -0,0 +1,120 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.2\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2011-06-24 10:26+0000\n" +"Last-Translator: jmartin (Zikzakmedia) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-09-25 05:07+0000\n" +"X-Generator: Launchpad (build 16019)\n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "Política per als comptes analítics" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Configura la política per als comptes analítics: Si seleccioneu 'Opcional', " +"el comptable és lliure de posar un compte analític en un apunt comptable amb " +"aquest tipus de compte; si seleccioneu 'Sempre', el comptable rebrà un " +"missatge d'error si l'apunt no té compte analític; si seleccioneu 'Mai', el " +"comptable rebrà un missatge d'error si l'apunt té un compte analític." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Opcional" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" +msgstr "" +"Aquest mòdul afegeix una opció \"política analítica\" als tipus comptables. " +"Podeu escollir entre 3 polítiques: 'Sempre', 'Mai' i 'Opcional'.\n" +"\n" +"Per exemple, si voleu tenir un compte analític de totes les vostres " +"despeses, seleccioneu la política \"Sempre\" per al tipus comptable " +"\"Despesa\"; llavors, si intenteu desar un apunt comptable de tipus " +"comptable \"Despesa\" sense compte analític, obtindreu un missatge d'error.\n" +"\n" +"Mòdul desenvolupat per Alexis de Lattre " +"durant la cursa de codi Akretion-Camptocamp de juny de 2011.\n" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "No podeu crear un apunt en un compte tancat." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Sempre" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Mai" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "El compte analític és requerit." + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "Valor erroni al deure o a l'haver de l'assentament comptable!" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "No podeu crear un apunt en un compte de tipus \"Vista\"." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "Apunts comptables" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Tipus de compte" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "" +"La companyia ha de ser la mateixa que la dels comptes i períodes relacionats." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "Error:" diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po new file mode 100644 index 0000000000..38626e05e0 --- /dev/null +++ b/account_analytic_required/i18n/es.po @@ -0,0 +1,122 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.2\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2011-06-24 10:25+0000\n" +"Last-Translator: jmartin (Zikzakmedia) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-09-25 05:07+0000\n" +"X-Generator: Launchpad (build 16019)\n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "Política para las cuentas analíticas" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Configura la política para las cuentas analíticas: Si selecciona 'Opcional', " +"el contable es libre de poner una cuenta analítica en un apunte contable de " +"este tipo de cuenta; si selecciona 'Siempre', el contable recibirá un " +"mensaje de error si el apunte no tiene cuenta analítica; si selecciona " +"'Nunca', el contable recibirá un mensaje de error si el apunte tiene una " +"cuenta analítica." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Opcional" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" +msgstr "" +"Este módulo añade una opción \"política analítica\" a los tipos contables. " +"Puede escoger entre 3 políticas: 'Siempre', 'Nunca' y 'Opcional'.\n" +"\n" +"Por ejemplo, si quiere tener una cuenta analítica de todos sus gastos, " +"seleccione la política \"Siempre\" para el tipo contable \"Gasto\"; " +"entonces, si intenta guardar un apunte contable de tipo contable \"Gasto\" " +"sin cuenta analítica, obtendrá un mensaje de error.\n" +"\n" +"Módulo desarrollado por Alexis de Lattre " +"durante la carrera de código Akretion-Camptocamp de junio de 2011.\n" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "No puede crear un apunte en una cuenta cerrada." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Siempre" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Nunca" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "La cuenta analítica es requerida." + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "¡Valor erróneo en el debe o en el haber del asiento contable!" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "No puede crear un apunte en una cuenta de tipo \"Vista\"." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "Apuntes contables" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Tipo de cuenta" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "" +"La compañía debe ser la misma que la de las cuentas y los periodos " +"relacionados." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "Error:" diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po new file mode 100644 index 0000000000..cbfecc6fe9 --- /dev/null +++ b/account_analytic_required/i18n/fr.po @@ -0,0 +1,121 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.2\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2011-06-14 15:19+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-09-25 05:07+0000\n" +"X-Generator: Launchpad (build 16019)\n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "Politique pour les comptes analytiques" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Configurez la politique pour les comptes analytiques : si vous sélectionnez " +"'Optionnel', le comptable est libre de saisir ou non un compte analytique " +"sur une ligne comptable avec ce type de compte de comptabilité générale ; si " +"vous sélectionnez 'Toujours', le comptable aura un message d'erreur si il " +"n'y a pas de compte analytique ; si vous sélectionnez 'Jamais', le comptable " +"aura un message d'erreur si un compte analytique est présent." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Optionnel" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" +msgstr "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "Impossible de créer une ligne d'écriture sur un compte clôturé" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Toujours" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Jamais" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "Account analytic required" + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "Valeur erronée au crédit ou au débit de la pièce comptable !" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "" +"Vous ne pouvez pas créer de ligne d'écriture sur un compte de type \"Vue\"." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "Écritures comptables" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Type de compte" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "La société doit être la même pour les comptes et périodes liées." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "Erreur :" From 96443a60f6ada0637efe066b65b827834e23bb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Mon, 17 Dec 2012 14:22:09 +0100 Subject: [PATCH 02/89] [IMP] account_analytic_required: do not enforce policy when credit=debit=0.0 This is useful in some situations where the tax generates move lines with credit=debit=0.0 with a non-zero tax amount (for instance with tax code VAT-IN-V82-21-EU-S in l10n_be). Without this patch the transaction would be rejected when analytic policy is 'required', since analytic accounts are not propagated through taxes in 6.1. --- account_analytic_required/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index 6e47fddbaa..65a856664b 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -47,7 +47,7 @@ class account_move_line(osv.osv): _inherit = "account.move.line" def check_analytic_required(self, cr, uid, vals, context=None): - if vals.has_key('account_id'): + if vals.has_key('account_id') and (vals.get('debit',0.0) != 0.0 or vals.get('credit',0.0) != 0.0): account = self.pool.get('account.account').browse(cr, uid, vals['account_id'], context=context) if account.user_type.analytic_policy == 'always' and not vals.get('analytic_account_id', False): raise osv.except_osv(_('Error :'), _("Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." % (account.code, account.name, vals.get('name', False)))) From afaf753366cc25a3aaa5e0a740c1940e2847b7ee Mon Sep 17 00:00:00 2001 From: Joel Grand-Guillaume Date: Wed, 3 Apr 2013 16:39:30 +0200 Subject: [PATCH 03/89] [MIGR] Set installable = False in modules to setup the 7.0 series --- account_analytic_required/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index b7a9b7c541..5b88ded0b5 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -38,7 +38,7 @@ 'init_xml': [], 'update_xml': ['account_view.xml'], 'demo_xml': [], - 'installable': True, + 'installable': False, 'active': False, } From bdbbe1c5abaae4507038f8e2f224aaac1bb3a1e1 Mon Sep 17 00:00:00 2001 From: Laetitia Gangloff Date: Thu, 4 Apr 2013 18:26:47 +0200 Subject: [PATCH 04/89] account_analytic_required: migration V7 --- account_analytic_required/__openerp__.py | 4 ++-- account_analytic_required/account.py | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index 5b88ded0b5..a193c8ddd2 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -23,7 +23,7 @@ { 'name': 'Account analytic required', - 'version': '0.1', + 'version': '0.2', 'category': 'Generic Modules/Accounting', 'license': 'AGPL-3', 'description': """This module adds an option "analytic policy" on account types. You have the choice between 3 policies : always, never and optional. @@ -38,7 +38,7 @@ 'init_xml': [], 'update_xml': ['account_view.xml'], 'demo_xml': [], - 'installable': False, + 'installable': True, 'active': False, } diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index 65a856664b..47d56b7694 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -21,11 +21,11 @@ # ############################################################################## -from osv import fields, osv +from openerp.osv import orm, fields from tools.translate import _ -class account_account_type(osv.osv): +class account_account_type(orm.Model): _inherit = "account.account.type" _columns = { @@ -40,20 +40,17 @@ class account_account_type(osv.osv): 'analytic_policy': lambda *a: 'optional', } -account_account_type() - - -class account_move_line(osv.osv): +class account_move_line(orm.Model): _inherit = "account.move.line" def check_analytic_required(self, cr, uid, vals, context=None): if vals.has_key('account_id') and (vals.get('debit',0.0) != 0.0 or vals.get('credit',0.0) != 0.0): account = self.pool.get('account.account').browse(cr, uid, vals['account_id'], context=context) if account.user_type.analytic_policy == 'always' and not vals.get('analytic_account_id', False): - raise osv.except_osv(_('Error :'), _("Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." % (account.code, account.name, vals.get('name', False)))) + raise orm.except_orm(_('Error :'), _("Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." % (account.code, account.name, vals.get('name', False)))) elif account.user_type.analytic_policy == 'never' and vals.get('analytic_account_id', False): cur_analytic_account = self.pool.get('account.analytic.account').read(cr, uid, vals['analytic_account_id'], ['name', 'code'], context=context) - raise osv.except_osv(_('Error :'), _("Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." % (account.code, account.name, vals.get('name', False), cur_analytic_account['code'], cur_analytic_account['name']))) + raise orm.except_orm(_('Error :'), _("Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." % (account.code, account.name, vals.get('name', False), cur_analytic_account['code'], cur_analytic_account['name']))) return True def create(self, cr, uid, vals, context=None, check=True): @@ -64,4 +61,3 @@ def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True) self.check_analytic_required(cr, uid, vals, context=context) return super(account_move_line, self).write(cr, uid, ids, vals, context=context, check=check, update_check=update_check) -account_move_line() From 64e75a14a0ac03ece655cb0d9de2807cc3149dde Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Thu, 18 Apr 2013 23:02:33 +0200 Subject: [PATCH 05/89] [FIX] Move substitution arguments out of _() call [RFR] Line length of affected code [UPD] Update pot file with newly generated code strings [ADD] Dutch translations --- account_analytic_required/account.py | 17 +++- .../i18n/account_analytic_required.pot | 15 +++- account_analytic_required/i18n/nl.po | 78 +++++++++++++++++++ 3 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 account_analytic_required/i18n/nl.po diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index 47d56b7694..4fde451ea1 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -47,10 +47,22 @@ def check_analytic_required(self, cr, uid, vals, context=None): if vals.has_key('account_id') and (vals.get('debit',0.0) != 0.0 or vals.get('credit',0.0) != 0.0): account = self.pool.get('account.account').browse(cr, uid, vals['account_id'], context=context) if account.user_type.analytic_policy == 'always' and not vals.get('analytic_account_id', False): - raise orm.except_orm(_('Error :'), _("Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." % (account.code, account.name, vals.get('name', False)))) + raise osv.except_osv( + _('Error :'), + _("Analytic policy is set to 'Always' with account %s '%s' " + "but the analytic account is missing in the account move " + "line with label '%s'.") % ( + account.code, account.name, vals.get('name', False))) elif account.user_type.analytic_policy == 'never' and vals.get('analytic_account_id', False): cur_analytic_account = self.pool.get('account.analytic.account').read(cr, uid, vals['analytic_account_id'], ['name', 'code'], context=context) - raise orm.except_orm(_('Error :'), _("Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." % (account.code, account.name, vals.get('name', False), cur_analytic_account['code'], cur_analytic_account['name']))) + raise osv.except_osv( + _('Error :'), + _("Analytic policy is set to 'Never' with account %s '%s' " + "but the account move line with label '%s' has an " + "analytic account %s '%s'.") % ( + account.code, account.name, vals.get('name', False), + cur_analytic_account['code'], + cur_analytic_account['name'])) return True def create(self, cr, uid, vals, context=None, check=True): @@ -60,4 +72,3 @@ def create(self, cr, uid, vals, context=None, check=True): def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): self.check_analytic_required(cr, uid, vals, context=context) return super(account_move_line, self).write(cr, uid, ids, vals, context=context, check=check, update_check=update_check) - diff --git a/account_analytic_required/i18n/account_analytic_required.pot b/account_analytic_required/i18n/account_analytic_required.pot index 6724a8fcd3..b9d7fd8cd8 100644 --- a/account_analytic_required/i18n/account_analytic_required.pot +++ b/account_analytic_required/i18n/account_analytic_required.pot @@ -86,9 +86,20 @@ msgid "Company must be same for its related account and period." msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 +#: code:addons/account_analytic_required/account.py:54 +#: code:addons/account_analytic_required/account.py:62 #, python-format msgid "Error :" msgstr "" +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:55 +#, python-format +msgid "Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." +msgstr "" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:63 +#, python-format +msgid "Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." +msgstr "" diff --git a/account_analytic_required/i18n/nl.po b/account_analytic_required/i18n/nl.po new file mode 100644 index 0000000000..858970d417 --- /dev/null +++ b/account_analytic_required/i18n/nl.po @@ -0,0 +1,78 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2013-04-17 07:49+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "Kostenplaatsenbeleid" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Never', the accountant will get an error message if an analytic account is present." +msgstr "Stel het beleid in voor kostenplaatsen: bij 'Altijd' is het opgeven van een kostenplaats verplicht bij rekeningen van dit type. 'Nooit': er treedt een foutmelding op als er bij een boeking een kostenplaats wordt opgegeven. 'Optioneel': het staat de medewerker vrij om al dan niet een kostenplaats op te geven." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Optioneel" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "This module adds an option 'analytic policy' on account types. You have the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, set the policy to 'always' for the account type 'expense' ; then, if you try to save an account move line with an account of type 'expense' without analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011.\n" +msgstr "Deze module voegt de optie 'Beleid kostenplaatsen' toe aan rekeningcategorieën. Er zijn drie mogelijkheden: altijd, nooit en optioneel.\n" +"\n" +"Bij voorbeeld, als je wilt afdwingen dat er altijd een kostenplaats wordt opgegeven bij boekingen op een kostenrekening, zet dan het beleid op 'altijd' voor het rekeningtype 'Kosten'. Vanaf dat moment krijgt de medewerker een foutmelding als er geprobeerd wordt om een boeking te maken op een rekening van dit type zonder dat er een kostenplaats is opgegeven.\n" +"\n" +"Deze module is ontwikkeld door Alexis de Lattre tijdens de Akretion-Camptocamp code sprint van juni 2011.\n" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Altijd" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Nooit" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "Kostenplaatsenbeleid" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:54 +#: code:addons/account_analytic_required/account.py:62 +#, python-format +msgid "Error :" +msgstr "Fout:" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:55 +#, python-format +msgid "Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." +msgstr "Het is verplicht een kostenplaats op te geven bij boekingen op rekening %s '%s', maar deze ontbreekt in de boekingsregel met de omschrijving '%s'." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:63 +#, python-format +msgid "Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." +msgstr "Het is niet toegestaan om een kostenplaats op te geven bij boekingen op rekening %s '%s', maar in boekingsregel met de omschrijving '%s' staat toch de kostenplaats %s '%s'." From 3de70be779ad99a3c2a88da4bbde3e03eb594625 Mon Sep 17 00:00:00 2001 From: Laetitia Gangloff Date: Tue, 23 Apr 2013 16:25:48 +0200 Subject: [PATCH 06/89] account_analytic_required: in openerp.py replace *_xml by data, leave two lines before new class. --- account_analytic_required/__openerp__.py | 4 +--- account_analytic_required/account.py | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index a193c8ddd2..55f4dbdd25 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -35,9 +35,7 @@ 'author': 'Akretion', 'website': 'http://www.akretion.com/', 'depends': ['account'], - 'init_xml': [], - 'update_xml': ['account_view.xml'], - 'demo_xml': [], + 'data': ['account_view.xml'], 'installable': True, 'active': False, } diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index 4fde451ea1..e63d085cba 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -40,6 +40,7 @@ class account_account_type(orm.Model): 'analytic_policy': lambda *a: 'optional', } + class account_move_line(orm.Model): _inherit = "account.move.line" From 841c7c982cb354fa284895877b88a58f9d295785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 18 Apr 2014 15:28:34 +0200 Subject: [PATCH 07/89] [IMP] account_analytic_required/tests --- account_analytic_required/tests/__init__.py | 30 +++++ .../tests/test_account_analytic_required.py | 125 ++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 account_analytic_required/tests/__init__.py create mode 100644 account_analytic_required/tests/test_account_analytic_required.py diff --git a/account_analytic_required/tests/__init__.py b/account_analytic_required/tests/__init__.py new file mode 100644 index 0000000000..85d610f4eb --- /dev/null +++ b/account_analytic_required/tests/__init__.py @@ -0,0 +1,30 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2014 Acsone (http://acsone.eu). All Rights Reserved +# @author Stéphane Bidoul +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import test_account_analytic_required + +fast_suite = [ +] + +checks = [ + test_account_analytic_required, +] diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py new file mode 100644 index 0000000000..4a1fb242a7 --- /dev/null +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -0,0 +1,125 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2014 Acsone (http://acsone.eu). All Rights Reserved +# @author Stéphane Bidoul +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from datetime import datetime + +from openerp.tests import common +from openerp.osv import orm + + +class test_account_analytic_required(common.TransactionCase): + + def setUp(self): + super(test_account_analytic_required, self).setUp() + self.account_obj = self.registry('account.account') + self.account_type_obj = self.registry('account.account.type') + self.move_obj = self.registry('account.move') + self.move_line_obj = self.registry('account.move.line') + self.analytic_account_obj = self.registry('account.analytic.account') + self.analytic_account_id = self.analytic_account_obj.create( + self.cr, self.uid, {'name': 'test aa', 'type': 'normal'}) + + def _create_move(self, with_analytic, amount=100): + date = datetime.now() + period_id = self.registry('account.period').find( + self.cr, self.uid, date, + context={'account_period_prefer_normal': True})[0] + move_vals = { + 'journal_id': self.ref('account.sales_journal'), + 'period_id': period_id, + 'date': date, + } + move_id = self.move_obj.create(self.cr, self.uid, move_vals) + self.move_line_obj.create( + self.cr, self.uid, + {'move_id': move_id, + 'name': '/', + 'debit': 0, + 'credit': amount, + 'account_id': self.ref('account.a_sale'), + 'analytic_account_id': self.analytic_account_id if with_analytic else False}) + move_line_id = self.move_line_obj.create( + self.cr, self.uid, + {'move_id': move_id, + 'name': '/', + 'debit': amount, + 'credit': 0, + 'account_id': self.ref('account.a_recv')}) + return move_line_id + + def _set_analytic_policy(self, policy, aref='account.a_sale'): + account_type = self.account_obj.browse(self.cr, self.uid, + self.ref(aref)).user_type + self.account_type_obj.write(self.cr, self.uid, account_type.id, + {'analytic_policy': policy}) + + def test_optional(self): + self._create_move(with_analytic=False) + self._create_move(with_analytic=True) + + def test_always_no_analytic(self): + self._set_analytic_policy('always') + with self.assertRaises(orm.except_orm): + self._create_move(with_analytic=False) + + def test_always_no_analytic_0(self): + # accept missing analytic account when debit=credit=0 + self._set_analytic_policy('always') + self._create_move(with_analytic=False, amount=0) + + def test_always_with_analytic(self): + self._set_analytic_policy('always') + self._create_move(with_analytic=True) + + def test_never_no_analytic(self): + self._set_analytic_policy('never') + self._create_move(with_analytic=False) + + def test_never_with_analytic(self): + self._set_analytic_policy('never') + with self.assertRaises(orm.except_orm): + self._create_move(with_analytic=True) + + def test_never_with_analytic_0(self): + # accept analytic when debit=credit=0 + self._set_analytic_policy('never') + self._create_move(with_analytic=True, amount=0) + + def test_always_remove_analytic(self): + # remove partner when policy is always + self._set_analytic_policy('always') + line_id = self._create_move(with_analytic=True) + with self.assertRaises(orm.except_orm): + self.move_line_obj.write(self.cr, self.uid, line_id, + {'analytic_account_id': False}) + + def test_change_account(self): + self._set_analytic_policy('always', aref='account.a_expense') + line_id = self._create_move(with_analytic=False) + # change account to a_pay with policy always but missing partner + with self.assertRaises(orm.except_orm): + self.move_line_obj.write(self.cr, self.uid, line_id, + {'account_id': self.ref('account.a_expense')}) + # change account to a_pay with policy always with partner -> ok + self.move_line_obj.write(self.cr, self.uid, line_id, + {'account_id': self.ref('account.a_expense'), + 'analytic_account_id': self.analytic.account_id}) From 71478d6e750ad93f1616755b4b9037519fb478b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 18 Apr 2014 15:45:56 +0200 Subject: [PATCH 08/89] [FIX] account_analytic_required allowed policy violation to slip through when changing analytic account --- account_analytic_required/account.py | 43 ++++++++----------- .../tests/test_account_analytic_required.py | 8 ++-- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index e63d085cba..02cfcc96e0 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -44,32 +44,27 @@ class account_account_type(orm.Model): class account_move_line(orm.Model): _inherit = "account.move.line" - def check_analytic_required(self, cr, uid, vals, context=None): - if vals.has_key('account_id') and (vals.get('debit',0.0) != 0.0 or vals.get('credit',0.0) != 0.0): - account = self.pool.get('account.account').browse(cr, uid, vals['account_id'], context=context) - if account.user_type.analytic_policy == 'always' and not vals.get('analytic_account_id', False): - raise osv.except_osv( - _('Error :'), - _("Analytic policy is set to 'Always' with account %s '%s' " - "but the analytic account is missing in the account move " - "line with label '%s'.") % ( - account.code, account.name, vals.get('name', False))) - elif account.user_type.analytic_policy == 'never' and vals.get('analytic_account_id', False): - cur_analytic_account = self.pool.get('account.analytic.account').read(cr, uid, vals['analytic_account_id'], ['name', 'code'], context=context) - raise osv.except_osv( - _('Error :'), - _("Analytic policy is set to 'Never' with account %s '%s' " - "but the account move line with label '%s' has an " - "analytic account %s '%s'.") % ( - account.code, account.name, vals.get('name', False), - cur_analytic_account['code'], - cur_analytic_account['name'])) + def check_analytic_required(self, cr, uid, ids, vals, context=None): + if 'account_id' in vals or 'analytic_account_id' in vals or \ + 'debit' in vals or 'credit' in vals: + if isinstance(ids, (int, long)): + ids = [ids] + for move_line in self.browse(cr, uid, ids, context): + if move_line.debit == 0 and move_line.credit == 0: + continue + analytic_policy = move_line.account_id.user_type.analytic_policy + if analytic_policy == 'always' and not move_line.analytic_account_id: + raise orm.except_orm(_('Error :'), _("Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." % (move_line.account_id.code, move_line.account_id.name, move_line.name))) + elif analytic_policy == 'never' and move_line.analytic_account_id: + raise orm.except_orm(_('Error :'), _("Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." % (move_line.account_id.code, move_line.account_id.name, move_line.name, move_line.analytic_account_id.code, move_line.analytic_account_id.name))) return True def create(self, cr, uid, vals, context=None, check=True): - self.check_analytic_required(cr, uid, vals, context=context) - return super(account_move_line, self).create(cr, uid, vals, context=context, check=check) + line_id = super(account_move_line, self).create(cr, uid, vals, context=context, check=check) + self.check_analytic_required(cr, uid, line_id, vals, context=context) + return line_id def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): - self.check_analytic_required(cr, uid, vals, context=context) - return super(account_move_line, self).write(cr, uid, ids, vals, context=context, check=check, update_check=update_check) + res = super(account_move_line, self).write(cr, uid, ids, vals, context=context, check=check, update_check=update_check) + self.check_analytic_required(cr, uid, ids, vals, context=context) + return res diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index 4a1fb242a7..5122e99925 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -49,7 +49,7 @@ def _create_move(self, with_analytic, amount=100): 'date': date, } move_id = self.move_obj.create(self.cr, self.uid, move_vals) - self.move_line_obj.create( + move_line_id = self.move_line_obj.create( self.cr, self.uid, {'move_id': move_id, 'name': '/', @@ -57,7 +57,7 @@ def _create_move(self, with_analytic, amount=100): 'credit': amount, 'account_id': self.ref('account.a_sale'), 'analytic_account_id': self.analytic_account_id if with_analytic else False}) - move_line_id = self.move_line_obj.create( + self.move_line_obj.create( self.cr, self.uid, {'move_id': move_id, 'name': '/', @@ -115,11 +115,11 @@ def test_always_remove_analytic(self): def test_change_account(self): self._set_analytic_policy('always', aref='account.a_expense') line_id = self._create_move(with_analytic=False) - # change account to a_pay with policy always but missing partner + # change account to a_pay with policy always but missing analytic_account with self.assertRaises(orm.except_orm): self.move_line_obj.write(self.cr, self.uid, line_id, {'account_id': self.ref('account.a_expense')}) # change account to a_pay with policy always with partner -> ok self.move_line_obj.write(self.cr, self.uid, line_id, {'account_id': self.ref('account.a_expense'), - 'analytic_account_id': self.analytic.account_id}) + 'analytic_account_id': self.analytic_account_id}) From 3243d0c11d70a6d98a45269810abccc36949f247 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 19 Apr 2014 00:24:50 +0200 Subject: [PATCH 09/89] Validate with flake8. Update import path. --- account_analytic_required/__init__.py | 2 +- account_analytic_required/__openerp__.py | 15 +++-- account_analytic_required/account.py | 59 +++++++++++++++---- .../tests/test_account_analytic_required.py | 18 +++--- 4 files changed, 67 insertions(+), 27 deletions(-) diff --git a/account_analytic_required/__init__.py b/account_analytic_required/__init__.py index 71b2d9b732..fdc3ea32b8 100644 --- a/account_analytic_required/__init__.py +++ b/account_analytic_required/__init__.py @@ -21,4 +21,4 @@ ############################################################################## -import account +from . import account diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index 55f4dbdd25..7e392b5bae 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -2,7 +2,7 @@ ############################################################################## # # Account analytic required module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011 Akretion (http://www.akretion.com) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -22,13 +22,17 @@ { - 'name': 'Account analytic required', + 'name': 'Account Analytic Required', 'version': '0.2', - 'category': 'Generic Modules/Accounting', + 'category': 'Analytic Accounting', 'license': 'AGPL-3', - 'description': """This module adds an option "analytic policy" on account types. You have the choice between 3 policies : always, never and optional. + 'description': """ +Account Analytic Required +========================= -For example, if you want to have an analytic account on all your expenses, set the policy to "always" for the account type "expense" ; then, if you try to save an account move line with an account of type "expense" without analytic account, you will get an error message. +This module adds an option *analytic policy* on account types. You have the choice between 3 policies : *always*, *never* and *optional*. + +For example, if you want to have an analytic account on all your expenses, set the policy to *always* for the account type *expense* ; then, if you try to save an account move line with an account of type *expense* without analytic account, you will get an error message. Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011. """, @@ -39,4 +43,3 @@ 'installable': True, 'active': False, } - diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index 02cfcc96e0..a5de6c1116 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -2,7 +2,7 @@ ############################################################################## # # Account analytic required module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011 Akretion (http://www.akretion.com) # @author Alexis de Lattre # Developped during the Akretion-Camptocamp code sprint of June 2011 # @@ -22,22 +22,29 @@ ############################################################################## from openerp.osv import orm, fields -from tools.translate import _ +from openerp.tools.translate import _ class account_account_type(orm.Model): _inherit = "account.account.type" _columns = { - 'analytic_policy' : fields.selection([ + 'analytic_policy': fields.selection([ ('optional', 'Optional'), ('always', 'Always'), ('never', 'Never') - ], 'Policy for analytic account', help="Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Never', the accountant will get an error message if an analytic account is present."), + ], 'Policy for analytic account', + help="Set the policy for analytic accounts : if you select " + "'Optional', the accountant is free to put an analytic account " + "on an account move line with this type of account ; if you " + "select 'Always', the accountant will get an error message if " + "there is no analytic account ; if you select 'Never', the " + "accountant will get an error message if an analytic account " + "is present."), } _defaults = { - 'analytic_policy': lambda *a: 'optional', + 'analytic_policy': 'optional', } @@ -52,19 +59,45 @@ def check_analytic_required(self, cr, uid, ids, vals, context=None): for move_line in self.browse(cr, uid, ids, context): if move_line.debit == 0 and move_line.credit == 0: continue - analytic_policy = move_line.account_id.user_type.analytic_policy - if analytic_policy == 'always' and not move_line.analytic_account_id: - raise orm.except_orm(_('Error :'), _("Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." % (move_line.account_id.code, move_line.account_id.name, move_line.name))) - elif analytic_policy == 'never' and move_line.analytic_account_id: - raise orm.except_orm(_('Error :'), _("Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." % (move_line.account_id.code, move_line.account_id.name, move_line.name, move_line.analytic_account_id.code, move_line.analytic_account_id.name))) + analytic_policy = \ + move_line.account_id.user_type.analytic_policy + if analytic_policy == 'always' and \ + not move_line.analytic_account_id: + raise orm.except_orm( + _('Error :'), + _("Analytic policy is set to 'Always' with account " + "%s '%s' but the analytic account is missing in " + "the account move line with label '%s'.") + % ( + move_line.account_id.code, + move_line.account_id.name, + move_line.name)) + elif analytic_policy == 'never' and \ + move_line.analytic_account_id: + raise orm.except_orm( + _('Error :'), + _("Analytic policy is set to 'Never' with account %s " + "'%s' but the account move line with label '%s' " + "has an analytic account %s '%s'.") + % ( + move_line.account_id.code, + move_line.account_id.name, + move_line.name, + move_line.analytic_account_id.code, + move_line.analytic_account_id.name)) return True def create(self, cr, uid, vals, context=None, check=True): - line_id = super(account_move_line, self).create(cr, uid, vals, context=context, check=check) + line_id = super(account_move_line, self).create( + cr, uid, vals, context=context, check=check) self.check_analytic_required(cr, uid, line_id, vals, context=context) return line_id - def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): - res = super(account_move_line, self).write(cr, uid, ids, vals, context=context, check=check, update_check=update_check) + def write( + self, cr, uid, ids, vals, context=None, check=True, + update_check=True): + res = super(account_move_line, self).write( + cr, uid, ids, vals, context=context, check=check, + update_check=update_check) self.check_analytic_required(cr, uid, ids, vals, context=context) return res diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index 5122e99925..f246028d0a 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -56,7 +56,8 @@ def _create_move(self, with_analytic, amount=100): 'debit': 0, 'credit': amount, 'account_id': self.ref('account.a_sale'), - 'analytic_account_id': self.analytic_account_id if with_analytic else False}) + 'analytic_account_id': + self.analytic_account_id if with_analytic else False}) self.move_line_obj.create( self.cr, self.uid, {'move_id': move_id, @@ -115,11 +116,14 @@ def test_always_remove_analytic(self): def test_change_account(self): self._set_analytic_policy('always', aref='account.a_expense') line_id = self._create_move(with_analytic=False) - # change account to a_pay with policy always but missing analytic_account + # change account to a_pay with policy always but missing + # analytic_account with self.assertRaises(orm.except_orm): - self.move_line_obj.write(self.cr, self.uid, line_id, - {'account_id': self.ref('account.a_expense')}) + self.move_line_obj.write( + self.cr, self.uid, line_id, + {'account_id': self.ref('account.a_expense')}) # change account to a_pay with policy always with partner -> ok - self.move_line_obj.write(self.cr, self.uid, line_id, - {'account_id': self.ref('account.a_expense'), - 'analytic_account_id': self.analytic_account_id}) + self.move_line_obj.write( + self.cr, self.uid, line_id, { + 'account_id': self.ref('account.a_expense'), + 'analytic_account_id': self.analytic_account_id}) From dafd43231d0b6040d6fd895b8835602ce91d2185 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 19 Apr 2014 00:29:24 +0200 Subject: [PATCH 10/89] Add policy for analytic accounting in tree view. --- account_analytic_required/account_view.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/account_analytic_required/account_view.xml b/account_analytic_required/account_view.xml index def05a1e85..5ae1b50a34 100644 --- a/account_analytic_required/account_view.xml +++ b/account_analytic_required/account_view.xml @@ -15,7 +15,18 @@ - + + + + + + + account_analytic_required.account_type_tree + account.account.type + + + + From 92bfe98b950d4b24ddf215fdcc4153634502e2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 19 Apr 2014 12:20:24 +0200 Subject: [PATCH 11/89] [IMP] comments in test suite + long lines __openerp__.py --- account_analytic_required/__openerp__.py | 11 ++++++++--- .../tests/test_account_analytic_required.py | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index 7e392b5bae..1da3b3322a 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -30,11 +30,16 @@ Account Analytic Required ========================= -This module adds an option *analytic policy* on account types. You have the choice between 3 policies : *always*, *never* and *optional*. +This module adds an option *analytic policy* on account types. +You have the choice between 3 policies : *always*, *never* and *optional*. -For example, if you want to have an analytic account on all your expenses, set the policy to *always* for the account type *expense* ; then, if you try to save an account move line with an account of type *expense* without analytic account, you will get an error message. +For example, if you want to have an analytic account on all your expenses, +set the policy to *always* for the account type *expense* ; then, if you +try to save an account move line with an account of type *expense* +without analytic account, you will get an error message. -Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011. +Module developped by Alexis de Lattre +during the Akretion-Camptocamp code sprint of June 2011. """, 'author': 'Akretion', 'website': 'http://www.akretion.com/', diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index f246028d0a..39bc393d11 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -116,13 +116,14 @@ def test_always_remove_analytic(self): def test_change_account(self): self._set_analytic_policy('always', aref='account.a_expense') line_id = self._create_move(with_analytic=False) - # change account to a_pay with policy always but missing + # change account to a_expense with policy always but missing # analytic_account with self.assertRaises(orm.except_orm): self.move_line_obj.write( self.cr, self.uid, line_id, {'account_id': self.ref('account.a_expense')}) - # change account to a_pay with policy always with partner -> ok + # change account to a_expense with policy always + # with analytic account -> ok self.move_line_obj.write( self.cr, self.uid, line_id, { 'account_id': self.ref('account.a_expense'), From 4885efcc43931772d3d24fc8b4b4968f9bb9b2bb Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of account-core-editors Date: Fri, 27 Jun 2014 07:09:00 +0000 Subject: [PATCH 12/89] Launchpad automatic translations update. --- account_analytic_required/i18n/ar.po | 8 ++++---- account_analytic_required/i18n/ca.po | 6 +++--- account_analytic_required/i18n/es.po | 6 +++--- account_analytic_required/i18n/fr.po | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po index 9452af052f..870152419f 100644 --- a/account_analytic_required/i18n/ar.po +++ b/account_analytic_required/i18n/ar.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2012-02-08 07:01+0000\n" -"Last-Translator: husam \n" +"PO-Revision-Date: 2014-06-26 11:15+0000\n" +"Last-Translator: Pedro Manuel Baeza \n" "Language-Team: Arabic \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-09-25 05:07+0000\n" -"X-Generator: Launchpad (build 16019)\n" +"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" +"X-Generator: Launchpad (build 17077)\n" #. module: account_analytic_required #: field:account.account.type,analytic_policy:0 diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po index f812bd33e9..9048d66262 100644 --- a/account_analytic_required/i18n/ca.po +++ b/account_analytic_required/i18n/ca.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0.2\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2011-06-24 10:26+0000\n" +"PO-Revision-Date: 2014-06-26 11:18+0000\n" "Last-Translator: jmartin (Zikzakmedia) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-09-25 05:07+0000\n" -"X-Generator: Launchpad (build 16019)\n" +"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" +"X-Generator: Launchpad (build 17077)\n" #. module: account_analytic_required #: field:account.account.type,analytic_policy:0 diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po index 38626e05e0..8e21c58500 100644 --- a/account_analytic_required/i18n/es.po +++ b/account_analytic_required/i18n/es.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0.2\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2011-06-24 10:25+0000\n" +"PO-Revision-Date: 2014-06-26 11:18+0000\n" "Last-Translator: jmartin (Zikzakmedia) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-09-25 05:07+0000\n" -"X-Generator: Launchpad (build 16019)\n" +"X-Launchpad-Export-Date: 2014-06-27 07:09+0000\n" +"X-Generator: Launchpad (build 17077)\n" #. module: account_analytic_required #: field:account.account.type,analytic_policy:0 diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po index cbfecc6fe9..5b1a2fb2e6 100644 --- a/account_analytic_required/i18n/fr.po +++ b/account_analytic_required/i18n/fr.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0.2\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2011-06-14 15:19+0000\n" +"PO-Revision-Date: 2014-06-26 11:18+0000\n" "Last-Translator: Alexis de Lattre \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-09-25 05:07+0000\n" -"X-Generator: Launchpad (build 16019)\n" +"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" +"X-Generator: Launchpad (build 17077)\n" #. module: account_analytic_required #: field:account.account.type,analytic_policy:0 From e52520df2169a0033cd239295cfba73706f63c71 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Mon, 4 Aug 2014 18:57:44 +0200 Subject: [PATCH 13/89] lint the whole repo --- account_analytic_required/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/__init__.py b/account_analytic_required/__init__.py index fdc3ea32b8..7d859bce68 100644 --- a/account_analytic_required/__init__.py +++ b/account_analytic_required/__init__.py @@ -21,4 +21,4 @@ ############################################################################## -from . import account +from . import account # noqa From 09fc9faf2374ef3a17d0aaeb7e253128fe4ef5ca Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 5 Aug 2014 09:06:09 +0200 Subject: [PATCH 14/89] delete # noqa in __init__.py imports --- account_analytic_required/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/__init__.py b/account_analytic_required/__init__.py index 7d859bce68..fdc3ea32b8 100644 --- a/account_analytic_required/__init__.py +++ b/account_analytic_required/__init__.py @@ -21,4 +21,4 @@ ############################################################################## -from . import account # noqa +from . import account From 8a16133652e3e8d12aa258d9cb35927f64012494 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 5 Aug 2014 09:50:52 +0200 Subject: [PATCH 15/89] make all files not installable --- account_analytic_required/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index 1da3b3322a..7ec7866a20 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -45,6 +45,6 @@ 'website': 'http://www.akretion.com/', 'depends': ['account'], 'data': ['account_view.xml'], - 'installable': True, + 'installable': False, 'active': False, } From cde20fc4e69effb25226a59a3633f3a82630bee8 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 5 Aug 2014 09:51:27 +0200 Subject: [PATCH 16/89] move all modules to __unported__ --- account_analytic_required/__init__.py | 24 ---- account_analytic_required/__openerp__.py | 50 ------- account_analytic_required/account.py | 103 -------------- account_analytic_required/account_view.xml | 35 ----- .../i18n/account_analytic_required.pot | 105 -------------- account_analytic_required/i18n/ar.po | 120 ---------------- account_analytic_required/i18n/ca.po | 120 ---------------- account_analytic_required/i18n/es.po | 122 ---------------- account_analytic_required/i18n/fr.po | 121 ---------------- account_analytic_required/tests/__init__.py | 30 ---- .../tests/test_account_analytic_required.py | 130 ------------------ 11 files changed, 960 deletions(-) delete mode 100644 account_analytic_required/__init__.py delete mode 100644 account_analytic_required/__openerp__.py delete mode 100644 account_analytic_required/account.py delete mode 100644 account_analytic_required/account_view.xml delete mode 100644 account_analytic_required/i18n/account_analytic_required.pot delete mode 100644 account_analytic_required/i18n/ar.po delete mode 100644 account_analytic_required/i18n/ca.po delete mode 100644 account_analytic_required/i18n/es.po delete mode 100644 account_analytic_required/i18n/fr.po delete mode 100644 account_analytic_required/tests/__init__.py delete mode 100644 account_analytic_required/tests/test_account_analytic_required.py diff --git a/account_analytic_required/__init__.py b/account_analytic_required/__init__.py deleted file mode 100644 index fdc3ea32b8..0000000000 --- a/account_analytic_required/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -from . import account diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py deleted file mode 100644 index 7ec7866a20..0000000000 --- a/account_analytic_required/__openerp__.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -{ - 'name': 'Account Analytic Required', - 'version': '0.2', - 'category': 'Analytic Accounting', - 'license': 'AGPL-3', - 'description': """ -Account Analytic Required -========================= - -This module adds an option *analytic policy* on account types. -You have the choice between 3 policies : *always*, *never* and *optional*. - -For example, if you want to have an analytic account on all your expenses, -set the policy to *always* for the account type *expense* ; then, if you -try to save an account move line with an account of type *expense* -without analytic account, you will get an error message. - -Module developped by Alexis de Lattre -during the Akretion-Camptocamp code sprint of June 2011. -""", - 'author': 'Akretion', - 'website': 'http://www.akretion.com/', - 'depends': ['account'], - 'data': ['account_view.xml'], - 'installable': False, - 'active': False, -} diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py deleted file mode 100644 index a5de6c1116..0000000000 --- a/account_analytic_required/account.py +++ /dev/null @@ -1,103 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# Developped during the Akretion-Camptocamp code sprint of June 2011 -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp.osv import orm, fields -from openerp.tools.translate import _ - - -class account_account_type(orm.Model): - _inherit = "account.account.type" - - _columns = { - 'analytic_policy': fields.selection([ - ('optional', 'Optional'), - ('always', 'Always'), - ('never', 'Never') - ], 'Policy for analytic account', - help="Set the policy for analytic accounts : if you select " - "'Optional', the accountant is free to put an analytic account " - "on an account move line with this type of account ; if you " - "select 'Always', the accountant will get an error message if " - "there is no analytic account ; if you select 'Never', the " - "accountant will get an error message if an analytic account " - "is present."), - } - - _defaults = { - 'analytic_policy': 'optional', - } - - -class account_move_line(orm.Model): - _inherit = "account.move.line" - - def check_analytic_required(self, cr, uid, ids, vals, context=None): - if 'account_id' in vals or 'analytic_account_id' in vals or \ - 'debit' in vals or 'credit' in vals: - if isinstance(ids, (int, long)): - ids = [ids] - for move_line in self.browse(cr, uid, ids, context): - if move_line.debit == 0 and move_line.credit == 0: - continue - analytic_policy = \ - move_line.account_id.user_type.analytic_policy - if analytic_policy == 'always' and \ - not move_line.analytic_account_id: - raise orm.except_orm( - _('Error :'), - _("Analytic policy is set to 'Always' with account " - "%s '%s' but the analytic account is missing in " - "the account move line with label '%s'.") - % ( - move_line.account_id.code, - move_line.account_id.name, - move_line.name)) - elif analytic_policy == 'never' and \ - move_line.analytic_account_id: - raise orm.except_orm( - _('Error :'), - _("Analytic policy is set to 'Never' with account %s " - "'%s' but the account move line with label '%s' " - "has an analytic account %s '%s'.") - % ( - move_line.account_id.code, - move_line.account_id.name, - move_line.name, - move_line.analytic_account_id.code, - move_line.analytic_account_id.name)) - return True - - def create(self, cr, uid, vals, context=None, check=True): - line_id = super(account_move_line, self).create( - cr, uid, vals, context=context, check=check) - self.check_analytic_required(cr, uid, line_id, vals, context=context) - return line_id - - def write( - self, cr, uid, ids, vals, context=None, check=True, - update_check=True): - res = super(account_move_line, self).write( - cr, uid, ids, vals, context=context, check=check, - update_check=update_check) - self.check_analytic_required(cr, uid, ids, vals, context=context) - return res diff --git a/account_analytic_required/account_view.xml b/account_analytic_required/account_view.xml deleted file mode 100644 index 5ae1b50a34..0000000000 --- a/account_analytic_required/account_view.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - account_analytic_required.account_type_form - account.account.type - - - - - - - - - - account_analytic_required.account_type_tree - account.account.type - - - - - - - - - - diff --git a/account_analytic_required/i18n/account_analytic_required.pot b/account_analytic_required/i18n/account_analytic_required.pot deleted file mode 100644 index b9d7fd8cd8..0000000000 --- a/account_analytic_required/i18n/account_analytic_required.pot +++ /dev/null @@ -1,105 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_analytic_required -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0.2\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2011-06-10 07:49+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "" - -#. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Never', the accountant will get an error message if an analytic account is present." -msgstr "" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "" - -#. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information -msgid "This module adds an option \"analytic policy\" on account types. You have the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, set the policy to \"always\" for the account type \"expense\" ; then, if you try to save an account move line with an account of type \"expense\" without analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011.\n" -"" -msgstr "" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "" - -#. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "" - -#. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." -msgstr "" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." -msgstr "" - -#. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:54 -#: code:addons/account_analytic_required/account.py:62 -#, python-format -msgid "Error :" -msgstr "" - -#. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:55 -#, python-format -msgid "Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." -msgstr "" - -#. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:63 -#, python-format -msgid "Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." -msgstr "" diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po deleted file mode 100644 index 870152419f..0000000000 --- a/account_analytic_required/i18n/ar.po +++ /dev/null @@ -1,120 +0,0 @@ -# Arabic translation for openobject-addons -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2014-06-26 11:15+0000\n" -"Last-Translator: Pedro Manuel Baeza \n" -"Language-Team: Arabic \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" -"X-Generator: Launchpad (build 17077)\n" - -#. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "سياسة للحسابات التحليلية" - -#. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "" -"Set the policy for analytic accounts : if you select 'Optional', the " -"accountant is free to put an analytic account on an account move line with " -"this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." -msgstr "" -"ضع سياسة للحسابات التحليلية: إذا قمت بتحديد \"الاختياري\"، فان المحاسب حر في " -"وضع حساب تحليلي على حساب خط التحرك مع هذا النوع من الحساب، وإذا قمت بتحديد " -"\"دائما\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان هناك لا يوجد حساب " -"تحليلي، وإذا قمت بتحديد \"أبدا\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان " -"هناك حساب تحليلي موجود" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "إختياري" - -#. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information -msgid "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" -msgstr "" -"هذه الوحدة تضيف خيار \"السياسة التحليلية\" على أنواع الحسابات. لديك خيار بين " -"3 سياسات: دائما، أبدا، واختياري.\n" -"\n" -"على سبيل المثال، إذا كنت تريد أن يكون لديك حساب تحليلي عن جميع النفقات " -"الخاصة بك، اختار النهج \"دائما\" من أجل نوع الحساب\"مصروف\"، ثم، إذا حاولت " -"حفظ الحركة في حساب مع حساب \"مصروف\" من دون حساب تحليلي، وسوف تحصل على " -"رسالة خطأ.\n" -"\n" -"طورت الوحدة بواسطة اتر أليكسيس دي alexis.delattre@akretion.com> Akretion-" -"Camptocamp من يونيو 2011\n" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "لا يمكنك انشاء حركة على الحساب" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "دائماً" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "أبدًا" - -#. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "مطلوب حساب تحليلي" - -#. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "قيمة دائنة أو مدينة خاطئة في القيد المحاسبي !" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." -msgstr "لا يمكنك عمل حركة على هذا الحساب" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "عناصر دفتر اليومية" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "نوع الحساب" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." -msgstr "يجب ان تكون الشركة نفس فترتها وحسابها المتعلق بها." - -#. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 -#, python-format -msgid "Error :" -msgstr "خطأ :" diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po deleted file mode 100644 index 9048d66262..0000000000 --- a/account_analytic_required/i18n/ca.po +++ /dev/null @@ -1,120 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_analytic_required -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0.2\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2014-06-26 11:18+0000\n" -"Last-Translator: jmartin (Zikzakmedia) \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" -"X-Generator: Launchpad (build 17077)\n" - -#. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "Política per als comptes analítics" - -#. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "" -"Set the policy for analytic accounts : if you select 'Optional', the " -"accountant is free to put an analytic account on an account move line with " -"this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." -msgstr "" -"Configura la política per als comptes analítics: Si seleccioneu 'Opcional', " -"el comptable és lliure de posar un compte analític en un apunt comptable amb " -"aquest tipus de compte; si seleccioneu 'Sempre', el comptable rebrà un " -"missatge d'error si l'apunt no té compte analític; si seleccioneu 'Mai', el " -"comptable rebrà un missatge d'error si l'apunt té un compte analític." - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "Opcional" - -#. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information -msgid "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" -msgstr "" -"Aquest mòdul afegeix una opció \"política analítica\" als tipus comptables. " -"Podeu escollir entre 3 polítiques: 'Sempre', 'Mai' i 'Opcional'.\n" -"\n" -"Per exemple, si voleu tenir un compte analític de totes les vostres " -"despeses, seleccioneu la política \"Sempre\" per al tipus comptable " -"\"Despesa\"; llavors, si intenteu desar un apunt comptable de tipus " -"comptable \"Despesa\" sense compte analític, obtindreu un missatge d'error.\n" -"\n" -"Mòdul desenvolupat per Alexis de Lattre " -"durant la cursa de codi Akretion-Camptocamp de juny de 2011.\n" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "No podeu crear un apunt en un compte tancat." - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "Sempre" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "Mai" - -#. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "El compte analític és requerit." - -#. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "Valor erroni al deure o a l'haver de l'assentament comptable!" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." -msgstr "No podeu crear un apunt en un compte de tipus \"Vista\"." - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "Apunts comptables" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "Tipus de compte" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." -msgstr "" -"La companyia ha de ser la mateixa que la dels comptes i períodes relacionats." - -#. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 -#, python-format -msgid "Error :" -msgstr "Error:" diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po deleted file mode 100644 index 8e21c58500..0000000000 --- a/account_analytic_required/i18n/es.po +++ /dev/null @@ -1,122 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_analytic_required -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0.2\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2014-06-26 11:18+0000\n" -"Last-Translator: jmartin (Zikzakmedia) \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-27 07:09+0000\n" -"X-Generator: Launchpad (build 17077)\n" - -#. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "Política para las cuentas analíticas" - -#. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "" -"Set the policy for analytic accounts : if you select 'Optional', the " -"accountant is free to put an analytic account on an account move line with " -"this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." -msgstr "" -"Configura la política para las cuentas analíticas: Si selecciona 'Opcional', " -"el contable es libre de poner una cuenta analítica en un apunte contable de " -"este tipo de cuenta; si selecciona 'Siempre', el contable recibirá un " -"mensaje de error si el apunte no tiene cuenta analítica; si selecciona " -"'Nunca', el contable recibirá un mensaje de error si el apunte tiene una " -"cuenta analítica." - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "Opcional" - -#. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information -msgid "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" -msgstr "" -"Este módulo añade una opción \"política analítica\" a los tipos contables. " -"Puede escoger entre 3 políticas: 'Siempre', 'Nunca' y 'Opcional'.\n" -"\n" -"Por ejemplo, si quiere tener una cuenta analítica de todos sus gastos, " -"seleccione la política \"Siempre\" para el tipo contable \"Gasto\"; " -"entonces, si intenta guardar un apunte contable de tipo contable \"Gasto\" " -"sin cuenta analítica, obtendrá un mensaje de error.\n" -"\n" -"Módulo desarrollado por Alexis de Lattre " -"durante la carrera de código Akretion-Camptocamp de junio de 2011.\n" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "No puede crear un apunte en una cuenta cerrada." - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "Siempre" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "Nunca" - -#. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "La cuenta analítica es requerida." - -#. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "¡Valor erróneo en el debe o en el haber del asiento contable!" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." -msgstr "No puede crear un apunte en una cuenta de tipo \"Vista\"." - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "Apuntes contables" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "Tipo de cuenta" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." -msgstr "" -"La compañía debe ser la misma que la de las cuentas y los periodos " -"relacionados." - -#. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 -#, python-format -msgid "Error :" -msgstr "Error:" diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po deleted file mode 100644 index 5b1a2fb2e6..0000000000 --- a/account_analytic_required/i18n/fr.po +++ /dev/null @@ -1,121 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_analytic_required -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0.2\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2014-06-26 11:18+0000\n" -"Last-Translator: Alexis de Lattre \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" -"X-Generator: Launchpad (build 17077)\n" - -#. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "Politique pour les comptes analytiques" - -#. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "" -"Set the policy for analytic accounts : if you select 'Optional', the " -"accountant is free to put an analytic account on an account move line with " -"this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." -msgstr "" -"Configurez la politique pour les comptes analytiques : si vous sélectionnez " -"'Optionnel', le comptable est libre de saisir ou non un compte analytique " -"sur une ligne comptable avec ce type de compte de comptabilité générale ; si " -"vous sélectionnez 'Toujours', le comptable aura un message d'erreur si il " -"n'y a pas de compte analytique ; si vous sélectionnez 'Jamais', le comptable " -"aura un message d'erreur si un compte analytique est présent." - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "Optionnel" - -#. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information -msgid "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" -msgstr "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "Impossible de créer une ligne d'écriture sur un compte clôturé" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "Toujours" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "Jamais" - -#. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "Account analytic required" - -#. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "Valeur erronée au crédit ou au débit de la pièce comptable !" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." -msgstr "" -"Vous ne pouvez pas créer de ligne d'écriture sur un compte de type \"Vue\"." - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "Écritures comptables" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "Type de compte" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." -msgstr "La société doit être la même pour les comptes et périodes liées." - -#. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 -#, python-format -msgid "Error :" -msgstr "Erreur :" diff --git a/account_analytic_required/tests/__init__.py b/account_analytic_required/tests/__init__.py deleted file mode 100644 index 85d610f4eb..0000000000 --- a/account_analytic_required/tests/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2014 Acsone (http://acsone.eu). All Rights Reserved -# @author Stéphane Bidoul -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from . import test_account_analytic_required - -fast_suite = [ -] - -checks = [ - test_account_analytic_required, -] diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py deleted file mode 100644 index 39bc393d11..0000000000 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ /dev/null @@ -1,130 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2014 Acsone (http://acsone.eu). All Rights Reserved -# @author Stéphane Bidoul -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from datetime import datetime - -from openerp.tests import common -from openerp.osv import orm - - -class test_account_analytic_required(common.TransactionCase): - - def setUp(self): - super(test_account_analytic_required, self).setUp() - self.account_obj = self.registry('account.account') - self.account_type_obj = self.registry('account.account.type') - self.move_obj = self.registry('account.move') - self.move_line_obj = self.registry('account.move.line') - self.analytic_account_obj = self.registry('account.analytic.account') - self.analytic_account_id = self.analytic_account_obj.create( - self.cr, self.uid, {'name': 'test aa', 'type': 'normal'}) - - def _create_move(self, with_analytic, amount=100): - date = datetime.now() - period_id = self.registry('account.period').find( - self.cr, self.uid, date, - context={'account_period_prefer_normal': True})[0] - move_vals = { - 'journal_id': self.ref('account.sales_journal'), - 'period_id': period_id, - 'date': date, - } - move_id = self.move_obj.create(self.cr, self.uid, move_vals) - move_line_id = self.move_line_obj.create( - self.cr, self.uid, - {'move_id': move_id, - 'name': '/', - 'debit': 0, - 'credit': amount, - 'account_id': self.ref('account.a_sale'), - 'analytic_account_id': - self.analytic_account_id if with_analytic else False}) - self.move_line_obj.create( - self.cr, self.uid, - {'move_id': move_id, - 'name': '/', - 'debit': amount, - 'credit': 0, - 'account_id': self.ref('account.a_recv')}) - return move_line_id - - def _set_analytic_policy(self, policy, aref='account.a_sale'): - account_type = self.account_obj.browse(self.cr, self.uid, - self.ref(aref)).user_type - self.account_type_obj.write(self.cr, self.uid, account_type.id, - {'analytic_policy': policy}) - - def test_optional(self): - self._create_move(with_analytic=False) - self._create_move(with_analytic=True) - - def test_always_no_analytic(self): - self._set_analytic_policy('always') - with self.assertRaises(orm.except_orm): - self._create_move(with_analytic=False) - - def test_always_no_analytic_0(self): - # accept missing analytic account when debit=credit=0 - self._set_analytic_policy('always') - self._create_move(with_analytic=False, amount=0) - - def test_always_with_analytic(self): - self._set_analytic_policy('always') - self._create_move(with_analytic=True) - - def test_never_no_analytic(self): - self._set_analytic_policy('never') - self._create_move(with_analytic=False) - - def test_never_with_analytic(self): - self._set_analytic_policy('never') - with self.assertRaises(orm.except_orm): - self._create_move(with_analytic=True) - - def test_never_with_analytic_0(self): - # accept analytic when debit=credit=0 - self._set_analytic_policy('never') - self._create_move(with_analytic=True, amount=0) - - def test_always_remove_analytic(self): - # remove partner when policy is always - self._set_analytic_policy('always') - line_id = self._create_move(with_analytic=True) - with self.assertRaises(orm.except_orm): - self.move_line_obj.write(self.cr, self.uid, line_id, - {'analytic_account_id': False}) - - def test_change_account(self): - self._set_analytic_policy('always', aref='account.a_expense') - line_id = self._create_move(with_analytic=False) - # change account to a_expense with policy always but missing - # analytic_account - with self.assertRaises(orm.except_orm): - self.move_line_obj.write( - self.cr, self.uid, line_id, - {'account_id': self.ref('account.a_expense')}) - # change account to a_expense with policy always - # with analytic account -> ok - self.move_line_obj.write( - self.cr, self.uid, line_id, { - 'account_id': self.ref('account.a_expense'), - 'analytic_account_id': self.analytic_account_id}) From 29cb956d5d194b3d027d1a11a30f512d85e7ad4e Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Wed, 3 Sep 2014 16:17:48 +0200 Subject: [PATCH 17/89] [MOD] Move account_analytic_required out of __unported__ --- account_analytic_required/__init__.py | 24 ++++ account_analytic_required/__openerp__.py | 50 +++++++ account_analytic_required/account.py | 103 ++++++++++++++ account_analytic_required/account_view.xml | 35 +++++ .../i18n/account_analytic_required.pot | 94 +++++++++++++ account_analytic_required/i18n/ar.po | 120 ++++++++++++++++ account_analytic_required/i18n/ca.po | 120 ++++++++++++++++ account_analytic_required/i18n/es.po | 122 ++++++++++++++++ account_analytic_required/i18n/fr.po | 121 ++++++++++++++++ account_analytic_required/tests/__init__.py | 30 ++++ .../tests/test_account_analytic_required.py | 130 ++++++++++++++++++ 11 files changed, 949 insertions(+) create mode 100644 account_analytic_required/__init__.py create mode 100644 account_analytic_required/__openerp__.py create mode 100644 account_analytic_required/account.py create mode 100644 account_analytic_required/account_view.xml create mode 100644 account_analytic_required/i18n/account_analytic_required.pot create mode 100644 account_analytic_required/i18n/ar.po create mode 100644 account_analytic_required/i18n/ca.po create mode 100644 account_analytic_required/i18n/es.po create mode 100644 account_analytic_required/i18n/fr.po create mode 100644 account_analytic_required/tests/__init__.py create mode 100644 account_analytic_required/tests/test_account_analytic_required.py diff --git a/account_analytic_required/__init__.py b/account_analytic_required/__init__.py new file mode 100644 index 0000000000..fdc3ea32b8 --- /dev/null +++ b/account_analytic_required/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +from . import account diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py new file mode 100644 index 0000000000..7ec7866a20 --- /dev/null +++ b/account_analytic_required/__openerp__.py @@ -0,0 +1,50 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2011 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'Account Analytic Required', + 'version': '0.2', + 'category': 'Analytic Accounting', + 'license': 'AGPL-3', + 'description': """ +Account Analytic Required +========================= + +This module adds an option *analytic policy* on account types. +You have the choice between 3 policies : *always*, *never* and *optional*. + +For example, if you want to have an analytic account on all your expenses, +set the policy to *always* for the account type *expense* ; then, if you +try to save an account move line with an account of type *expense* +without analytic account, you will get an error message. + +Module developped by Alexis de Lattre +during the Akretion-Camptocamp code sprint of June 2011. +""", + 'author': 'Akretion', + 'website': 'http://www.akretion.com/', + 'depends': ['account'], + 'data': ['account_view.xml'], + 'installable': False, + 'active': False, +} diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py new file mode 100644 index 0000000000..a5de6c1116 --- /dev/null +++ b/account_analytic_required/account.py @@ -0,0 +1,103 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2011 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# Developped during the Akretion-Camptocamp code sprint of June 2011 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import orm, fields +from openerp.tools.translate import _ + + +class account_account_type(orm.Model): + _inherit = "account.account.type" + + _columns = { + 'analytic_policy': fields.selection([ + ('optional', 'Optional'), + ('always', 'Always'), + ('never', 'Never') + ], 'Policy for analytic account', + help="Set the policy for analytic accounts : if you select " + "'Optional', the accountant is free to put an analytic account " + "on an account move line with this type of account ; if you " + "select 'Always', the accountant will get an error message if " + "there is no analytic account ; if you select 'Never', the " + "accountant will get an error message if an analytic account " + "is present."), + } + + _defaults = { + 'analytic_policy': 'optional', + } + + +class account_move_line(orm.Model): + _inherit = "account.move.line" + + def check_analytic_required(self, cr, uid, ids, vals, context=None): + if 'account_id' in vals or 'analytic_account_id' in vals or \ + 'debit' in vals or 'credit' in vals: + if isinstance(ids, (int, long)): + ids = [ids] + for move_line in self.browse(cr, uid, ids, context): + if move_line.debit == 0 and move_line.credit == 0: + continue + analytic_policy = \ + move_line.account_id.user_type.analytic_policy + if analytic_policy == 'always' and \ + not move_line.analytic_account_id: + raise orm.except_orm( + _('Error :'), + _("Analytic policy is set to 'Always' with account " + "%s '%s' but the analytic account is missing in " + "the account move line with label '%s'.") + % ( + move_line.account_id.code, + move_line.account_id.name, + move_line.name)) + elif analytic_policy == 'never' and \ + move_line.analytic_account_id: + raise orm.except_orm( + _('Error :'), + _("Analytic policy is set to 'Never' with account %s " + "'%s' but the account move line with label '%s' " + "has an analytic account %s '%s'.") + % ( + move_line.account_id.code, + move_line.account_id.name, + move_line.name, + move_line.analytic_account_id.code, + move_line.analytic_account_id.name)) + return True + + def create(self, cr, uid, vals, context=None, check=True): + line_id = super(account_move_line, self).create( + cr, uid, vals, context=context, check=check) + self.check_analytic_required(cr, uid, line_id, vals, context=context) + return line_id + + def write( + self, cr, uid, ids, vals, context=None, check=True, + update_check=True): + res = super(account_move_line, self).write( + cr, uid, ids, vals, context=context, check=check, + update_check=update_check) + self.check_analytic_required(cr, uid, ids, vals, context=context) + return res diff --git a/account_analytic_required/account_view.xml b/account_analytic_required/account_view.xml new file mode 100644 index 0000000000..5ae1b50a34 --- /dev/null +++ b/account_analytic_required/account_view.xml @@ -0,0 +1,35 @@ + + + + + + + + account_analytic_required.account_type_form + account.account.type + + + + + + + + + + account_analytic_required.account_type_tree + account.account.type + + + + + + + + + + diff --git a/account_analytic_required/i18n/account_analytic_required.pot b/account_analytic_required/i18n/account_analytic_required.pot new file mode 100644 index 0000000000..6724a8fcd3 --- /dev/null +++ b/account_analytic_required/i18n/account_analytic_required.pot @@ -0,0 +1,94 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.2\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2011-06-10 07:49+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Never', the accountant will get an error message if an analytic account is present." +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "This module adds an option \"analytic policy\" on account types. You have the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, set the policy to \"always\" for the account type \"expense\" ; then, if you try to save an account move line with an account of type \"expense\" without analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011.\n" +"" +msgstr "" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "" + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "" + diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po new file mode 100644 index 0000000000..870152419f --- /dev/null +++ b/account_analytic_required/i18n/ar.po @@ -0,0 +1,120 @@ +# Arabic translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2014-06-26 11:15+0000\n" +"Last-Translator: Pedro Manuel Baeza \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" +"X-Generator: Launchpad (build 17077)\n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "سياسة للحسابات التحليلية" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"ضع سياسة للحسابات التحليلية: إذا قمت بتحديد \"الاختياري\"، فان المحاسب حر في " +"وضع حساب تحليلي على حساب خط التحرك مع هذا النوع من الحساب، وإذا قمت بتحديد " +"\"دائما\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان هناك لا يوجد حساب " +"تحليلي، وإذا قمت بتحديد \"أبدا\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان " +"هناك حساب تحليلي موجود" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "إختياري" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" +msgstr "" +"هذه الوحدة تضيف خيار \"السياسة التحليلية\" على أنواع الحسابات. لديك خيار بين " +"3 سياسات: دائما، أبدا، واختياري.\n" +"\n" +"على سبيل المثال، إذا كنت تريد أن يكون لديك حساب تحليلي عن جميع النفقات " +"الخاصة بك، اختار النهج \"دائما\" من أجل نوع الحساب\"مصروف\"، ثم، إذا حاولت " +"حفظ الحركة في حساب مع حساب \"مصروف\" من دون حساب تحليلي، وسوف تحصل على " +"رسالة خطأ.\n" +"\n" +"طورت الوحدة بواسطة اتر أليكسيس دي alexis.delattre@akretion.com> Akretion-" +"Camptocamp من يونيو 2011\n" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "لا يمكنك انشاء حركة على الحساب" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "دائماً" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "أبدًا" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "مطلوب حساب تحليلي" + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "قيمة دائنة أو مدينة خاطئة في القيد المحاسبي !" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "لا يمكنك عمل حركة على هذا الحساب" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "عناصر دفتر اليومية" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "نوع الحساب" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "يجب ان تكون الشركة نفس فترتها وحسابها المتعلق بها." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "خطأ :" diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po new file mode 100644 index 0000000000..9048d66262 --- /dev/null +++ b/account_analytic_required/i18n/ca.po @@ -0,0 +1,120 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.2\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2014-06-26 11:18+0000\n" +"Last-Translator: jmartin (Zikzakmedia) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" +"X-Generator: Launchpad (build 17077)\n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "Política per als comptes analítics" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Configura la política per als comptes analítics: Si seleccioneu 'Opcional', " +"el comptable és lliure de posar un compte analític en un apunt comptable amb " +"aquest tipus de compte; si seleccioneu 'Sempre', el comptable rebrà un " +"missatge d'error si l'apunt no té compte analític; si seleccioneu 'Mai', el " +"comptable rebrà un missatge d'error si l'apunt té un compte analític." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Opcional" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" +msgstr "" +"Aquest mòdul afegeix una opció \"política analítica\" als tipus comptables. " +"Podeu escollir entre 3 polítiques: 'Sempre', 'Mai' i 'Opcional'.\n" +"\n" +"Per exemple, si voleu tenir un compte analític de totes les vostres " +"despeses, seleccioneu la política \"Sempre\" per al tipus comptable " +"\"Despesa\"; llavors, si intenteu desar un apunt comptable de tipus " +"comptable \"Despesa\" sense compte analític, obtindreu un missatge d'error.\n" +"\n" +"Mòdul desenvolupat per Alexis de Lattre " +"durant la cursa de codi Akretion-Camptocamp de juny de 2011.\n" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "No podeu crear un apunt en un compte tancat." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Sempre" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Mai" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "El compte analític és requerit." + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "Valor erroni al deure o a l'haver de l'assentament comptable!" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "No podeu crear un apunt en un compte de tipus \"Vista\"." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "Apunts comptables" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Tipus de compte" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "" +"La companyia ha de ser la mateixa que la dels comptes i períodes relacionats." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "Error:" diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po new file mode 100644 index 0000000000..8e21c58500 --- /dev/null +++ b/account_analytic_required/i18n/es.po @@ -0,0 +1,122 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.2\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2014-06-26 11:18+0000\n" +"Last-Translator: jmartin (Zikzakmedia) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-06-27 07:09+0000\n" +"X-Generator: Launchpad (build 17077)\n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "Política para las cuentas analíticas" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Configura la política para las cuentas analíticas: Si selecciona 'Opcional', " +"el contable es libre de poner una cuenta analítica en un apunte contable de " +"este tipo de cuenta; si selecciona 'Siempre', el contable recibirá un " +"mensaje de error si el apunte no tiene cuenta analítica; si selecciona " +"'Nunca', el contable recibirá un mensaje de error si el apunte tiene una " +"cuenta analítica." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Opcional" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" +msgstr "" +"Este módulo añade una opción \"política analítica\" a los tipos contables. " +"Puede escoger entre 3 políticas: 'Siempre', 'Nunca' y 'Opcional'.\n" +"\n" +"Por ejemplo, si quiere tener una cuenta analítica de todos sus gastos, " +"seleccione la política \"Siempre\" para el tipo contable \"Gasto\"; " +"entonces, si intenta guardar un apunte contable de tipo contable \"Gasto\" " +"sin cuenta analítica, obtendrá un mensaje de error.\n" +"\n" +"Módulo desarrollado por Alexis de Lattre " +"durante la carrera de código Akretion-Camptocamp de junio de 2011.\n" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "No puede crear un apunte en una cuenta cerrada." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Siempre" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Nunca" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "La cuenta analítica es requerida." + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "¡Valor erróneo en el debe o en el haber del asiento contable!" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "No puede crear un apunte en una cuenta de tipo \"Vista\"." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "Apuntes contables" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Tipo de cuenta" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "" +"La compañía debe ser la misma que la de las cuentas y los periodos " +"relacionados." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "Error:" diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po new file mode 100644 index 0000000000..5b1a2fb2e6 --- /dev/null +++ b/account_analytic_required/i18n/fr.po @@ -0,0 +1,121 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.2\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-06-10 07:49+0000\n" +"PO-Revision-Date: 2014-06-26 11:18+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" +"X-Generator: Launchpad (build 17077)\n" + +#. module: account_analytic_required +#: field:account.account.type,analytic_policy:0 +msgid "Policy for analytic account" +msgstr "Politique pour les comptes analytiques" + +#. module: account_analytic_required +#: help:account.account.type,analytic_policy:0 +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Configurez la politique pour les comptes analytiques : si vous sélectionnez " +"'Optionnel', le comptable est libre de saisir ou non un compte analytique " +"sur une ligne comptable avec ce type de compte de comptabilité générale ; si " +"vous sélectionnez 'Toujours', le comptable aura un message d'erreur si il " +"n'y a pas de compte analytique ; si vous sélectionnez 'Jamais', le comptable " +"aura un message d'erreur si un compte analytique est présent." + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Optionnel" + +#. module: account_analytic_required +#: model:ir.module.module,description:account_analytic_required.module_meta_information +msgid "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" +msgstr "" +"This module adds an option \"analytic policy\" on account types. You have " +"the choice between 3 policies : always, never and optional.\n" +"\n" +"For example, if you want to have an analytic account on all your expenses, " +"set the policy to \"always\" for the account type \"expense\" ; then, if you " +"try to save an account move line with an account of type \"expense\" without " +"analytic account, you will get an error message.\n" +"\n" +"Module developped by Alexis de Lattre during " +"the Akretion-Camptocamp code sprint of June 2011.\n" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "Impossible de créer une ligne d'écriture sur un compte clôturé" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Toujours" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Jamais" + +#. module: account_analytic_required +#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information +msgid "Account analytic required" +msgstr "Account analytic required" + +#. module: account_analytic_required +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "Valeur erronée au crédit ou au débit de la pièce comptable !" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "" +"Vous ne pouvez pas créer de ligne d'écriture sur un compte de type \"Vue\"." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Items" +msgstr "Écritures comptables" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Type de compte" + +#. module: account_analytic_required +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "La société doit être la même pour les comptes et périodes liées." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/account.py:53 +#: code:addons/account_analytic_required/account.py:56 +#, python-format +msgid "Error :" +msgstr "Erreur :" diff --git a/account_analytic_required/tests/__init__.py b/account_analytic_required/tests/__init__.py new file mode 100644 index 0000000000..85d610f4eb --- /dev/null +++ b/account_analytic_required/tests/__init__.py @@ -0,0 +1,30 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2014 Acsone (http://acsone.eu). All Rights Reserved +# @author Stéphane Bidoul +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import test_account_analytic_required + +fast_suite = [ +] + +checks = [ + test_account_analytic_required, +] diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py new file mode 100644 index 0000000000..39bc393d11 --- /dev/null +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -0,0 +1,130 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account analytic required module for OpenERP +# Copyright (C) 2014 Acsone (http://acsone.eu). All Rights Reserved +# @author Stéphane Bidoul +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from datetime import datetime + +from openerp.tests import common +from openerp.osv import orm + + +class test_account_analytic_required(common.TransactionCase): + + def setUp(self): + super(test_account_analytic_required, self).setUp() + self.account_obj = self.registry('account.account') + self.account_type_obj = self.registry('account.account.type') + self.move_obj = self.registry('account.move') + self.move_line_obj = self.registry('account.move.line') + self.analytic_account_obj = self.registry('account.analytic.account') + self.analytic_account_id = self.analytic_account_obj.create( + self.cr, self.uid, {'name': 'test aa', 'type': 'normal'}) + + def _create_move(self, with_analytic, amount=100): + date = datetime.now() + period_id = self.registry('account.period').find( + self.cr, self.uid, date, + context={'account_period_prefer_normal': True})[0] + move_vals = { + 'journal_id': self.ref('account.sales_journal'), + 'period_id': period_id, + 'date': date, + } + move_id = self.move_obj.create(self.cr, self.uid, move_vals) + move_line_id = self.move_line_obj.create( + self.cr, self.uid, + {'move_id': move_id, + 'name': '/', + 'debit': 0, + 'credit': amount, + 'account_id': self.ref('account.a_sale'), + 'analytic_account_id': + self.analytic_account_id if with_analytic else False}) + self.move_line_obj.create( + self.cr, self.uid, + {'move_id': move_id, + 'name': '/', + 'debit': amount, + 'credit': 0, + 'account_id': self.ref('account.a_recv')}) + return move_line_id + + def _set_analytic_policy(self, policy, aref='account.a_sale'): + account_type = self.account_obj.browse(self.cr, self.uid, + self.ref(aref)).user_type + self.account_type_obj.write(self.cr, self.uid, account_type.id, + {'analytic_policy': policy}) + + def test_optional(self): + self._create_move(with_analytic=False) + self._create_move(with_analytic=True) + + def test_always_no_analytic(self): + self._set_analytic_policy('always') + with self.assertRaises(orm.except_orm): + self._create_move(with_analytic=False) + + def test_always_no_analytic_0(self): + # accept missing analytic account when debit=credit=0 + self._set_analytic_policy('always') + self._create_move(with_analytic=False, amount=0) + + def test_always_with_analytic(self): + self._set_analytic_policy('always') + self._create_move(with_analytic=True) + + def test_never_no_analytic(self): + self._set_analytic_policy('never') + self._create_move(with_analytic=False) + + def test_never_with_analytic(self): + self._set_analytic_policy('never') + with self.assertRaises(orm.except_orm): + self._create_move(with_analytic=True) + + def test_never_with_analytic_0(self): + # accept analytic when debit=credit=0 + self._set_analytic_policy('never') + self._create_move(with_analytic=True, amount=0) + + def test_always_remove_analytic(self): + # remove partner when policy is always + self._set_analytic_policy('always') + line_id = self._create_move(with_analytic=True) + with self.assertRaises(orm.except_orm): + self.move_line_obj.write(self.cr, self.uid, line_id, + {'analytic_account_id': False}) + + def test_change_account(self): + self._set_analytic_policy('always', aref='account.a_expense') + line_id = self._create_move(with_analytic=False) + # change account to a_expense with policy always but missing + # analytic_account + with self.assertRaises(orm.except_orm): + self.move_line_obj.write( + self.cr, self.uid, line_id, + {'account_id': self.ref('account.a_expense')}) + # change account to a_expense with policy always + # with analytic account -> ok + self.move_line_obj.write( + self.cr, self.uid, line_id, { + 'account_id': self.ref('account.a_expense'), + 'analytic_account_id': self.analytic_account_id}) From 9b283fcf621ae0cbc223da8d68f369dfb9c69c60 Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Wed, 3 Sep 2014 16:18:31 +0200 Subject: [PATCH 18/89] [MOD] Change installable and active status --- account_analytic_required/__openerp__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index 7ec7866a20..8ee8236d4c 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -45,6 +45,6 @@ 'website': 'http://www.akretion.com/', 'depends': ['account'], 'data': ['account_view.xml'], - 'installable': False, - 'active': False, + 'installable': True, + 'active': True, } From 9a11fef2645c99031335be28dda6d23cdcce60d8 Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Wed, 3 Sep 2014 17:07:09 +0200 Subject: [PATCH 19/89] [IMP] Replace active by auto_install key and set to False --- account_analytic_required/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index 8ee8236d4c..5f49cd080a 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -46,5 +46,5 @@ 'depends': ['account'], 'data': ['account_view.xml'], 'installable': True, - 'active': True, + 'auto_install': False, } From 8da8a8fc71ce6be80da82d61e6b904af58a4b0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 24 Sep 2014 23:32:12 +0200 Subject: [PATCH 20/89] [IMP] refactor account_analytic_required with constraints for robustness --- account_analytic_required/account.py | 80 +++++++++++----------------- 1 file changed, 32 insertions(+), 48 deletions(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index a5de6c1116..e4794fa1ff 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -51,53 +51,37 @@ class account_account_type(orm.Model): class account_move_line(orm.Model): _inherit = "account.move.line" - def check_analytic_required(self, cr, uid, ids, vals, context=None): - if 'account_id' in vals or 'analytic_account_id' in vals or \ - 'debit' in vals or 'credit' in vals: - if isinstance(ids, (int, long)): - ids = [ids] - for move_line in self.browse(cr, uid, ids, context): - if move_line.debit == 0 and move_line.credit == 0: - continue - analytic_policy = \ - move_line.account_id.user_type.analytic_policy - if analytic_policy == 'always' and \ - not move_line.analytic_account_id: - raise orm.except_orm( - _('Error :'), - _("Analytic policy is set to 'Always' with account " - "%s '%s' but the analytic account is missing in " - "the account move line with label '%s'.") - % ( - move_line.account_id.code, - move_line.account_id.name, - move_line.name)) - elif analytic_policy == 'never' and \ - move_line.analytic_account_id: - raise orm.except_orm( - _('Error :'), - _("Analytic policy is set to 'Never' with account %s " - "'%s' but the account move line with label '%s' " - "has an analytic account %s '%s'.") - % ( - move_line.account_id.code, - move_line.account_id.name, - move_line.name, - move_line.analytic_account_id.code, - move_line.analytic_account_id.name)) - return True + def _check_analytic_required_msg(self, cr, uid, ids, context=None): + for move_line in self.browse(cr, uid, ids, context): + if move_line.debit == 0 and move_line.credit == 0: + continue + analytic_policy = \ + move_line.account_id.user_type.analytic_policy + if analytic_policy == 'always' and \ + not move_line.analytic_account_id: + return _("Analytic policy is set to 'Always' with account " + "%s '%s' but the analytic account is missing in " + "the account move line with label '%s'.") % ( + move_line.account_id.code, + move_line.account_id.name, + move_line.name) + elif analytic_policy == 'never' and \ + move_line.analytic_account_id: + return _("Analytic policy is set to 'Never' with account %s " + "'%s' but the account move line with label '%s' " + "has an analytic account %s '%s'.") % ( + move_line.account_id.code, + move_line.account_id.name, + move_line.name, + move_line.analytic_account_id.code, + move_line.analytic_account_id.name) - def create(self, cr, uid, vals, context=None, check=True): - line_id = super(account_move_line, self).create( - cr, uid, vals, context=context, check=check) - self.check_analytic_required(cr, uid, line_id, vals, context=context) - return line_id + def _check_analytic_required(self, cr, uid, ids, context=None): + return not self._check_analytic_required_msg(cr, uid, ids, + context=context) - def write( - self, cr, uid, ids, vals, context=None, check=True, - update_check=True): - res = super(account_move_line, self).write( - cr, uid, ids, vals, context=context, check=check, - update_check=update_check) - self.check_analytic_required(cr, uid, ids, vals, context=context) - return res + _constraints = [ + (_check_analytic_required, + _check_analytic_required_msg, + ['analytic_account_id']), + ] From c1319f9ffc22a33e147e4e0832fb9b93dfa46b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 24 Sep 2014 23:43:38 +0200 Subject: [PATCH 21/89] [IMP] account_analytic_required: better mechanism to extend policies --- account_analytic_required/account.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index e4794fa1ff..fa4c4672d6 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -28,12 +28,21 @@ class account_account_type(orm.Model): _inherit = "account.account.type" + def _get_policies(self, cr, uid, context=None): + """This is the method to be inherited for adding policies""" + return [('optional', 'Optional'), + ('always', 'Always'), + ('never', 'Never') + ] + + def __get_policies(self, cr, uid, context=None): + """ Call method which can be inherited """ + return self._get_policies(cr, uid, context=context) + _columns = { - 'analytic_policy': fields.selection([ - ('optional', 'Optional'), - ('always', 'Always'), - ('never', 'Never') - ], 'Policy for analytic account', + 'analytic_policy': fields.selection( + __get_policies, + 'Policy for analytic account', help="Set the policy for analytic accounts : if you select " "'Optional', the accountant is free to put an analytic account " "on an account move line with this type of account ; if you " From d5f2c36868cf01ab52a26798da11090f23f1a14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 25 Sep 2014 09:47:59 +0200 Subject: [PATCH 22/89] [IMP] life would be boring without flake8 --- account_analytic_required/account.py | 35 +++++++++++++--------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index fa4c4672d6..38b34773ac 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -32,8 +32,7 @@ def _get_policies(self, cr, uid, context=None): """This is the method to be inherited for adding policies""" return [('optional', 'Optional'), ('always', 'Always'), - ('never', 'Never') - ] + ('never', 'Never')] def __get_policies(self, cr, uid, context=None): """ Call method which can be inherited """ @@ -69,28 +68,26 @@ def _check_analytic_required_msg(self, cr, uid, ids, context=None): if analytic_policy == 'always' and \ not move_line.analytic_account_id: return _("Analytic policy is set to 'Always' with account " - "%s '%s' but the analytic account is missing in " - "the account move line with label '%s'.") % ( - move_line.account_id.code, - move_line.account_id.name, - move_line.name) + "%s '%s' but the analytic account is missing in " + "the account move line with label '%s'.") % \ + (move_line.account_id.code, + move_line.account_id.name, + move_line.name) elif analytic_policy == 'never' and \ move_line.analytic_account_id: return _("Analytic policy is set to 'Never' with account %s " - "'%s' but the account move line with label '%s' " - "has an analytic account %s '%s'.") % ( - move_line.account_id.code, - move_line.account_id.name, - move_line.name, - move_line.analytic_account_id.code, - move_line.analytic_account_id.name) + "'%s' but the account move line with label '%s' " + "has an analytic account %s '%s'.") % \ + (move_line.account_id.code, + move_line.account_id.name, + move_line.name, + move_line.analytic_account_id.code, + move_line.analytic_account_id.name) def _check_analytic_required(self, cr, uid, ids, context=None): return not self._check_analytic_required_msg(cr, uid, ids, context=context) - _constraints = [ - (_check_analytic_required, - _check_analytic_required_msg, - ['analytic_account_id']), - ] + _constraints = [(_check_analytic_required, + _check_analytic_required_msg, + ['analytic_account_id'])] From 247f1ec740168c710578794416a35c7c0fbaa6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 25 Sep 2014 09:55:06 +0200 Subject: [PATCH 23/89] [IMP] account_analytic_required: add an extension point to obtain analytic policy --- account_analytic_required/account.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index 38b34773ac..62a3c1ab8d 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -59,12 +59,17 @@ def __get_policies(self, cr, uid, context=None): class account_move_line(orm.Model): _inherit = "account.move.line" + def _get_analytic_policy(self, cr, uid, account, context=None): + """ Extension point to obtain analytic policy for an account """ + return account.user_type.analytic_policy + def _check_analytic_required_msg(self, cr, uid, ids, context=None): for move_line in self.browse(cr, uid, ids, context): if move_line.debit == 0 and move_line.credit == 0: continue - analytic_policy = \ - move_line.account_id.user_type.analytic_policy + analytic_policy = self._get_analytic_policy(cr, uid, + move_line.account_id, + context=context) if analytic_policy == 'always' and \ not move_line.analytic_account_id: return _("Analytic policy is set to 'Always' with account " From b31c4d7d30a0b978c3d286f1f84595976b5779ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 25 Sep 2014 11:07:15 +0200 Subject: [PATCH 24/89] [IMP] analytic policy must be required otherwise the checks will break It has a default value, so this is fine. --- account_analytic_required/account.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index 62a3c1ab8d..ebed89fbd5 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -42,6 +42,7 @@ def __get_policies(self, cr, uid, context=None): 'analytic_policy': fields.selection( __get_policies, 'Policy for analytic account', + required=True, help="Set the policy for analytic accounts : if you select " "'Optional', the accountant is free to put an analytic account " "on an account move line with this type of account ; if you " @@ -53,7 +54,7 @@ def __get_policies(self, cr, uid, context=None): _defaults = { 'analytic_policy': 'optional', - } + } class account_move_line(orm.Model): From 1d9e736f0ebbe819d0b0395942fc200154a8c1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 25 Sep 2014 11:27:12 +0200 Subject: [PATCH 25/89] [IMP] account_analytic_required: make test use [ids] in write For compatibility with account_constraints. --- .../tests/test_account_analytic_required.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index 39bc393d11..f66bd54a9a 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -110,7 +110,7 @@ def test_always_remove_analytic(self): self._set_analytic_policy('always') line_id = self._create_move(with_analytic=True) with self.assertRaises(orm.except_orm): - self.move_line_obj.write(self.cr, self.uid, line_id, + self.move_line_obj.write(self.cr, self.uid, [line_id], {'analytic_account_id': False}) def test_change_account(self): @@ -120,11 +120,11 @@ def test_change_account(self): # analytic_account with self.assertRaises(orm.except_orm): self.move_line_obj.write( - self.cr, self.uid, line_id, + self.cr, self.uid, [line_id], {'account_id': self.ref('account.a_expense')}) # change account to a_expense with policy always # with analytic account -> ok self.move_line_obj.write( - self.cr, self.uid, line_id, { + self.cr, self.uid, [line_id], { 'account_id': self.ref('account.a_expense'), 'analytic_account_id': self.analytic_account_id}) From 0554142f7ebc9aa24a5a3fff853d629de089e683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 25 Oct 2014 16:32:31 +0200 Subject: [PATCH 26/89] [FIX] account_analytic_required: add missing field in constraint --- account_analytic_required/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index ebed89fbd5..27d774ccf4 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -96,4 +96,4 @@ def _check_analytic_required(self, cr, uid, ids, context=None): _constraints = [(_check_analytic_required, _check_analytic_required_msg, - ['analytic_account_id'])] + ['analytic_account_id', 'account_id'])] From bcf61d7797de94eb4d67b958f4860ba362278ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 25 Oct 2014 17:23:38 +0200 Subject: [PATCH 27/89] [FIX] account_analytic_required: constraint also depends on debit and credit --- account_analytic_required/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index 27d774ccf4..b4739d5f65 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -96,4 +96,4 @@ def _check_analytic_required(self, cr, uid, ids, context=None): _constraints = [(_check_analytic_required, _check_analytic_required_msg, - ['analytic_account_id', 'account_id'])] + ['analytic_account_id', 'account_id', 'debit', 'credit'])] From de4c08e104f6fe64d8c284922247f13ff8202a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 29 Oct 2014 15:57:16 +0100 Subject: [PATCH 28/89] [FIX] account_analytic_(plan)_required: make policies translatable Plus: use lambda trick in the selection field for readability --- account_analytic_required/account.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py index b4739d5f65..0d47b7f5df 100644 --- a/account_analytic_required/account.py +++ b/account_analytic_required/account.py @@ -30,17 +30,13 @@ class account_account_type(orm.Model): def _get_policies(self, cr, uid, context=None): """This is the method to be inherited for adding policies""" - return [('optional', 'Optional'), - ('always', 'Always'), - ('never', 'Never')] - - def __get_policies(self, cr, uid, context=None): - """ Call method which can be inherited """ - return self._get_policies(cr, uid, context=context) + return [('optional', _('Optional')), + ('always', _('Always')), + ('never', _('Never'))] _columns = { 'analytic_policy': fields.selection( - __get_policies, + lambda self, *args, **kwargs: self._get_policies(*args, **kwargs), 'Policy for analytic account', required=True, help="Set the policy for analytic accounts : if you select " From af7f40cc421bf5610ddc1fc8f6ddb74384ddd83e Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 2 Mar 2015 17:22:10 +0100 Subject: [PATCH 29/89] Add OCA as author of OCA addons In order to get visibility on https://www.odoo.com/apps the OCA board has decided to add the OCA as author of all the addons maintained as part of the association. --- account_analytic_required/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index 5f49cd080a..1596c1d91e 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -41,7 +41,7 @@ Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011. """, - 'author': 'Akretion', + 'author': "Akretion,Odoo Community Association (OCA)", 'website': 'http://www.akretion.com/', 'depends': ['account'], 'data': ['account_view.xml'], From 63b0f57219193f7374fcd98dc9a0aafc1c339357 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Thu, 27 Aug 2015 16:51:59 +0200 Subject: [PATCH 30/89] remove deprecated test suite declarations these cause Warnings during the tests --- account_analytic_required/tests/__init__.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/account_analytic_required/tests/__init__.py b/account_analytic_required/tests/__init__.py index 85d610f4eb..f70d8a2c8d 100644 --- a/account_analytic_required/tests/__init__.py +++ b/account_analytic_required/tests/__init__.py @@ -21,10 +21,3 @@ ############################################################################## from . import test_account_analytic_required - -fast_suite = [ -] - -checks = [ - test_account_analytic_required, -] From b47a64f5952d7d1a16bc49f32c1d51e6b0315857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 9 Oct 2015 09:58:12 +0200 Subject: [PATCH 31/89] [UPD] prefix versions with 8.0 --- account_analytic_required/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index 1596c1d91e..b747f13826 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -23,7 +23,7 @@ { 'name': 'Account Analytic Required', - 'version': '0.2', + 'version': '8.0.0.2.0', 'category': 'Analytic Accounting', 'license': 'AGPL-3', 'description': """ From b8c59a84bb9e3a88e60d2604d6597069b5d2eeb8 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 14 Oct 2015 02:50:16 +0200 Subject: [PATCH 32/89] [MIG] Make modules uninstallable --- account_analytic_required/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index b747f13826..f91cbdbb73 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -45,6 +45,6 @@ 'website': 'http://www.akretion.com/', 'depends': ['account'], 'data': ['account_view.xml'], - 'installable': True, + 'installable': False, 'auto_install': False, } From 321359d79561f31527f1f74339da86c72f723e0a Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 3 Jun 2016 09:36:58 +0200 Subject: [PATCH 33/89] [9.0][PORT] account_analytic_required --- account_analytic_required/README.rst | 63 +++++++++ account_analytic_required/__init__.py | 25 +--- account_analytic_required/__openerp__.py | 48 +------ account_analytic_required/account.py | 95 ------------- account_analytic_required/models/__init__.py | 1 + account_analytic_required/models/account.py | 72 ++++++++++ account_analytic_required/tests/__init__.py | 22 --- .../tests/test_account_analytic_required.py | 133 +++++++++--------- .../{account_view.xml => views/account.xml} | 26 ++-- 9 files changed, 221 insertions(+), 264 deletions(-) create mode 100644 account_analytic_required/README.rst delete mode 100644 account_analytic_required/account.py create mode 100644 account_analytic_required/models/__init__.py create mode 100644 account_analytic_required/models/account.py rename account_analytic_required/{account_view.xml => views/account.xml} (65%) diff --git a/account_analytic_required/README.rst b/account_analytic_required/README.rst new file mode 100644 index 0000000000..6db6c9ce98 --- /dev/null +++ b/account_analytic_required/README.rst @@ -0,0 +1,63 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License + +========================= +Account Analytic Required +========================= + +This module adds an option *analytic policy* on account types. +You have the choice between 3 policies : *always*, *never* and *optional*. + +Configuration +============= + +For example, if you want to have an analytic account on all your expenses, +set the policy to *always* for the account type *expense* ; then, if you +try to save an account move line with an account of type *expense* +without analytic account, you will get an error message. + +Usage +===== + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/87/9.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Author +------ +* Module developed by Alexis de Lattre + during the Akretion-Camptocamp code sprint of June 2011. + +Contributors +------------ +* Stéphane Bidoul +* Sefan Rijnhart +* Laetitia Gangloff +* Luc De Meyer, Noviat +* Yannick Vaucher + +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_analytic_required/__init__.py b/account_analytic_required/__init__.py index fdc3ea32b8..0650744f6b 100644 --- a/account_analytic_required/__init__.py +++ b/account_analytic_required/__init__.py @@ -1,24 +1 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -from . import account +from . import models diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index f91cbdbb73..d86b4e2c9c 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -1,50 +1,16 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - +# -*- coding: utf-8 -*- +# © 2011 Akretion +# © 2016 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { 'name': 'Account Analytic Required', - 'version': '8.0.0.2.0', + 'version': '9.0.1.0.0', 'category': 'Analytic Accounting', 'license': 'AGPL-3', - 'description': """ -Account Analytic Required -========================= - -This module adds an option *analytic policy* on account types. -You have the choice between 3 policies : *always*, *never* and *optional*. - -For example, if you want to have an analytic account on all your expenses, -set the policy to *always* for the account type *expense* ; then, if you -try to save an account move line with an account of type *expense* -without analytic account, you will get an error message. - -Module developped by Alexis de Lattre -during the Akretion-Camptocamp code sprint of June 2011. -""", 'author': "Akretion,Odoo Community Association (OCA)", 'website': 'http://www.akretion.com/', 'depends': ['account'], - 'data': ['account_view.xml'], - 'installable': False, + 'data': ['views/account.xml'], + 'installable': True, 'auto_install': False, } diff --git a/account_analytic_required/account.py b/account_analytic_required/account.py deleted file mode 100644 index 0d47b7f5df..0000000000 --- a/account_analytic_required/account.py +++ /dev/null @@ -1,95 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# Developped during the Akretion-Camptocamp code sprint of June 2011 -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp.osv import orm, fields -from openerp.tools.translate import _ - - -class account_account_type(orm.Model): - _inherit = "account.account.type" - - def _get_policies(self, cr, uid, context=None): - """This is the method to be inherited for adding policies""" - return [('optional', _('Optional')), - ('always', _('Always')), - ('never', _('Never'))] - - _columns = { - 'analytic_policy': fields.selection( - lambda self, *args, **kwargs: self._get_policies(*args, **kwargs), - 'Policy for analytic account', - required=True, - help="Set the policy for analytic accounts : if you select " - "'Optional', the accountant is free to put an analytic account " - "on an account move line with this type of account ; if you " - "select 'Always', the accountant will get an error message if " - "there is no analytic account ; if you select 'Never', the " - "accountant will get an error message if an analytic account " - "is present."), - } - - _defaults = { - 'analytic_policy': 'optional', - } - - -class account_move_line(orm.Model): - _inherit = "account.move.line" - - def _get_analytic_policy(self, cr, uid, account, context=None): - """ Extension point to obtain analytic policy for an account """ - return account.user_type.analytic_policy - - def _check_analytic_required_msg(self, cr, uid, ids, context=None): - for move_line in self.browse(cr, uid, ids, context): - if move_line.debit == 0 and move_line.credit == 0: - continue - analytic_policy = self._get_analytic_policy(cr, uid, - move_line.account_id, - context=context) - if analytic_policy == 'always' and \ - not move_line.analytic_account_id: - return _("Analytic policy is set to 'Always' with account " - "%s '%s' but the analytic account is missing in " - "the account move line with label '%s'.") % \ - (move_line.account_id.code, - move_line.account_id.name, - move_line.name) - elif analytic_policy == 'never' and \ - move_line.analytic_account_id: - return _("Analytic policy is set to 'Never' with account %s " - "'%s' but the account move line with label '%s' " - "has an analytic account %s '%s'.") % \ - (move_line.account_id.code, - move_line.account_id.name, - move_line.name, - move_line.analytic_account_id.code, - move_line.analytic_account_id.name) - - def _check_analytic_required(self, cr, uid, ids, context=None): - return not self._check_analytic_required_msg(cr, uid, ids, - context=context) - - _constraints = [(_check_analytic_required, - _check_analytic_required_msg, - ['analytic_account_id', 'account_id', 'debit', 'credit'])] diff --git a/account_analytic_required/models/__init__.py b/account_analytic_required/models/__init__.py new file mode 100644 index 0000000000..2b77ae28f0 --- /dev/null +++ b/account_analytic_required/models/__init__.py @@ -0,0 +1 @@ +from . import account diff --git a/account_analytic_required/models/account.py b/account_analytic_required/models/account.py new file mode 100644 index 0000000000..e95cf28420 --- /dev/null +++ b/account_analytic_required/models/account.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +# © 2011 Akretion +# © 2016 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from openerp import _, api, fields, models + + +class AccountAccountType(models.Model): + _inherit = "account.account.type" + + @api.model + def _get_policies(self): + """This is the method to be inherited for adding policies""" + return [('optional', 'Optional'), + ('always', 'Always'), + ('never', 'Never')] + + analytic_policy = fields.Selection( + _get_policies, + 'Policy for analytic account', + required=True, + default='optional', + help="Set the policy for analytic accounts : if you select " + "'Optional', the accountant is free to put an analytic account " + "on an account move line with this type of account ; if you " + "select 'Always', the accountant will get an error message if " + "there is no analytic account ; if you select 'Never', the " + "accountant will get an error message if an analytic account " + "is present.") + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + @api.model + def _get_analytic_policy(self, account): + """ Extension point to obtain analytic policy for an account """ + return account.user_type_id.analytic_policy + + @api.multi + def _check_analytic_required_msg(self): + for move_line in self: + if move_line.debit == 0 and move_line.credit == 0: + continue + analytic_policy = self._get_analytic_policy(move_line.account_id) + if (analytic_policy == 'always' and + not move_line.analytic_account_id): + return _("Analytic policy is set to 'Always' with account " + "%s '%s' but the analytic account is missing in " + "the account move line with label '%s'." + ) % (move_line.account_id.code, + move_line.account_id.name, + move_line.name) + elif (analytic_policy == 'never' and + move_line.analytic_account_id): + return _("Analytic policy is set to 'Never' with account %s " + "'%s' but the account move line with label '%s' " + "has an analytic account %s '%s'." + ) % (move_line.account_id.code, + move_line.account_id.name, + move_line.name, + move_line.analytic_account_id.code, + move_line.analytic_account_id.name) + + @api.multi + def _check_analytic_required(self): + return not self._check_analytic_required_msg() + + _constraints = [(_check_analytic_required, + _check_analytic_required_msg, + ['analytic_account_id', 'account_id', 'debit', 'credit'])] diff --git a/account_analytic_required/tests/__init__.py b/account_analytic_required/tests/__init__.py index f70d8a2c8d..fc369e3ef6 100644 --- a/account_analytic_required/tests/__init__.py +++ b/account_analytic_required/tests/__init__.py @@ -1,23 +1 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2014 Acsone (http://acsone.eu). All Rights Reserved -# @author Stéphane Bidoul -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - from . import test_account_analytic_required diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index f66bd54a9a..9a5d7c3647 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -1,77 +1,78 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account analytic required module for OpenERP -# Copyright (C) 2014 Acsone (http://acsone.eu). All Rights Reserved -# @author Stéphane Bidoul -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - +# -*- coding: utf-8 -*- +# © 2014 Acsone +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from datetime import datetime from openerp.tests import common -from openerp.osv import orm +from openerp import exceptions -class test_account_analytic_required(common.TransactionCase): +class TestAccountAnalyticRequired(common.TransactionCase): def setUp(self): super(test_account_analytic_required, self).setUp() - self.account_obj = self.registry('account.account') - self.account_type_obj = self.registry('account.account.type') - self.move_obj = self.registry('account.move') - self.move_line_obj = self.registry('account.move.line') - self.analytic_account_obj = self.registry('account.analytic.account') - self.analytic_account_id = self.analytic_account_obj.create( - self.cr, self.uid, {'name': 'test aa', 'type': 'normal'}) + self.account_obj = self.env['account.account'] + self.account_type_obj = self.env['account.account.type'] + self.move_obj = self.env['account.move'] + self.move_line_obj = self.env['account.move.line'] + self.analytic_account_obj = self.env['account.analytic.account'] + self.analytic_account = self.analytic_account_obj.create( + {'name': 'test aa', 'account_type': 'normal'}) + self.account_sales = self.env['account.account'].create({ + 'code': "X1020", + 'name': "Product Sales - (test)", + 'user_type_id': self.ref('account.data_account_type_revenue') + }) + self.account_recv = self.env['account.account'].create({ + 'code': "X11002", + 'name': "Debtors - (test)", + 'reconcile': True, + 'user_type_id': self.ref('account.data_account_type_receivable') + }) + self.account_exp = self.env['account.account'].create({ + 'code': "X2110", + 'name': "Expenses - (test)", + 'user_type_id': self.ref('account.data_account_type_expenses') + }) + self.sales_journal = self.env['account.journal'].create({ + 'name': "Sales Journal - (test)", + 'code': "TSAJ", + 'type': "sale", + 'refund_sequence': True, + 'default_debit_account_id': self.account_sales.id, + 'default_credit_account_id': self.account_sales.id, + }) def _create_move(self, with_analytic, amount=100): date = datetime.now() - period_id = self.registry('account.period').find( - self.cr, self.uid, date, - context={'account_period_prefer_normal': True})[0] + ml_obj = self.move_line_obj.with_context(check_move_validity=False) move_vals = { - 'journal_id': self.ref('account.sales_journal'), - 'period_id': period_id, + 'name': '/', + 'journal_id': self.sales_journal.id, 'date': date, } - move_id = self.move_obj.create(self.cr, self.uid, move_vals) - move_line_id = self.move_line_obj.create( - self.cr, self.uid, - {'move_id': move_id, + move = self.move_obj.create(move_vals) + move_line = ml_obj.create( + {'move_id': move.id, 'name': '/', 'debit': 0, 'credit': amount, - 'account_id': self.ref('account.a_sale'), + 'account_id': self.account_sales.id, 'analytic_account_id': - self.analytic_account_id if with_analytic else False}) - self.move_line_obj.create( - self.cr, self.uid, - {'move_id': move_id, + self.analytic_account.id if with_analytic else False}) + ml_obj.create( + {'move_id': move.id, 'name': '/', 'debit': amount, 'credit': 0, - 'account_id': self.ref('account.a_recv')}) - return move_line_id + 'account_id': self.account_recv.id, + }) + return move_line - def _set_analytic_policy(self, policy, aref='account.a_sale'): - account_type = self.account_obj.browse(self.cr, self.uid, - self.ref(aref)).user_type - self.account_type_obj.write(self.cr, self.uid, account_type.id, - {'analytic_policy': policy}) + def _set_analytic_policy(self, policy, account=None): + if account is None: + account = self.account_sales + account.user_type_id.analytic_policy = policy def test_optional(self): self._create_move(with_analytic=False) @@ -79,7 +80,7 @@ def test_optional(self): def test_always_no_analytic(self): self._set_analytic_policy('always') - with self.assertRaises(orm.except_orm): + with self.assertRaises(exceptions.ValidationError): self._create_move(with_analytic=False) def test_always_no_analytic_0(self): @@ -97,7 +98,7 @@ def test_never_no_analytic(self): def test_never_with_analytic(self): self._set_analytic_policy('never') - with self.assertRaises(orm.except_orm): + with self.assertRaises(exceptions.ValidationError): self._create_move(with_analytic=True) def test_never_with_analytic_0(self): @@ -108,23 +109,19 @@ def test_never_with_analytic_0(self): def test_always_remove_analytic(self): # remove partner when policy is always self._set_analytic_policy('always') - line_id = self._create_move(with_analytic=True) - with self.assertRaises(orm.except_orm): - self.move_line_obj.write(self.cr, self.uid, [line_id], - {'analytic_account_id': False}) + line = self._create_move(with_analytic=True) + with self.assertRaises(exceptions.ValidationError): + line.write({'analytic_account_id': False}) def test_change_account(self): - self._set_analytic_policy('always', aref='account.a_expense') - line_id = self._create_move(with_analytic=False) + self._set_analytic_policy('always', account=self.account_exp) + line = self._create_move(with_analytic=False) # change account to a_expense with policy always but missing # analytic_account - with self.assertRaises(orm.except_orm): - self.move_line_obj.write( - self.cr, self.uid, [line_id], - {'account_id': self.ref('account.a_expense')}) + with self.assertRaises(exceptions.ValidationError): + line.write({'account_id': self.account_exp.id}) # change account to a_expense with policy always # with analytic account -> ok - self.move_line_obj.write( - self.cr, self.uid, [line_id], { - 'account_id': self.ref('account.a_expense'), - 'analytic_account_id': self.analytic_account_id}) + line.write({ + 'account_id': self.account_exp.id, + 'analytic_account_id': self.analytic_account.id}) diff --git a/account_analytic_required/account_view.xml b/account_analytic_required/views/account.xml similarity index 65% rename from account_analytic_required/account_view.xml rename to account_analytic_required/views/account.xml index 5ae1b50a34..3cf6b23481 100644 --- a/account_analytic_required/account_view.xml +++ b/account_analytic_required/views/account.xml @@ -6,30 +6,28 @@ The licence is in the file __openerp__.py --> - - + - + account_analytic_required.account_type_form account.account.type - - - + + + - + - + account_analytic_required.account_type_tree account.account.type - - - + + + - + - - + From 30978e3e536be00f0d51481d5a3b393d63f108c2 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Thu, 23 Jun 2016 15:02:56 +0200 Subject: [PATCH 34/89] Fix class name in super --- .../tests/test_account_analytic_required.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index 9a5d7c3647..9b8cb33bbe 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -10,7 +10,7 @@ class TestAccountAnalyticRequired(common.TransactionCase): def setUp(self): - super(test_account_analytic_required, self).setUp() + super(TestAccountAnalyticRequired, self).setUp() self.account_obj = self.env['account.account'] self.account_type_obj = self.env['account.account.type'] self.move_obj = self.env['account.move'] From 35f3bffd9a8df87b5ec7dd66887c8bd246f77dfc Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 12 Jul 2016 13:05:00 +0200 Subject: [PATCH 35/89] Use float_is_zero --- account_analytic_required/models/account.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account_analytic_required/models/account.py b/account_analytic_required/models/account.py index e95cf28420..3f4089bbf5 100644 --- a/account_analytic_required/models/account.py +++ b/account_analytic_required/models/account.py @@ -4,6 +4,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from openerp import _, api, fields, models +from openerp.tools import float_is_zero class AccountAccountType(models.Model): @@ -41,7 +42,9 @@ def _get_analytic_policy(self, account): @api.multi def _check_analytic_required_msg(self): for move_line in self: - if move_line.debit == 0 and move_line.credit == 0: + prec = move_line.company_currency_id.rounding + if (float_is_zero(move_line.debit, precision_rounding=prec) and + float_is_zero(move_line.credit, precision_rounding=prec)): continue analytic_policy = self._get_analytic_policy(move_line.account_id) if (analytic_policy == 'always' and From 9f2c27c2802ccc254174691f6334a013102ff80f Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 12 Jul 2016 14:02:24 +0200 Subject: [PATCH 36/89] Use api.constrains --- account_analytic_required/models/account.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/account_analytic_required/models/account.py b/account_analytic_required/models/account.py index 3f4089bbf5..9734adaab4 100644 --- a/account_analytic_required/models/account.py +++ b/account_analytic_required/models/account.py @@ -3,7 +3,7 @@ # © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) -from openerp import _, api, fields, models +from openerp import _, api, exceptions, fields, models from openerp.tools import float_is_zero @@ -66,10 +66,9 @@ def _check_analytic_required_msg(self): move_line.analytic_account_id.code, move_line.analytic_account_id.name) - @api.multi + @api.constrains('analytic_account_id', 'account_id', 'debit', 'credit') def _check_analytic_required(self): - return not self._check_analytic_required_msg() - - _constraints = [(_check_analytic_required, - _check_analytic_required_msg, - ['analytic_account_id', 'account_id', 'debit', 'credit'])] + for rec in self: + message = rec._check_analytic_required_msg() + if message: + raise exceptions.ValidationError(message) From 0647900b783dc83985b32d8594b21f0ec6ce9cea Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 12 Aug 2016 15:21:40 +0200 Subject: [PATCH 37/89] Restore menu entry for account types in Accounting/Configuration/Accounting --- account_analytic_required/views/account.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/account_analytic_required/views/account.xml b/account_analytic_required/views/account.xml index 3cf6b23481..72b9ab8bcb 100644 --- a/account_analytic_required/views/account.xml +++ b/account_analytic_required/views/account.xml @@ -30,4 +30,6 @@ + + From 2284e0aedd2c802086da541db23e47e9b38217ab Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Mon, 15 Aug 2016 17:11:08 +0200 Subject: [PATCH 38/89] Update credits in readme to be compliant with OCA standards --- account_analytic_required/README.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/account_analytic_required/README.rst b/account_analytic_required/README.rst index 6db6c9ce98..c5cef4b839 100644 --- a/account_analytic_required/README.rst +++ b/account_analytic_required/README.rst @@ -35,13 +35,9 @@ help us smashing it by providing a detailed and welcomed feedback. Credits ======= -Author ------- -* Module developed by Alexis de Lattre - during the Akretion-Camptocamp code sprint of June 2011. - Contributors ------------ +* Alexis de Lattre * Stéphane Bidoul * Sefan Rijnhart * Laetitia Gangloff From b28e855eb4d0745a050ff37c8139980491948591 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 14:44:54 +0200 Subject: [PATCH 39/89] [MIG] Make modules uninstallable --- account_analytic_required/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__openerp__.py index d86b4e2c9c..4f449ffcd1 100644 --- a/account_analytic_required/__openerp__.py +++ b/account_analytic_required/__openerp__.py @@ -11,6 +11,6 @@ 'website': 'http://www.akretion.com/', 'depends': ['account'], 'data': ['views/account.xml'], - 'installable': True, + 'installable': False, 'auto_install': False, } From 2eaf40eb62bf53e26a1da05dbe0c433e41b6e8d7 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 14:44:55 +0200 Subject: [PATCH 40/89] [MIG] Rename manifest files --- account_analytic_required/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename account_analytic_required/{__openerp__.py => __manifest__.py} (100%) diff --git a/account_analytic_required/__openerp__.py b/account_analytic_required/__manifest__.py similarity index 100% rename from account_analytic_required/__openerp__.py rename to account_analytic_required/__manifest__.py From 336de9a36ede020d70c18f2d9711408310ae4163 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 10 Oct 2016 20:52:41 +0200 Subject: [PATCH 41/89] Port account_analytic_required to v10 --- account_analytic_required/README.rst | 2 +- account_analytic_required/__manifest__.py | 7 +++---- account_analytic_required/models/account.py | 11 +++++----- .../tests/test_account_analytic_required.py | 9 +++++---- account_analytic_required/views/account.xml | 20 +++++++++++++++---- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/account_analytic_required/README.rst b/account_analytic_required/README.rst index c5cef4b839..ad888a492c 100644 --- a/account_analytic_required/README.rst +++ b/account_analytic_required/README.rst @@ -22,7 +22,7 @@ Usage .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/87/9.0 + :target: https://runbot.odoo-community.org/runbot/87/10.0 Bug Tracker =========== diff --git a/account_analytic_required/__manifest__.py b/account_analytic_required/__manifest__.py index 4f449ffcd1..b6f09903aa 100644 --- a/account_analytic_required/__manifest__.py +++ b/account_analytic_required/__manifest__.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- -# © 2011 Akretion +# © 2011-2016 Akretion (Alexis de Lattre ) # © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { 'name': 'Account Analytic Required', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Analytic Accounting', 'license': 'AGPL-3', 'author': "Akretion,Odoo Community Association (OCA)", 'website': 'http://www.akretion.com/', 'depends': ['account'], 'data': ['views/account.xml'], - 'installable': False, - 'auto_install': False, + 'installable': True, } diff --git a/account_analytic_required/models/account.py b/account_analytic_required/models/account.py index 9734adaab4..fbe4de4b19 100644 --- a/account_analytic_required/models/account.py +++ b/account_analytic_required/models/account.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# © 2011 Akretion +# © 2011-2016 Akretion (Alexis de Lattre ) # © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) -from openerp import _, api, exceptions, fields, models -from openerp.tools import float_is_zero +from odoo import _, api, exceptions, fields, models +from odoo.tools import float_is_zero class AccountAccountType(models.Model): @@ -59,12 +59,11 @@ def _check_analytic_required_msg(self): move_line.analytic_account_id): return _("Analytic policy is set to 'Never' with account %s " "'%s' but the account move line with label '%s' " - "has an analytic account %s '%s'." + "has an analytic account '%s'." ) % (move_line.account_id.code, move_line.account_id.name, move_line.name, - move_line.analytic_account_id.code, - move_line.analytic_account_id.name) + move_line.analytic_account_id.name_get()[0][1]) @api.constrains('analytic_account_id', 'account_id', 'debit', 'credit') def _check_analytic_required(self): diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index 9b8cb33bbe..fc1b77e2c4 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -3,8 +3,8 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from datetime import datetime -from openerp.tests import common -from openerp import exceptions +from odoo.tests import common +from odoo import exceptions class TestAccountAnalyticRequired(common.TransactionCase): @@ -17,7 +17,7 @@ def setUp(self): self.move_line_obj = self.env['account.move.line'] self.analytic_account_obj = self.env['account.analytic.account'] self.analytic_account = self.analytic_account_obj.create( - {'name': 'test aa', 'account_type': 'normal'}) + {'name': 'test aa'}) self.account_sales = self.env['account.account'].create({ 'code': "X1020", 'name': "Product Sales - (test)", @@ -75,6 +75,7 @@ def _set_analytic_policy(self, policy, account=None): account.user_type_id.analytic_policy = policy def test_optional(self): + self._set_analytic_policy('optional') self._create_move(with_analytic=False) self._create_move(with_analytic=True) @@ -107,7 +108,7 @@ def test_never_with_analytic_0(self): self._create_move(with_analytic=True, amount=0) def test_always_remove_analytic(self): - # remove partner when policy is always + # remove analytic when policy is always self._set_analytic_policy('always') line = self._create_move(with_analytic=True) with self.assertRaises(exceptions.ValidationError): diff --git a/account_analytic_required/views/account.xml b/account_analytic_required/views/account.xml index 72b9ab8bcb..5587005b78 100644 --- a/account_analytic_required/views/account.xml +++ b/account_analytic_required/views/account.xml @@ -1,9 +1,7 @@ @@ -30,6 +28,20 @@ + + account_analytic_required.account_type_search + account.account.type + + + + + + + + + + From 6c2b850e200a44cb5b546a9ad1c5ea96c71bcb53 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 11 Jan 2017 14:10:11 +0100 Subject: [PATCH 42/89] Use account_type_menu from account-financial-tools --- account_analytic_required/__manifest__.py | 2 +- account_analytic_required/views/account.xml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/account_analytic_required/__manifest__.py b/account_analytic_required/__manifest__.py index b6f09903aa..4b195b4d48 100644 --- a/account_analytic_required/__manifest__.py +++ b/account_analytic_required/__manifest__.py @@ -9,7 +9,7 @@ 'license': 'AGPL-3', 'author': "Akretion,Odoo Community Association (OCA)", 'website': 'http://www.akretion.com/', - 'depends': ['account'], + 'depends': ['account', 'account_type_menu'], 'data': ['views/account.xml'], 'installable': True, } diff --git a/account_analytic_required/views/account.xml b/account_analytic_required/views/account.xml index 5587005b78..ac20324473 100644 --- a/account_analytic_required/views/account.xml +++ b/account_analytic_required/views/account.xml @@ -42,6 +42,4 @@ - - From d533b40b28378cdd4bb31cdaa6961fa50579bbf2 Mon Sep 17 00:00:00 2001 From: cubells Date: Wed, 24 May 2017 10:14:06 +0200 Subject: [PATCH 43/89] [IMP] Use new api to extend selection --- account_analytic_required/models/account.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/account_analytic_required/models/account.py b/account_analytic_required/models/account.py index fbe4de4b19..8be70c4aab 100644 --- a/account_analytic_required/models/account.py +++ b/account_analytic_required/models/account.py @@ -10,16 +10,11 @@ class AccountAccountType(models.Model): _inherit = "account.account.type" - @api.model - def _get_policies(self): - """This is the method to be inherited for adding policies""" - return [('optional', 'Optional'), - ('always', 'Always'), - ('never', 'Never')] - analytic_policy = fields.Selection( - _get_policies, - 'Policy for analytic account', + selection=[('optional', 'Optional'), + ('always', 'Always'), + ('never', 'Never')], + string='Policy for analytic account', required=True, default='optional', help="Set the policy for analytic accounts : if you select " From 8d2d273d7a016fa1953b882770a670811dc8242f Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 1 May 2017 14:46:45 +0200 Subject: [PATCH 44/89] OCA Transbot updated translations from Transifex --- account_analytic_required/i18n/ar.po | 147 ++++++++-------------- account_analytic_required/i18n/ca.po | 143 ++++++++-------------- account_analytic_required/i18n/es.po | 156 +++++++++++------------- account_analytic_required/i18n/fr.po | 145 ++++++++-------------- account_analytic_required/i18n/hr_HR.po | 105 ++++++++++++++++ account_analytic_required/i18n/nl.po | 118 ++++++++++-------- account_analytic_required/i18n/pt_BR.po | 95 +++++++++++++++ 7 files changed, 484 insertions(+), 425 deletions(-) create mode 100644 account_analytic_required/i18n/hr_HR.po create mode 100644 account_analytic_required/i18n/pt_BR.po diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po index 870152419f..4d31d9e2e9 100644 --- a/account_analytic_required/i18n/ar.po +++ b/account_analytic_required/i18n/ar.po @@ -1,120 +1,75 @@ -# Arabic translation for openobject-addons -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2012. -# +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2014-06-26 11:15+0000\n" -"Last-Translator: Pedro Manuel Baeza \n" -"Language-Team: Arabic \n" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-25 08:50+0000\n" +"PO-Revision-Date: 2017-04-25 08:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" -"X-Generator: Launchpad (build 17077)\n" +"Content-Transfer-Encoding: \n" +"Language: ar\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" #. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "سياسة للحسابات التحليلية" +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "نوع الحساب" #. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "" -"Set the policy for analytic accounts : if you select 'Optional', the " -"accountant is free to put an analytic account on an account move line with " -"this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" msgstr "" -"ضع سياسة للحسابات التحليلية: إذا قمت بتحديد \"الاختياري\"، فان المحاسب حر في " -"وضع حساب تحليلي على حساب خط التحرك مع هذا النوع من الحساب، وإذا قمت بتحديد " -"\"دائما\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان هناك لا يوجد حساب " -"تحليلي، وإذا قمت بتحديد \"أبدا\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان " -"هناك حساب تحليلي موجود" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "إختياري" #. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information +#: code:addons/account_analytic_required/models/account.py:52 +#, python-format msgid "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" +"Analytic policy is set to 'Always' with account %s '%s' but the analytic " +"account is missing in the account move line with label '%s'." msgstr "" -"هذه الوحدة تضيف خيار \"السياسة التحليلية\" على أنواع الحسابات. لديك خيار بين " -"3 سياسات: دائما، أبدا، واختياري.\n" -"\n" -"على سبيل المثال، إذا كنت تريد أن يكون لديك حساب تحليلي عن جميع النفقات " -"الخاصة بك، اختار النهج \"دائما\" من أجل نوع الحساب\"مصروف\"، ثم، إذا حاولت " -"حفظ الحركة في حساب مع حساب \"مصروف\" من دون حساب تحليلي، وسوف تحصل على " -"رسالة خطأ.\n" -"\n" -"طورت الوحدة بواسطة اتر أليكسيس دي alexis.delattre@akretion.com> Akretion-" -"Camptocamp من يونيو 2011\n" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "لا يمكنك انشاء حركة على الحساب" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "دائماً" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "أبدًا" - -#. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "مطلوب حساب تحليلي" #. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "قيمة دائنة أو مدينة خاطئة في القيد المحاسبي !" +#: code:addons/account_analytic_required/models/account.py:60 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account %s '%s' but the account move " +"line with label '%s' has an analytic account '%s'." +msgstr "" #. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." -msgstr "لا يمكنك عمل حركة على هذا الحساب" +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" +msgstr "" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "عناصر دفتر اليومية" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "نوع الحساب" +msgid "Journal Item" +msgstr "" #. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." -msgstr "يجب ان تكون الشركة نفس فترتها وحسابها المتعلق بها." +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "سياسة للحسابات التحليلية" #. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 -#, python-format -msgid "Error :" -msgstr "خطأ :" +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"ضع سياسة للحسابات التحليلية: إذا قمت بتحديد \"الاختياري\"، فان المحاسب حر في" +" وضع حساب تحليلي على حساب خط التحرك مع هذا النوع من الحساب، وإذا قمت بتحديد " +"\"دائما\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان هناك لا يوجد حساب " +"تحليلي، وإذا قمت بتحديد \"أبدا\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان" +" هناك حساب تحليلي موجود" diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po index 9048d66262..2abd17d891 100644 --- a/account_analytic_required/i18n/ca.po +++ b/account_analytic_required/i18n/ca.po @@ -1,120 +1,75 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_analytic_required -# +# * account_analytic_required +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 6.0.2\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2014-06-26 11:18+0000\n" -"Last-Translator: jmartin (Zikzakmedia) \n" -"Language-Team: \n" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-25 08:50+0000\n" +"PO-Revision-Date: 2017-04-25 08:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" -"X-Generator: Launchpad (build 17077)\n" +"Content-Transfer-Encoding: \n" +"Language: ca\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "Política per als comptes analítics" +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Tipus de compte" #. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "" -"Set the policy for analytic accounts : if you select 'Optional', the " -"accountant is free to put an analytic account on an account move line with " -"this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" msgstr "" -"Configura la política per als comptes analítics: Si seleccioneu 'Opcional', " -"el comptable és lliure de posar un compte analític en un apunt comptable amb " -"aquest tipus de compte; si seleccioneu 'Sempre', el comptable rebrà un " -"missatge d'error si l'apunt no té compte analític; si seleccioneu 'Mai', el " -"comptable rebrà un missatge d'error si l'apunt té un compte analític." - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "Opcional" #. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information +#: code:addons/account_analytic_required/models/account.py:52 +#, python-format msgid "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" +"Analytic policy is set to 'Always' with account %s '%s' but the analytic " +"account is missing in the account move line with label '%s'." msgstr "" -"Aquest mòdul afegeix una opció \"política analítica\" als tipus comptables. " -"Podeu escollir entre 3 polítiques: 'Sempre', 'Mai' i 'Opcional'.\n" -"\n" -"Per exemple, si voleu tenir un compte analític de totes les vostres " -"despeses, seleccioneu la política \"Sempre\" per al tipus comptable " -"\"Despesa\"; llavors, si intenteu desar un apunt comptable de tipus " -"comptable \"Despesa\" sense compte analític, obtindreu un missatge d'error.\n" -"\n" -"Mòdul desenvolupat per Alexis de Lattre " -"durant la cursa de codi Akretion-Camptocamp de juny de 2011.\n" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "No podeu crear un apunt en un compte tancat." - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "Sempre" #. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "Mai" - -#. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "El compte analític és requerit." - -#. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "Valor erroni al deure o a l'haver de l'assentament comptable!" +#: code:addons/account_analytic_required/models/account.py:60 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account %s '%s' but the account move " +"line with label '%s' has an analytic account '%s'." +msgstr "" #. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." -msgstr "No podeu crear un apunt en un compte de tipus \"Vista\"." +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" +msgstr "" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "Apunts comptables" +msgid "Journal Item" +msgstr "" #. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "Tipus de compte" +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "Política per als comptes analítics" #. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." msgstr "" -"La companyia ha de ser la mateixa que la dels comptes i períodes relacionats." - -#. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 -#, python-format -msgid "Error :" -msgstr "Error:" +"Configura la política per als comptes analítics: Si seleccioneu 'Opcional', " +"el comptable és lliure de posar un compte analític en un apunt comptable amb" +" aquest tipus de compte; si seleccioneu 'Sempre', el comptable rebrà un " +"missatge d'error si l'apunt no té compte analític; si seleccioneu 'Mai', el " +"comptable rebrà un missatge d'error si l'apunt té un compte analític." diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po index 8e21c58500..f4d44df1f6 100644 --- a/account_analytic_required/i18n/es.po +++ b/account_analytic_required/i18n/es.po @@ -1,122 +1,102 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_analytic_required -# +# * account_analytic_required +# +# Translators: +# OCA Transbot , 2017 +# Pedro M. Baeza , 2017 msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 6.0.2\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2014-06-26 11:18+0000\n" -"Last-Translator: jmartin (Zikzakmedia) \n" -"Language-Team: \n" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-21 02:39+0000\n" +"PO-Revision-Date: 2017-06-21 02:39+0000\n" +"Last-Translator: Pedro M. Baeza , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-27 07:09+0000\n" -"X-Generator: Launchpad (build 17077)\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "Política para las cuentas analíticas" - -#. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "" -"Set the policy for analytic accounts : if you select 'Optional', the " -"accountant is free to put an analytic account on an account move line with " -"this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." -msgstr "" -"Configura la política para las cuentas analíticas: Si selecciona 'Opcional', " -"el contable es libre de poner una cuenta analítica en un apunte contable de " -"este tipo de cuenta; si selecciona 'Siempre', el contable recibirá un " -"mensaje de error si el apunte no tiene cuenta analítica; si selecciona " -"'Nunca', el contable recibirá un mensaje de error si el apunte tiene una " -"cuenta analítica." +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Tipo de cuenta" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "Opcional" - -#. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information -msgid "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" +msgid "Always" msgstr "" -"Este módulo añade una opción \"política analítica\" a los tipos contables. " -"Puede escoger entre 3 políticas: 'Siempre', 'Nunca' y 'Opcional'.\n" -"\n" -"Por ejemplo, si quiere tener una cuenta analítica de todos sus gastos, " -"seleccione la política \"Siempre\" para el tipo contable \"Gasto\"; " -"entonces, si intenta guardar un apunte contable de tipo contable \"Gasto\" " -"sin cuenta analítica, obtendrá un mensaje de error.\n" -"\n" -"Módulo desarrollado por Alexis de Lattre " -"durante la carrera de código Akretion-Camptocamp de junio de 2011.\n" #. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "No puede crear un apunte en una cuenta cerrada." +#: selection:account.account.type,analytic_policy:0 +msgid "Always (analytic account or distribution)" +msgstr "Siempre (cuenta analítica o distribución)" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "Siempre" +msgid "Always (analytic distribution)" +msgstr "Siempre (distribución analítica)" #. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "Nunca" +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" +msgstr "" #. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "La cuenta analítica es requerida." +#: code:addons/account_analytic_required/models/account.py:47 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account %s '%s' but the analytic " +"account is missing in the account move line with label '%s'." +msgstr "" #. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "¡Valor erróneo en el debe o en el haber del asiento contable!" +#: code:addons/account_analytic_required/models/account.py:55 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account %s '%s' but the account move " +"line with label '%s' has an analytic account '%s'." +msgstr "" #. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." -msgstr "No puede crear un apunte en una cuenta de tipo \"Vista\"." +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" +msgstr "" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "Apuntes contables" +msgid "Journal Item" +msgstr "Apunte contable" #. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "Tipo de cuenta" +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "" #. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" msgstr "" -"La compañía debe ser la misma que la de las cuentas y los periodos " -"relacionados." #. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 -#, python-format -msgid "Error :" -msgstr "Error:" +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "Política para las cuentas analíticas" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Configura la política para las cuentas analíticas: Si selecciona 'Opcional'," +" el contable es libre de poner una cuenta analítica en un apunte contable de" +" este tipo de cuenta; si selecciona 'Siempre', el contable recibirá un " +"mensaje de error si el apunte no tiene cuenta analítica; si selecciona " +"'Nunca', el contable recibirá un mensaje de error si el apunte tiene una " +"cuenta analítica." diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po index 5b1a2fb2e6..f3ff2545cb 100644 --- a/account_analytic_required/i18n/fr.po +++ b/account_analytic_required/i18n/fr.po @@ -1,121 +1,76 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_analytic_required -# +# * account_analytic_required +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 6.0.2\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2014-06-26 11:18+0000\n" -"Last-Translator: Alexis de Lattre \n" -"Language-Team: \n" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-25 08:50+0000\n" +"PO-Revision-Date: 2017-04-25 08:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-27 07:08+0000\n" -"X-Generator: Launchpad (build 17077)\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "Politique pour les comptes analytiques" +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Type de compte" #. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "" -"Set the policy for analytic accounts : if you select 'Optional', the " -"accountant is free to put an analytic account on an account move line with " -"this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" msgstr "" -"Configurez la politique pour les comptes analytiques : si vous sélectionnez " -"'Optionnel', le comptable est libre de saisir ou non un compte analytique " -"sur une ligne comptable avec ce type de compte de comptabilité générale ; si " -"vous sélectionnez 'Toujours', le comptable aura un message d'erreur si il " -"n'y a pas de compte analytique ; si vous sélectionnez 'Jamais', le comptable " -"aura un message d'erreur si un compte analytique est présent." - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "Optionnel" #. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information +#: code:addons/account_analytic_required/models/account.py:52 +#, python-format msgid "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" +"Analytic policy is set to 'Always' with account %s '%s' but the analytic " +"account is missing in the account move line with label '%s'." msgstr "" -"This module adds an option \"analytic policy\" on account types. You have " -"the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, " -"set the policy to \"always\" for the account type \"expense\" ; then, if you " -"try to save an account move line with an account of type \"expense\" without " -"analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during " -"the Akretion-Camptocamp code sprint of June 2011.\n" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "Impossible de créer une ligne d'écriture sur un compte clôturé" #. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "Toujours" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "Jamais" - -#. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "Account analytic required" - -#. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "Valeur erronée au crédit ou au débit de la pièce comptable !" +#: code:addons/account_analytic_required/models/account.py:60 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account %s '%s' but the account move " +"line with label '%s' has an analytic account '%s'." +msgstr "" #. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" msgstr "" -"Vous ne pouvez pas créer de ligne d'écriture sur un compte de type \"Vue\"." #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "Écritures comptables" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "Type de compte" +msgid "Journal Item" +msgstr "" #. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." -msgstr "La société doit être la même pour les comptes et périodes liées." +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "Politique pour les comptes analytiques" #. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 -#, python-format -msgid "Error :" -msgstr "Erreur :" +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Configurez la politique pour les comptes analytiques : si vous sélectionnez " +"'Optionnel', le comptable est libre de saisir ou non un compte analytique " +"sur une ligne comptable avec ce type de compte de comptabilité générale ; si" +" vous sélectionnez 'Toujours', le comptable aura un message d'erreur si il " +"n'y a pas de compte analytique ; si vous sélectionnez 'Jamais', le comptable" +" aura un message d'erreur si un compte analytique est présent." diff --git a/account_analytic_required/i18n/hr_HR.po b/account_analytic_required/i18n/hr_HR.po new file mode 100644 index 0000000000..fb76b69a3a --- /dev/null +++ b/account_analytic_required/i18n/hr_HR.po @@ -0,0 +1,105 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +# Translators: +# OCA Transbot , 2017 +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-30 02:40+0000\n" +"PO-Revision-Date: 2017-06-30 02:40+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Tip konta" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Uvijek" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always (analytic account or distribution)" +msgstr "Uvjek (analitički konto ili distribucija)" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always (analytic distribution)" +msgstr "Uvjek (analitička distribucija)" + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" +msgstr "Analitička pravila" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:47 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account %s '%s' but the analytic " +"account is missing in the account move line with label '%s'." +msgstr "" +"Analitičko pravilo je postavljeno na 'Uvijek' za konto %s '%s' ali " +"analitički konto nedostaje u stavci temeljnice sa naslovom '%s'." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:55 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account %s '%s' but the account move " +"line with label '%s' has an analytic account '%s'." +msgstr "" +"Analitičko pravilo je postavljeno na 'Nikada' za konto %s '%s' ali na stavci" +" temeljnice sa oznakom '%s' postoji analitički konto '%s'." + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" +msgstr "Grupiraj po" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Stavka dnevnika" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Nikad" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Opcionalno" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "Pravila za analitička konta" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Postavite pravila za analitička konta: ako odaberete 'Opcionalno', " +"knjigovođa može slobodno birati hoće li postaviti analitički konto na stavke" +" temeljnice ovog tipa konta, ako odaberete 'Uvijek', knjigovođa će dobiti " +"upozorenje o grešci ako ga nema, i ako odaberete 'Nikad' knjigovođa će " +"dobiti upozorenje o greški ako postoji analitički konto." diff --git a/account_analytic_required/i18n/nl.po b/account_analytic_required/i18n/nl.po index 858970d417..79b39d3d3b 100644 --- a/account_analytic_required/i18n/nl.po +++ b/account_analytic_required/i18n/nl.po @@ -1,78 +1,92 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_analytic_required -# +# * account_analytic_required +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 6.1\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2013-04-17 07:49+0000\n" -"Last-Translator: \n" -"Language-Team: \n" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-24 09:51+0000\n" +"PO-Revision-Date: 2017-05-24 09:51+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "Kostenplaatsenbeleid" +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "" #. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Never', the accountant will get an error message if an analytic account is present." -msgstr "Stel het beleid in voor kostenplaatsen: bij 'Altijd' is het opgeven van een kostenplaats verplicht bij rekeningen van dit type. 'Nooit': er treedt een foutmelding op als er bij een boeking een kostenplaats wordt opgegeven. 'Optioneel': het staat de medewerker vrij om al dan niet een kostenplaats op te geven." +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "" #. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "Optioneel" +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" +msgstr "" #. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information -msgid "This module adds an option 'analytic policy' on account types. You have the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, set the policy to 'always' for the account type 'expense' ; then, if you try to save an account move line with an account of type 'expense' without analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011.\n" -msgstr "Deze module voegt de optie 'Beleid kostenplaatsen' toe aan rekeningcategorieën. Er zijn drie mogelijkheden: altijd, nooit en optioneel.\n" -"\n" -"Bij voorbeeld, als je wilt afdwingen dat er altijd een kostenplaats wordt opgegeven bij boekingen op een kostenrekening, zet dan het beleid op 'altijd' voor het rekeningtype 'Kosten'. Vanaf dat moment krijgt de medewerker een foutmelding als er geprobeerd wordt om een boeking te maken op een rekening van dit type zonder dat er een kostenplaats is opgegeven.\n" -"\n" -"Deze module is ontwikkeld door Alexis de Lattre tijdens de Akretion-Camptocamp code sprint van juni 2011.\n" +#: code:addons/account_analytic_required/models/account.py:47 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account %s '%s' but the analytic " +"account is missing in the account move line with label '%s'." +msgstr "" +"Het is verplicht een kostenplaats op te geven bij boekingen op rekening %s " +"'%s', maar deze ontbreekt in de boekingsregel met de omschrijving '%s'." #. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "Altijd" +#: code:addons/account_analytic_required/models/account.py:55 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account %s '%s' but the account move " +"line with label '%s' has an analytic account '%s'." +msgstr "" #. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "Nooit" +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" +msgstr "" #. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "Kostenplaatsenbeleid" +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:54 -#: code:addons/account_analytic_required/account.py:62 -#, python-format -msgid "Error :" -msgstr "Fout:" +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:55 -#, python-format -msgid "Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." -msgstr "Het is verplicht een kostenplaats op te geven bij boekingen op rekening %s '%s', maar deze ontbreekt in de boekingsregel met de omschrijving '%s'." +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:63 -#, python-format -msgid "Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." -msgstr "Het is niet toegestaan om een kostenplaats op te geven bij boekingen op rekening %s '%s', maar in boekingsregel met de omschrijving '%s' staat toch de kostenplaats %s '%s'." +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "Kostenplaatsenbeleid" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Stel het beleid in voor kostenplaatsen: bij 'Altijd' is het opgeven van een " +"kostenplaats verplicht bij rekeningen van dit type. 'Nooit': er treedt een " +"foutmelding op als er bij een boeking een kostenplaats wordt opgegeven. " +"'Optioneel': het staat de medewerker vrij om al dan niet een kostenplaats op" +" te geven." diff --git a/account_analytic_required/i18n/pt_BR.po b/account_analytic_required/i18n/pt_BR.po new file mode 100644 index 0000000000..444da11ae9 --- /dev/null +++ b/account_analytic_required/i18n/pt_BR.po @@ -0,0 +1,95 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +# Translators: +# Rodrigo de Almeida Sottomaior Macedo , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-13 09:51+0000\n" +"PO-Revision-Date: 2017-06-13 09:51+0000\n" +"Last-Translator: Rodrigo de Almeida Sottomaior Macedo , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Tipo de Conta" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Sempre" + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" +msgstr "Política Analítica" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:47 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account %s '%s' but the analytic " +"account is missing in the account move line with label '%s'." +msgstr "" +"A política analítica é definida como \"Sempre\" com conta%s '%s' Mas a conta" +" analítica está faltando na linha de mudança de conta com o rótulo '%s'." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:55 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account %s '%s' but the account move " +"line with label '%s' has an analytic account '%s'." +msgstr "" +"A política analítica é definida como \"Nunca\" com conta%s '%s' mas a linha " +"de movimento da conta com o rótulo '%s' tem uma conta analítica '%s'." + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" +msgstr "Agrupar por" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Item diário" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Nunca" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Opcional" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "Política para conta analítica" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Never', the " +"accountant will get an error message if an analytic account is present." +msgstr "" +"Defina a política para contas analíticas: se você selecionar \"Opcional\", o" +" contador é livre para colocar uma conta analítica em uma linha de mudança " +"de conta com esse tipo de conta; Se você selecionar 'Sempre', o contador " +"receberá uma mensagem de erro se não houver uma conta analítica; Se você " +"selecionar 'Nunca', o contador receberá uma mensagem de erro se uma conta " +"analítica estiver presente." From e435130324733db419cf3bf7b31ba3a55d836aa8 Mon Sep 17 00:00:00 2001 From: Artem Kostyuk Date: Wed, 13 Dec 2017 16:53:20 +0200 Subject: [PATCH 45/89] [MIG] account_analytic_required: Migrate to 11.0 --- account_analytic_required/README.rst | 4 +- account_analytic_required/__manifest__.py | 11 +-- .../i18n/account_analytic_required.pot | 94 ------------------- account_analytic_required/i18n/ar.po | 2 +- account_analytic_required/i18n/ca.po | 2 +- account_analytic_required/i18n/es.po | 2 +- account_analytic_required/i18n/fr.po | 2 +- account_analytic_required/i18n/hr_HR.po | 2 +- account_analytic_required/i18n/nl.po | 2 +- account_analytic_required/i18n/pt_BR.po | 2 +- account_analytic_required/models/account.py | 7 +- .../tests/test_account_analytic_required.py | 46 ++++----- account_analytic_required/views/account.xml | 2 +- 13 files changed, 44 insertions(+), 134 deletions(-) delete mode 100644 account_analytic_required/i18n/account_analytic_required.pot diff --git a/account_analytic_required/README.rst b/account_analytic_required/README.rst index ad888a492c..f657be0783 100644 --- a/account_analytic_required/README.rst +++ b/account_analytic_required/README.rst @@ -22,7 +22,7 @@ Usage .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/87/10.0 + :target: https://runbot.odoo-community.org/runbot/87/11.0 Bug Tracker =========== @@ -39,7 +39,7 @@ Contributors ------------ * Alexis de Lattre * Stéphane Bidoul -* Sefan Rijnhart +* Stefan Rijnhart * Laetitia Gangloff * Luc De Meyer, Noviat * Yannick Vaucher diff --git a/account_analytic_required/__manifest__.py b/account_analytic_required/__manifest__.py index 4b195b4d48..acd5f3ed09 100644 --- a/account_analytic_required/__manifest__.py +++ b/account_analytic_required/__manifest__.py @@ -1,14 +1,13 @@ -# -*- coding: utf-8 -*- -# © 2011-2016 Akretion (Alexis de Lattre ) -# © 2016 Camptocamp SA +# Copyright 2011-2016 Akretion - Alexis de Lattre +# Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { 'name': 'Account Analytic Required', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'category': 'Analytic Accounting', 'license': 'AGPL-3', - 'author': "Akretion,Odoo Community Association (OCA)", - 'website': 'http://www.akretion.com/', + 'author': "Akretion, Odoo Community Association (OCA)", + 'website': 'https://github.com/OCA/account-analytic', 'depends': ['account', 'account_type_menu'], 'data': ['views/account.xml'], 'installable': True, diff --git a/account_analytic_required/i18n/account_analytic_required.pot b/account_analytic_required/i18n/account_analytic_required.pot deleted file mode 100644 index 6724a8fcd3..0000000000 --- a/account_analytic_required/i18n/account_analytic_required.pot +++ /dev/null @@ -1,94 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_analytic_required -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0.2\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-06-10 07:49+0000\n" -"PO-Revision-Date: 2011-06-10 07:49+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_analytic_required -#: field:account.account.type,analytic_policy:0 -msgid "Policy for analytic account" -msgstr "" - -#. module: account_analytic_required -#: help:account.account.type,analytic_policy:0 -msgid "Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Never', the accountant will get an error message if an analytic account is present." -msgstr "" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Optional" -msgstr "" - -#. module: account_analytic_required -#: model:ir.module.module,description:account_analytic_required.module_meta_information -msgid "This module adds an option \"analytic policy\" on account types. You have the choice between 3 policies : always, never and optional.\n" -"\n" -"For example, if you want to have an analytic account on all your expenses, set the policy to \"always\" for the account type \"expense\" ; then, if you try to save an account move line with an account of type \"expense\" without analytic account, you will get an error message.\n" -"\n" -"Module developped by Alexis de Lattre during the Akretion-Camptocamp code sprint of June 2011.\n" -"" -msgstr "" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on closed account." -msgstr "" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always" -msgstr "" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Never" -msgstr "" - -#. module: account_analytic_required -#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information -msgid "Account analytic required" -msgstr "" - -#. module: account_analytic_required -#: sql_constraint:account.move.line:0 -msgid "Wrong credit or debit value in accounting entry !" -msgstr "" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "You can not create move line on view account." -msgstr "" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move_line -msgid "Journal Items" -msgstr "" - -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_account_type -msgid "Account Type" -msgstr "" - -#. module: account_analytic_required -#: constraint:account.move.line:0 -msgid "Company must be same for its related account and period." -msgstr "" - -#. module: account_analytic_required -#: code:addons/account_analytic_required/account.py:53 -#: code:addons/account_analytic_required/account.py:56 -#, python-format -msgid "Error :" -msgstr "" - diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po index 4d31d9e2e9..ed7817cf63 100644 --- a/account_analytic_required/i18n/ar.po +++ b/account_analytic_required/i18n/ar.po @@ -6,7 +6,7 @@ # OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-04-25 08:50+0000\n" "PO-Revision-Date: 2017-04-25 08:50+0000\n" diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po index 2abd17d891..bc407ab22c 100644 --- a/account_analytic_required/i18n/ca.po +++ b/account_analytic_required/i18n/ca.po @@ -6,7 +6,7 @@ # OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-04-25 08:50+0000\n" "PO-Revision-Date: 2017-04-25 08:50+0000\n" diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po index f4d44df1f6..0305ffeb1f 100644 --- a/account_analytic_required/i18n/es.po +++ b/account_analytic_required/i18n/es.po @@ -7,7 +7,7 @@ # Pedro M. Baeza , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-06-21 02:39+0000\n" "PO-Revision-Date: 2017-06-21 02:39+0000\n" diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po index f3ff2545cb..2676610b60 100644 --- a/account_analytic_required/i18n/fr.po +++ b/account_analytic_required/i18n/fr.po @@ -6,7 +6,7 @@ # OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-04-25 08:50+0000\n" "PO-Revision-Date: 2017-04-25 08:50+0000\n" diff --git a/account_analytic_required/i18n/hr_HR.po b/account_analytic_required/i18n/hr_HR.po index fb76b69a3a..4e53712eb8 100644 --- a/account_analytic_required/i18n/hr_HR.po +++ b/account_analytic_required/i18n/hr_HR.po @@ -7,7 +7,7 @@ # Bole , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-06-30 02:40+0000\n" "PO-Revision-Date: 2017-06-30 02:40+0000\n" diff --git a/account_analytic_required/i18n/nl.po b/account_analytic_required/i18n/nl.po index 79b39d3d3b..fec3e3ffdf 100644 --- a/account_analytic_required/i18n/nl.po +++ b/account_analytic_required/i18n/nl.po @@ -6,7 +6,7 @@ # OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-05-24 09:51+0000\n" "PO-Revision-Date: 2017-05-24 09:51+0000\n" diff --git a/account_analytic_required/i18n/pt_BR.po b/account_analytic_required/i18n/pt_BR.po index 444da11ae9..285b0d5aee 100644 --- a/account_analytic_required/i18n/pt_BR.po +++ b/account_analytic_required/i18n/pt_BR.po @@ -6,7 +6,7 @@ # Rodrigo de Almeida Sottomaior Macedo , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-06-13 09:51+0000\n" "PO-Revision-Date: 2017-06-13 09:51+0000\n" diff --git a/account_analytic_required/models/account.py b/account_analytic_required/models/account.py index 8be70c4aab..770f5e1636 100644 --- a/account_analytic_required/models/account.py +++ b/account_analytic_required/models/account.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2011-2016 Akretion (Alexis de Lattre ) -# © 2016 Camptocamp SA +# Copyright 2011-2016 Akretion - Alexis de Lattre +# Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from odoo import _, api, exceptions, fields, models @@ -59,6 +58,8 @@ def _check_analytic_required_msg(self): move_line.account_id.name, move_line.name, move_line.analytic_account_id.name_get()[0][1]) + else: + return None @api.constrains('analytic_account_id', 'account_id', 'debit', 'credit') def _check_analytic_required(self): diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index fc1b77e2c4..4202500917 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2014 Acsone +# Copyright 2014 Acsone # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from datetime import datetime @@ -7,43 +6,48 @@ from odoo import exceptions -class TestAccountAnalyticRequired(common.TransactionCase): +class TestAccountAnalyticRequired(common.SavepointCase): - def setUp(self): - super(TestAccountAnalyticRequired, self).setUp() - self.account_obj = self.env['account.account'] - self.account_type_obj = self.env['account.account.type'] - self.move_obj = self.env['account.move'] - self.move_line_obj = self.env['account.move.line'] - self.analytic_account_obj = self.env['account.analytic.account'] - self.analytic_account = self.analytic_account_obj.create( + @classmethod + def setUpClass(cls): + super(TestAccountAnalyticRequired, cls).setUpClass() + cls.account_obj = cls.env['account.account'] + cls.account_type_obj = cls.env['account.account.type'] + cls.move_obj = cls.env['account.move'] + cls.move_line_obj = cls.env['account.move.line'] + cls.analytic_account_obj = cls.env['account.analytic.account'] + cls.analytic_account = cls.analytic_account_obj.create( {'name': 'test aa'}) - self.account_sales = self.env['account.account'].create({ + cls.account_sales = cls.env['account.account'].create({ 'code': "X1020", 'name': "Product Sales - (test)", - 'user_type_id': self.ref('account.data_account_type_revenue') + 'user_type_id': cls.env.ref( + 'account.data_account_type_revenue').id }) - self.account_recv = self.env['account.account'].create({ + cls.account_recv = cls.env['account.account'].create({ 'code': "X11002", 'name': "Debtors - (test)", 'reconcile': True, - 'user_type_id': self.ref('account.data_account_type_receivable') + 'user_type_id': cls.env.ref( + 'account.data_account_type_receivable').id }) - self.account_exp = self.env['account.account'].create({ + cls.account_exp = cls.env['account.account'].create({ 'code': "X2110", 'name': "Expenses - (test)", - 'user_type_id': self.ref('account.data_account_type_expenses') + 'user_type_id': cls.env.ref( + 'account.data_account_type_expenses').id }) - self.sales_journal = self.env['account.journal'].create({ + cls.sales_journal = cls.env['account.journal'].create({ 'name': "Sales Journal - (test)", 'code': "TSAJ", 'type': "sale", 'refund_sequence': True, - 'default_debit_account_id': self.account_sales.id, - 'default_credit_account_id': self.account_sales.id, + 'default_debit_account_id': cls.account_sales.id, + 'default_credit_account_id': cls.account_sales.id, }) - def _create_move(self, with_analytic, amount=100): + def _create_move(self, amount=100, **kwargs): + with_analytic = kwargs.get('with_analytic') date = datetime.now() ml_obj = self.move_line_obj.with_context(check_move_validity=False) move_vals = { diff --git a/account_analytic_required/views/account.xml b/account_analytic_required/views/account.xml index ac20324473..d8cc04dd94 100644 --- a/account_analytic_required/views/account.xml +++ b/account_analytic_required/views/account.xml @@ -1,6 +1,6 @@ From 03471a5011aeb7da246408441bd203f6fa2ff578 Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Fri, 22 Dec 2017 14:37:18 +0100 Subject: [PATCH 46/89] [IMP] account_analytic_required: Add 'posted moves' as analytic policy --- account_analytic_required/README.rst | 4 ++- account_analytic_required/models/account.py | 26 +++++++++++++++++-- .../tests/test_account_analytic_required.py | 10 +++++++ 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/account_analytic_required/README.rst b/account_analytic_required/README.rst index f657be0783..25b5de7183 100644 --- a/account_analytic_required/README.rst +++ b/account_analytic_required/README.rst @@ -7,7 +7,8 @@ Account Analytic Required ========================= This module adds an option *analytic policy* on account types. -You have the choice between 3 policies : *always*, *never* and *optional*. +You have the choice between 4 policies : *always*, *never*, *posted moves* and +*optional*. Configuration ============= @@ -43,6 +44,7 @@ Contributors * Laetitia Gangloff * Luc De Meyer, Noviat * Yannick Vaucher +* Akim Juillerat Maintainer ---------- diff --git a/account_analytic_required/models/account.py b/account_analytic_required/models/account.py index 770f5e1636..280b3108f4 100644 --- a/account_analytic_required/models/account.py +++ b/account_analytic_required/models/account.py @@ -12,6 +12,7 @@ class AccountAccountType(models.Model): analytic_policy = fields.Selection( selection=[('optional', 'Optional'), ('always', 'Always'), + ('posted', 'Posted moves'), ('never', 'Never')], string='Policy for analytic account', required=True, @@ -20,11 +21,23 @@ class AccountAccountType(models.Model): "'Optional', the accountant is free to put an analytic account " "on an account move line with this type of account ; if you " "select 'Always', the accountant will get an error message if " - "there is no analytic account ; if you select 'Never', the " - "accountant will get an error message if an analytic account " + "there is no analytic account ; if you select 'Posted moves', " + "the accountant will get an error message if no analytic account " + "is defined when the move is posted ; if you select 'Never', " + "the accountant will get an error message if an analytic account " "is present.") +class AccountMove(models.Model): + _inherit = "account.move" + + @api.multi + def post(self): + res = super(AccountMove, self).post() + self.mapped('line_ids')._check_analytic_required() + return res + + class AccountMoveLine(models.Model): _inherit = "account.move.line" @@ -58,6 +71,15 @@ def _check_analytic_required_msg(self): move_line.account_id.name, move_line.name, move_line.analytic_account_id.name_get()[0][1]) + elif (analytic_policy == 'posted' and + not move_line.analytic_account_id and + move_line.move_id.state == 'posted'): + return _("Analytic policy is set to 'Posted moves' with " + "account %s '%s' but the analytic account is missing " + "in the account move line with label '%s'." + ) % (move_line.account_id.code, + move_line.account_id.name, + move_line.name) else: return None diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index 4202500917..b5cc8c845e 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -130,3 +130,13 @@ def test_change_account(self): line.write({ 'account_id': self.account_exp.id, 'analytic_account_id': self.analytic_account.id}) + + def test_posted(self): + self._set_analytic_policy('posted') + line = self._create_move(with_analytic=False) + move = line.move_id + with self.assertRaises(exceptions.ValidationError): + move.post() + line.write({'analytic_account_id': self.analytic_account.id}) + move.post() + self.assertEqual(move.state, 'posted') From 550cf4937ea40508df6813faa46fa71984855b61 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 3 Feb 2018 00:02:38 +0100 Subject: [PATCH 47/89] OCA Transbot updated translations from Transifex --- account_analytic_required/i18n/ar.po | 56 +++++++++--- account_analytic_required/i18n/ca.po | 56 +++++++++--- account_analytic_required/i18n/de.po | 114 ++++++++++++++++++++++++ account_analytic_required/i18n/es.po | 53 +++++------ account_analytic_required/i18n/es_CO.po | 105 ++++++++++++++++++++++ account_analytic_required/i18n/fr.po | 80 +++++++++++++---- account_analytic_required/i18n/hr_HR.po | 52 ++++++----- account_analytic_required/i18n/nl.po | 41 ++++++--- account_analytic_required/i18n/pt_BR.po | 42 ++++++--- 9 files changed, 480 insertions(+), 119 deletions(-) create mode 100644 account_analytic_required/i18n/de.po create mode 100644 account_analytic_required/i18n/es_CO.po diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po index ed7817cf63..eba8068eae 100644 --- a/account_analytic_required/i18n/ar.po +++ b/account_analytic_required/i18n/ar.po @@ -3,14 +3,14 @@ # * account_analytic_required # # Translators: -# OCA Transbot , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-04-25 08:50+0000\n" -"PO-Revision-Date: 2017-04-25 08:50+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-02-01 03:39+0000\n" +"PO-Revision-Date: 2018-02-01 03:39+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,18 +18,28 @@ msgstr "" "Language: ar\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" msgstr "نوع الحساب" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "" + #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:52 +#: code:addons/account_analytic_required/models/account.py:59 #, python-format msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " @@ -37,13 +47,21 @@ msgid "" msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:60 +#: code:addons/account_analytic_required/models/account.py:67 #, python-format msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " "line with label '%s' has an analytic account '%s'." msgstr "" +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account %s '%s' but the " +"analytic account is missing in the account move line with label '%s'." +msgstr "" + #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" @@ -54,22 +72,34 @@ msgstr "" msgid "Journal Item" msgstr "" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "" + #. module: account_analytic_required #: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy msgid "Policy for analytic account" msgstr "سياسة للحسابات التحليلية" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "" + #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " "this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +"error message if there is no analytic account ; if you select 'Posted " +"moves', the accountant will get an error message if no analytic account is " +"defined when the move is posted ; if you select 'Never', the accountant will" +" get an error message if an analytic account is present." msgstr "" -"ضع سياسة للحسابات التحليلية: إذا قمت بتحديد \"الاختياري\"، فان المحاسب حر في" -" وضع حساب تحليلي على حساب خط التحرك مع هذا النوع من الحساب، وإذا قمت بتحديد " -"\"دائما\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان هناك لا يوجد حساب " -"تحليلي، وإذا قمت بتحديد \"أبدا\"، فان المحاسب سوف يحصل على رسالة خطأ إذا كان" -" هناك حساب تحليلي موجود" diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po index bc407ab22c..7463f5dc0a 100644 --- a/account_analytic_required/i18n/ca.po +++ b/account_analytic_required/i18n/ca.po @@ -3,14 +3,14 @@ # * account_analytic_required # # Translators: -# OCA Transbot , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-04-25 08:50+0000\n" -"PO-Revision-Date: 2017-04-25 08:50+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-02-01 03:39+0000\n" +"PO-Revision-Date: 2018-02-01 03:39+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,18 +18,28 @@ msgstr "" "Language: ca\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" msgstr "Tipus de compte" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "" + #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:52 +#: code:addons/account_analytic_required/models/account.py:59 #, python-format msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " @@ -37,13 +47,21 @@ msgid "" msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:60 +#: code:addons/account_analytic_required/models/account.py:67 #, python-format msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " "line with label '%s' has an analytic account '%s'." msgstr "" +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account %s '%s' but the " +"analytic account is missing in the account move line with label '%s'." +msgstr "" + #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" @@ -54,22 +72,34 @@ msgstr "" msgid "Journal Item" msgstr "" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "" + #. module: account_analytic_required #: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy msgid "Policy for analytic account" msgstr "Política per als comptes analítics" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "" + #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " "this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +"error message if there is no analytic account ; if you select 'Posted " +"moves', the accountant will get an error message if no analytic account is " +"defined when the move is posted ; if you select 'Never', the accountant will" +" get an error message if an analytic account is present." msgstr "" -"Configura la política per als comptes analítics: Si seleccioneu 'Opcional', " -"el comptable és lliure de posar un compte analític en un apunt comptable amb" -" aquest tipus de compte; si seleccioneu 'Sempre', el comptable rebrà un " -"missatge d'error si l'apunt no té compte analític; si seleccioneu 'Mai', el " -"comptable rebrà un missatge d'error si l'apunt té un compte analític." diff --git a/account_analytic_required/i18n/de.po b/account_analytic_required/i18n/de.po new file mode 100644 index 0000000000..dd78e8bf37 --- /dev/null +++ b/account_analytic_required/i18n/de.po @@ -0,0 +1,114 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +# Translators: +# Ricardo Gross , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-16 23:08+0000\n" +"PO-Revision-Date: 2018-03-16 23:08+0000\n" +"Last-Translator: Ricardo Gross , 2018\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "Kontoeintrag" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Konto Typ" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Immer" + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" +msgstr "Analytische Richtlinie" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:59 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account %s '%s' but the analytic " +"account is missing in the account move line with label '%s'." +msgstr "" +"Die Analytic-Richtlinie ist mit dem Konto %s ' %s' auf 'Immer' " +"eingestellt, aber im Analysekonto fehlt in der Buchungslinie mit der " +"Bezeichnung ' %s '." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:67 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account %s '%s' but the account move " +"line with label '%s' has an analytic account '%s'." +msgstr "" +"Die Analytic-Richtlinie ist auf \"Nie\" eingestellt mit Konto %s ' %s' aber" +" die Buchungslinie mit Marke ' %s ' hat ein anlaytisches Konto ' %s '. " + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account %s '%s' but the " +"analytic account is missing in the account move line with label '%s'." +msgstr "" +"Die Analytic-Richtlinie ist auf \"Posted moves\" eingestellt mit dem Konto \n" +"%s ' %s ' aber das analytische Konto fehlt in der Buchungslinie mit dem Label ' %s'." + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" +msgstr "Gruppe Von" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Tageseintrag" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Nie" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Wahlweise" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "Richtlinie für analytisches Konto" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "Buchungen" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Posted " +"moves', the accountant will get an error message if no analytic account is " +"defined when the move is posted ; if you select 'Never', the accountant will" +" get an error message if an analytic account is present." +msgstr "" +"Legen Sie die Richtlinie für analytische Konten fest: \n" +"Wenn Sie \"Optional\" auswählen, kann der Buchhalter ein analytisches Konto in einer Kontobewegungslinie mit diesem Kontotyp anlegen. Wenn Sie \"Immer\" auswählen, erhält der Buchhalter eine Fehlermeldung, wenn kein analytisches Konto vorhanden ist. Wenn Sie \"Posted moves\" auswählen, erhält der Buchhalter eine Fehlermeldung, wenn bei der Buchung kein analytisches Konto definiert wurde. Wenn Sie \"Nie\" auswählen, erhält der Buchhalter eine Fehlermeldung, wenn ein analytisches Konto vorhanden ist." diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po index 0305ffeb1f..a1847cef8c 100644 --- a/account_analytic_required/i18n/es.po +++ b/account_analytic_required/i18n/es.po @@ -3,15 +3,14 @@ # * account_analytic_required # # Translators: -# OCA Transbot , 2017 -# Pedro M. Baeza , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-21 02:39+0000\n" -"PO-Revision-Date: 2017-06-21 02:39+0000\n" -"Last-Translator: Pedro M. Baeza , 2017\n" +"POT-Creation-Date: 2018-02-01 03:39+0000\n" +"PO-Revision-Date: 2018-02-01 03:39+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,6 +18,11 @@ msgstr "" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -29,23 +33,13 @@ msgstr "Tipo de cuenta" msgid "Always" msgstr "" -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always (analytic account or distribution)" -msgstr "Siempre (cuenta analítica o distribución)" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always (analytic distribution)" -msgstr "Siempre (distribución analítica)" - #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:47 +#: code:addons/account_analytic_required/models/account.py:59 #, python-format msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " @@ -53,13 +47,21 @@ msgid "" msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:55 +#: code:addons/account_analytic_required/models/account.py:67 #, python-format msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " "line with label '%s' has an analytic account '%s'." msgstr "" +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account %s '%s' but the " +"analytic account is missing in the account move line with label '%s'." +msgstr "" + #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" @@ -85,18 +87,19 @@ msgstr "" msgid "Policy for analytic account" msgstr "Política para las cuentas analíticas" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "" + #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " "this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +"error message if there is no analytic account ; if you select 'Posted " +"moves', the accountant will get an error message if no analytic account is " +"defined when the move is posted ; if you select 'Never', the accountant will" +" get an error message if an analytic account is present." msgstr "" -"Configura la política para las cuentas analíticas: Si selecciona 'Opcional'," -" el contable es libre de poner una cuenta analítica en un apunte contable de" -" este tipo de cuenta; si selecciona 'Siempre', el contable recibirá un " -"mensaje de error si el apunte no tiene cuenta analítica; si selecciona " -"'Nunca', el contable recibirá un mensaje de error si el apunte tiene una " -"cuenta analítica." diff --git a/account_analytic_required/i18n/es_CO.po b/account_analytic_required/i18n/es_CO.po new file mode 100644 index 0000000000..ffde03b5bf --- /dev/null +++ b/account_analytic_required/i18n/es_CO.po @@ -0,0 +1,105 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +# Translators: +# JOSE ALEJANDRO ECHEVERRI VALENCIA , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-01 03:39+0000\n" +"PO-Revision-Date: 2018-02-01 03:39+0000\n" +"Last-Translator: JOSE ALEJANDRO ECHEVERRI VALENCIA , 2018\n" +"Language-Team: Spanish (Colombia) (https://www.transifex.com/oca/teams/23907/es_CO/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es_CO\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "Tipo de Cuenta" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Siempre" + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" +msgstr "" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:59 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account %s '%s' but the analytic " +"account is missing in the account move line with label '%s'." +msgstr "" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:67 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account %s '%s' but the account move " +"line with label '%s' has an analytic account '%s'." +msgstr "" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account %s '%s' but the " +"analytic account is missing in the account move line with label '%s'." +msgstr "" + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Elemento del Libro" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "" +"Set the policy for analytic accounts : if you select 'Optional', the " +"accountant is free to put an analytic account on an account move line with " +"this type of account ; if you select 'Always', the accountant will get an " +"error message if there is no analytic account ; if you select 'Posted " +"moves', the accountant will get an error message if no analytic account is " +"defined when the move is posted ; if you select 'Never', the accountant will" +" get an error message if an analytic account is present." +msgstr "" diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po index 2676610b60..c406160c93 100644 --- a/account_analytic_required/i18n/fr.po +++ b/account_analytic_required/i18n/fr.po @@ -3,14 +3,16 @@ # * account_analytic_required # # Translators: -# OCA Transbot , 2017 +# OCA Transbot , 2018 +# Quentin THEURET , 2018 +# Nicolas JEUDY , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-04-25 08:50+0000\n" -"PO-Revision-Date: 2017-04-25 08:50+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-02-02 23:18+0000\n" +"PO-Revision-Date: 2018-02-02 23:18+0000\n" +"Last-Translator: Nicolas JEUDY , 2018\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,59 +20,103 @@ msgstr "" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "Ecriture comptable" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" msgstr "Type de compte" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "Toujours" + #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" -msgstr "" +msgstr "Stratégie analytique" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:52 +#: code:addons/account_analytic_required/models/account.py:59 #, python-format msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " "account is missing in the account move line with label '%s'." msgstr "" +"La règle analytique est définie sur 'Toujours' pour le compte%s'%s'mais le " +"compte analytique est absent de l'écriture ayant libellé '%s'." #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:60 +#: code:addons/account_analytic_required/models/account.py:67 #, python-format msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " "line with label '%s' has an analytic account '%s'." msgstr "" +"La règle analytique est définie sur 'Jamais' pour le compte %s '%s' mais " +"l'écriture avec le libellé '%s' a un compte analytique de définit '%s'." + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account %s '%s' but the " +"analytic account is missing in the account move line with label '%s'." +msgstr "" +"La règle analytique est définie à 'Ecritures comptabilisées' pour le compte " +"%s '%s' mais le compte analytique est absent de l'écriture ayant le libellé " +"'%s'." #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" -msgstr "" +msgstr "Grouper par" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" -msgstr "" +msgstr "Écriture du journal" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "Jamais" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "Facultatif" #. module: account_analytic_required #: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy msgid "Policy for analytic account" msgstr "Politique pour les comptes analytiques" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "Ecritures comptabilisées" + #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " "this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +"error message if there is no analytic account ; if you select 'Posted " +"moves', the accountant will get an error message if no analytic account is " +"defined when the move is posted ; if you select 'Never', the accountant will" +" get an error message if an analytic account is present." msgstr "" -"Configurez la politique pour les comptes analytiques : si vous sélectionnez " -"'Optionnel', le comptable est libre de saisir ou non un compte analytique " -"sur une ligne comptable avec ce type de compte de comptabilité générale ; si" -" vous sélectionnez 'Toujours', le comptable aura un message d'erreur si il " -"n'y a pas de compte analytique ; si vous sélectionnez 'Jamais', le comptable" -" aura un message d'erreur si un compte analytique est présent." +"Définissez la règle pour les comptes analytiques: si vous sélectionnez " +"'Facultatif', le comptable est libre de mettre un compte analytique sur une " +"écriture comptable avec ce type de compte; si vous sélectionnez 'Toujours', " +"le comptable recevra un message d'erreur s'il n' y a pas de compte " +"analytique; Si vous sélectionnez \"Ecritures comptabilisées\", le comptable " +"recevra un message d'erreur si aucun compte analytique n'est défini lors de " +"la comptabilisation de l'écriture; si vous sélectionnez \"Jamais\", le " +"comptable recevra un message d'erreur si un compte analytique est présent." diff --git a/account_analytic_required/i18n/hr_HR.po b/account_analytic_required/i18n/hr_HR.po index 4e53712eb8..8ed78fa897 100644 --- a/account_analytic_required/i18n/hr_HR.po +++ b/account_analytic_required/i18n/hr_HR.po @@ -3,15 +3,14 @@ # * account_analytic_required # # Translators: -# OCA Transbot , 2017 -# Bole , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-30 02:40+0000\n" -"PO-Revision-Date: 2017-06-30 02:40+0000\n" -"Last-Translator: Bole , 2017\n" +"POT-Creation-Date: 2018-02-01 03:39+0000\n" +"PO-Revision-Date: 2018-02-01 03:39+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,6 +18,11 @@ msgstr "" "Language: hr_HR\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -29,23 +33,13 @@ msgstr "Tip konta" msgid "Always" msgstr "Uvijek" -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always (analytic account or distribution)" -msgstr "Uvjek (analitički konto ili distribucija)" - -#. module: account_analytic_required -#: selection:account.account.type,analytic_policy:0 -msgid "Always (analytic distribution)" -msgstr "Uvjek (analitička distribucija)" - #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "Analitička pravila" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:47 +#: code:addons/account_analytic_required/models/account.py:59 #, python-format msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " @@ -55,7 +49,7 @@ msgstr "" "analitički konto nedostaje u stavci temeljnice sa naslovom '%s'." #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:55 +#: code:addons/account_analytic_required/models/account.py:67 #, python-format msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " @@ -64,6 +58,14 @@ msgstr "" "Analitičko pravilo je postavljeno na 'Nikada' za konto %s '%s' ali na stavci" " temeljnice sa oznakom '%s' postoji analitički konto '%s'." +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account %s '%s' but the " +"analytic account is missing in the account move line with label '%s'." +msgstr "" + #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" @@ -89,17 +91,19 @@ msgstr "Opcionalno" msgid "Policy for analytic account" msgstr "Pravila za analitička konta" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "" + #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " "this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +"error message if there is no analytic account ; if you select 'Posted " +"moves', the accountant will get an error message if no analytic account is " +"defined when the move is posted ; if you select 'Never', the accountant will" +" get an error message if an analytic account is present." msgstr "" -"Postavite pravila za analitička konta: ako odaberete 'Opcionalno', " -"knjigovođa može slobodno birati hoće li postaviti analitički konto na stavke" -" temeljnice ovog tipa konta, ako odaberete 'Uvijek', knjigovođa će dobiti " -"upozorenje o grešci ako ga nema, i ako odaberete 'Nikad' knjigovođa će " -"dobiti upozorenje o greški ako postoji analitički konto." diff --git a/account_analytic_required/i18n/nl.po b/account_analytic_required/i18n/nl.po index fec3e3ffdf..ff2a81e309 100644 --- a/account_analytic_required/i18n/nl.po +++ b/account_analytic_required/i18n/nl.po @@ -3,14 +3,14 @@ # * account_analytic_required # # Translators: -# OCA Transbot , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-05-24 09:51+0000\n" -"PO-Revision-Date: 2017-05-24 09:51+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-02-01 03:39+0000\n" +"PO-Revision-Date: 2018-02-01 03:39+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,6 +18,11 @@ msgstr "" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -34,7 +39,7 @@ msgid "Analytic Policy" msgstr "" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:47 +#: code:addons/account_analytic_required/models/account.py:59 #, python-format msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " @@ -44,13 +49,21 @@ msgstr "" "'%s', maar deze ontbreekt in de boekingsregel met de omschrijving '%s'." #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:55 +#: code:addons/account_analytic_required/models/account.py:67 #, python-format msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " "line with label '%s' has an analytic account '%s'." msgstr "" +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account %s '%s' but the " +"analytic account is missing in the account move line with label '%s'." +msgstr "" + #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" @@ -76,17 +89,19 @@ msgstr "" msgid "Policy for analytic account" msgstr "Kostenplaatsenbeleid" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "" + #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " "this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +"error message if there is no analytic account ; if you select 'Posted " +"moves', the accountant will get an error message if no analytic account is " +"defined when the move is posted ; if you select 'Never', the accountant will" +" get an error message if an analytic account is present." msgstr "" -"Stel het beleid in voor kostenplaatsen: bij 'Altijd' is het opgeven van een " -"kostenplaats verplicht bij rekeningen van dit type. 'Nooit': er treedt een " -"foutmelding op als er bij een boeking een kostenplaats wordt opgegeven. " -"'Optioneel': het staat de medewerker vrij om al dan niet een kostenplaats op" -" te geven." diff --git a/account_analytic_required/i18n/pt_BR.po b/account_analytic_required/i18n/pt_BR.po index 285b0d5aee..27149191e7 100644 --- a/account_analytic_required/i18n/pt_BR.po +++ b/account_analytic_required/i18n/pt_BR.po @@ -3,14 +3,14 @@ # * account_analytic_required # # Translators: -# Rodrigo de Almeida Sottomaior Macedo , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-13 09:51+0000\n" -"PO-Revision-Date: 2017-06-13 09:51+0000\n" -"Last-Translator: Rodrigo de Almeida Sottomaior Macedo , 2017\n" +"POT-Creation-Date: 2018-02-01 03:39+0000\n" +"PO-Revision-Date: 2018-02-01 03:39+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,6 +18,11 @@ msgstr "" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -34,7 +39,7 @@ msgid "Analytic Policy" msgstr "Política Analítica" #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:47 +#: code:addons/account_analytic_required/models/account.py:59 #, python-format msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " @@ -44,7 +49,7 @@ msgstr "" " analítica está faltando na linha de mudança de conta com o rótulo '%s'." #. module: account_analytic_required -#: code:addons/account_analytic_required/models/account.py:55 +#: code:addons/account_analytic_required/models/account.py:67 #, python-format msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " @@ -53,6 +58,14 @@ msgstr "" "A política analítica é definida como \"Nunca\" com conta%s '%s' mas a linha " "de movimento da conta com o rótulo '%s' tem uma conta analítica '%s'." +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account %s '%s' but the " +"analytic account is missing in the account move line with label '%s'." +msgstr "" + #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" @@ -78,18 +91,19 @@ msgstr "Opcional" msgid "Policy for analytic account" msgstr "Política para conta analítica" +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "" + #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " "this type of account ; if you select 'Always', the accountant will get an " -"error message if there is no analytic account ; if you select 'Never', the " -"accountant will get an error message if an analytic account is present." +"error message if there is no analytic account ; if you select 'Posted " +"moves', the accountant will get an error message if no analytic account is " +"defined when the move is posted ; if you select 'Never', the accountant will" +" get an error message if an analytic account is present." msgstr "" -"Defina a política para contas analíticas: se você selecionar \"Opcional\", o" -" contador é livre para colocar uma conta analítica em uma linha de mudança " -"de conta com esse tipo de conta; Se você selecionar 'Sempre', o contador " -"receberá uma mensagem de erro se não houver uma conta analítica; Se você " -"selecionar 'Nunca', o contador receberá uma mensagem de erro se uma conta " -"analítica estiver presente." From c13f04f1feebd58b1a3786d035fb811b656e789f Mon Sep 17 00:00:00 2001 From: oca-travis Date: Sat, 23 Jun 2018 10:15:31 +0000 Subject: [PATCH 48/89] [UPD] Update account_analytic_required.pot --- .../i18n/account_analytic_required.pot | 88 +++++++++++++++++++ account_analytic_required/i18n/ar.po | 11 +-- account_analytic_required/i18n/ca.po | 8 +- account_analytic_required/i18n/de.po | 26 ++++-- account_analytic_required/i18n/es.po | 8 +- account_analytic_required/i18n/es_CO.po | 14 +-- account_analytic_required/i18n/fr.po | 8 +- account_analytic_required/i18n/hr_HR.po | 18 ++-- account_analytic_required/i18n/nl.po | 8 +- account_analytic_required/i18n/pt_BR.po | 15 ++-- 10 files changed, 153 insertions(+), 51 deletions(-) create mode 100644 account_analytic_required/i18n/account_analytic_required.pot diff --git a/account_analytic_required/i18n/account_analytic_required.pot b/account_analytic_required/i18n/account_analytic_required.pot new file mode 100644 index 0000000000..40ded4f54e --- /dev/null +++ b/account_analytic_required/i18n/account_analytic_required.pot @@ -0,0 +1,88 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Account Entry" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account_type +msgid "Account Type" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Always" +msgstr "" + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Analytic Policy" +msgstr "" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:59 +#, python-format +msgid "Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." +msgstr "" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:67 +#, python-format +msgid "Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account '%s'." +msgstr "" + +#. module: account_analytic_required +#: code:addons/account_analytic_required/models/account.py:77 +#, python-format +msgid "Analytic policy is set to 'Posted moves' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." +msgstr "" + +#. module: account_analytic_required +#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +msgid "Group By" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Never" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Optional" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +msgid "Policy for analytic account" +msgstr "" + +#. module: account_analytic_required +#: selection:account.account.type,analytic_policy:0 +msgid "Posted moves" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +msgid "Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Posted moves', the accountant will get an error message if no analytic account is defined when the move is posted ; if you select 'Never', the accountant will get an error message if an analytic account is present." +msgstr "" + diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po index eba8068eae..79215b3069 100644 --- a/account_analytic_required/i18n/ar.po +++ b/account_analytic_required/i18n/ar.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * account_analytic_required -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2018-02-01 03:39+0000\n" "Last-Translator: OCA Transbot , 2018\n" "Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" +"Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: ar\n" -"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move @@ -100,6 +101,6 @@ msgid "" "this type of account ; if you select 'Always', the accountant will get an " "error message if there is no analytic account ; if you select 'Posted " "moves', the accountant will get an error message if no analytic account is " -"defined when the move is posted ; if you select 'Never', the accountant will" -" get an error message if an analytic account is present." +"defined when the move is posted ; if you select 'Never', the accountant will " +"get an error message if an analytic account is present." msgstr "" diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po index 7463f5dc0a..a53150890a 100644 --- a/account_analytic_required/i18n/ca.po +++ b/account_analytic_required/i18n/ca.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * account_analytic_required -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2018-02-01 03:39+0000\n" "Last-Translator: OCA Transbot , 2018\n" "Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: ca\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_analytic_required @@ -100,6 +100,6 @@ msgid "" "this type of account ; if you select 'Always', the accountant will get an " "error message if there is no analytic account ; if you select 'Posted " "moves', the accountant will get an error message if no analytic account is " -"defined when the move is posted ; if you select 'Never', the accountant will" -" get an error message if an analytic account is present." +"defined when the move is posted ; if you select 'Never', the accountant will " +"get an error message if an analytic account is present." msgstr "" diff --git a/account_analytic_required/i18n/de.po b/account_analytic_required/i18n/de.po index dd78e8bf37..b59b31b766 100644 --- a/account_analytic_required/i18n/de.po +++ b/account_analytic_required/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * account_analytic_required -# +# # Translators: # Ricardo Gross , 2018 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2018-03-16 23:08+0000\n" "Last-Translator: Ricardo Gross , 2018\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_analytic_required @@ -56,8 +56,8 @@ msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " "line with label '%s' has an analytic account '%s'." msgstr "" -"Die Analytic-Richtlinie ist auf \"Nie\" eingestellt mit Konto %s ' %s' aber" -" die Buchungslinie mit Marke ' %s ' hat ein anlaytisches Konto ' %s '. " +"Die Analytic-Richtlinie ist auf \"Nie\" eingestellt mit Konto %s ' %s' aber " +"die Buchungslinie mit Marke ' %s ' hat ein anlaytisches Konto ' %s '. " #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:77 @@ -66,8 +66,10 @@ msgid "" "Analytic policy is set to 'Posted moves' with account %s '%s' but the " "analytic account is missing in the account move line with label '%s'." msgstr "" -"Die Analytic-Richtlinie ist auf \"Posted moves\" eingestellt mit dem Konto \n" -"%s ' %s ' aber das analytische Konto fehlt in der Buchungslinie mit dem Label ' %s'." +"Die Analytic-Richtlinie ist auf \"Posted moves\" eingestellt mit dem " +"Konto \n" +"%s ' %s ' aber das analytische Konto fehlt in der Buchungslinie mit dem " +"Label ' %s'." #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search @@ -107,8 +109,14 @@ msgid "" "this type of account ; if you select 'Always', the accountant will get an " "error message if there is no analytic account ; if you select 'Posted " "moves', the accountant will get an error message if no analytic account is " -"defined when the move is posted ; if you select 'Never', the accountant will" -" get an error message if an analytic account is present." +"defined when the move is posted ; if you select 'Never', the accountant will " +"get an error message if an analytic account is present." msgstr "" "Legen Sie die Richtlinie für analytische Konten fest: \n" -"Wenn Sie \"Optional\" auswählen, kann der Buchhalter ein analytisches Konto in einer Kontobewegungslinie mit diesem Kontotyp anlegen. Wenn Sie \"Immer\" auswählen, erhält der Buchhalter eine Fehlermeldung, wenn kein analytisches Konto vorhanden ist. Wenn Sie \"Posted moves\" auswählen, erhält der Buchhalter eine Fehlermeldung, wenn bei der Buchung kein analytisches Konto definiert wurde. Wenn Sie \"Nie\" auswählen, erhält der Buchhalter eine Fehlermeldung, wenn ein analytisches Konto vorhanden ist." +"Wenn Sie \"Optional\" auswählen, kann der Buchhalter ein analytisches Konto " +"in einer Kontobewegungslinie mit diesem Kontotyp anlegen. Wenn Sie \"Immer\" " +"auswählen, erhält der Buchhalter eine Fehlermeldung, wenn kein analytisches " +"Konto vorhanden ist. Wenn Sie \"Posted moves\" auswählen, erhält der " +"Buchhalter eine Fehlermeldung, wenn bei der Buchung kein analytisches Konto " +"definiert wurde. Wenn Sie \"Nie\" auswählen, erhält der Buchhalter eine " +"Fehlermeldung, wenn ein analytisches Konto vorhanden ist." diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po index a1847cef8c..917631f820 100644 --- a/account_analytic_required/i18n/es.po +++ b/account_analytic_required/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * account_analytic_required -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2018-02-01 03:39+0000\n" "Last-Translator: OCA Transbot , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_analytic_required @@ -100,6 +100,6 @@ msgid "" "this type of account ; if you select 'Always', the accountant will get an " "error message if there is no analytic account ; if you select 'Posted " "moves', the accountant will get an error message if no analytic account is " -"defined when the move is posted ; if you select 'Never', the accountant will" -" get an error message if an analytic account is present." +"defined when the move is posted ; if you select 'Never', the accountant will " +"get an error message if an analytic account is present." msgstr "" diff --git a/account_analytic_required/i18n/es_CO.po b/account_analytic_required/i18n/es_CO.po index ffde03b5bf..59edc61335 100644 --- a/account_analytic_required/i18n/es_CO.po +++ b/account_analytic_required/i18n/es_CO.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * account_analytic_required -# +# # Translators: # JOSE ALEJANDRO ECHEVERRI VALENCIA , 2018 msgid "" @@ -10,12 +10,14 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-02-01 03:39+0000\n" "PO-Revision-Date: 2018-02-01 03:39+0000\n" -"Last-Translator: JOSE ALEJANDRO ECHEVERRI VALENCIA , 2018\n" -"Language-Team: Spanish (Colombia) (https://www.transifex.com/oca/teams/23907/es_CO/)\n" +"Last-Translator: JOSE ALEJANDRO ECHEVERRI VALENCIA , 2018\n" +"Language-Team: Spanish (Colombia) (https://www.transifex.com/oca/teams/23907/" +"es_CO/)\n" +"Language: es_CO\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es_CO\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_analytic_required @@ -100,6 +102,6 @@ msgid "" "this type of account ; if you select 'Always', the accountant will get an " "error message if there is no analytic account ; if you select 'Posted " "moves', the accountant will get an error message if no analytic account is " -"defined when the move is posted ; if you select 'Never', the accountant will" -" get an error message if an analytic account is present." +"defined when the move is posted ; if you select 'Never', the accountant will " +"get an error message if an analytic account is present." msgstr "" diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po index c406160c93..b1e7bb226e 100644 --- a/account_analytic_required/i18n/fr.po +++ b/account_analytic_required/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * account_analytic_required -# +# # Translators: # OCA Transbot , 2018 # Quentin THEURET , 2018 @@ -14,10 +14,10 @@ msgstr "" "PO-Revision-Date: 2018-02-02 23:18+0000\n" "Last-Translator: Nicolas JEUDY , 2018\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: account_analytic_required @@ -109,8 +109,8 @@ msgid "" "this type of account ; if you select 'Always', the accountant will get an " "error message if there is no analytic account ; if you select 'Posted " "moves', the accountant will get an error message if no analytic account is " -"defined when the move is posted ; if you select 'Never', the accountant will" -" get an error message if an analytic account is present." +"defined when the move is posted ; if you select 'Never', the accountant will " +"get an error message if an analytic account is present." msgstr "" "Définissez la règle pour les comptes analytiques: si vous sélectionnez " "'Facultatif', le comptable est libre de mettre un compte analytique sur une " diff --git a/account_analytic_required/i18n/hr_HR.po b/account_analytic_required/i18n/hr_HR.po index 8ed78fa897..2f07673c69 100644 --- a/account_analytic_required/i18n/hr_HR.po +++ b/account_analytic_required/i18n/hr_HR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * account_analytic_required -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -11,12 +11,14 @@ msgstr "" "POT-Creation-Date: 2018-02-01 03:39+0000\n" "PO-Revision-Date: 2018-02-01 03:39+0000\n" "Last-Translator: OCA Transbot , 2018\n" -"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_HR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr_HR\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move @@ -55,8 +57,8 @@ msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " "line with label '%s' has an analytic account '%s'." msgstr "" -"Analitičko pravilo je postavljeno na 'Nikada' za konto %s '%s' ali na stavci" -" temeljnice sa oznakom '%s' postoji analitički konto '%s'." +"Analitičko pravilo je postavljeno na 'Nikada' za konto %s '%s' ali na stavci " +"temeljnice sa oznakom '%s' postoji analitički konto '%s'." #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:77 @@ -104,6 +106,6 @@ msgid "" "this type of account ; if you select 'Always', the accountant will get an " "error message if there is no analytic account ; if you select 'Posted " "moves', the accountant will get an error message if no analytic account is " -"defined when the move is posted ; if you select 'Never', the accountant will" -" get an error message if an analytic account is present." +"defined when the move is posted ; if you select 'Never', the accountant will " +"get an error message if an analytic account is present." msgstr "" diff --git a/account_analytic_required/i18n/nl.po b/account_analytic_required/i18n/nl.po index ff2a81e309..0654705b4c 100644 --- a/account_analytic_required/i18n/nl.po +++ b/account_analytic_required/i18n/nl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * account_analytic_required -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2018-02-01 03:39+0000\n" "Last-Translator: OCA Transbot , 2018\n" "Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_analytic_required @@ -102,6 +102,6 @@ msgid "" "this type of account ; if you select 'Always', the accountant will get an " "error message if there is no analytic account ; if you select 'Posted " "moves', the accountant will get an error message if no analytic account is " -"defined when the move is posted ; if you select 'Never', the accountant will" -" get an error message if an analytic account is present." +"defined when the move is posted ; if you select 'Never', the accountant will " +"get an error message if an analytic account is present." msgstr "" diff --git a/account_analytic_required/i18n/pt_BR.po b/account_analytic_required/i18n/pt_BR.po index 27149191e7..03ca2b9403 100644 --- a/account_analytic_required/i18n/pt_BR.po +++ b/account_analytic_required/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * account_analytic_required -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2018-02-01 03:39+0000\n" "PO-Revision-Date: 2018-02-01 03:39+0000\n" "Last-Translator: OCA Transbot , 2018\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: account_analytic_required @@ -45,8 +46,8 @@ msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " "account is missing in the account move line with label '%s'." msgstr "" -"A política analítica é definida como \"Sempre\" com conta%s '%s' Mas a conta" -" analítica está faltando na linha de mudança de conta com o rótulo '%s'." +"A política analítica é definida como \"Sempre\" com conta%s '%s' Mas a conta " +"analítica está faltando na linha de mudança de conta com o rótulo '%s'." #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:67 @@ -104,6 +105,6 @@ msgid "" "this type of account ; if you select 'Always', the accountant will get an " "error message if there is no analytic account ; if you select 'Posted " "moves', the accountant will get an error message if no analytic account is " -"defined when the move is posted ; if you select 'Never', the accountant will" -" get an error message if an analytic account is present." +"defined when the move is posted ; if you select 'Never', the accountant will " +"get an error message if an analytic account is present." msgstr "" From dac4073f6f0cf33a26333ac053996d49e37d6719 Mon Sep 17 00:00:00 2001 From: Rodrigo Macedo Date: Thu, 28 Jun 2018 13:59:25 +0000 Subject: [PATCH 49/89] =?UTF-8?q?Translated=20using=20Weblate=20(Portugu?= =?UTF-8?q?=C3=AAs=20(Brasil))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 100,0% (14 of 14 strings) Translation: account-analytic-11.0/account-analytic-11.0-account_analytic_required Translate-URL: https://translation.odoo-community.org/projects/account-analytic-11-0/account-analytic-11-0-account_analytic_required/pt_BR/ --- account_analytic_required/i18n/pt_BR.po | 26 ++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/account_analytic_required/i18n/pt_BR.po b/account_analytic_required/i18n/pt_BR.po index 03ca2b9403..5666d4abf2 100644 --- a/account_analytic_required/i18n/pt_BR.po +++ b/account_analytic_required/i18n/pt_BR.po @@ -9,20 +9,21 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-02-01 03:39+0000\n" -"PO-Revision-Date: 2018-02-01 03:39+0000\n" -"Last-Translator: OCA Transbot , 2018\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" -"teams/23907/pt_BR/)\n" +"PO-Revision-Date: 2018-06-28 14:00+0000\n" +"Last-Translator: Rodrigo Macedo \n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" +"23907/pt_BR/)\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.0.1\n" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move msgid "Account Entry" -msgstr "" +msgstr "Entrada de conta" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type @@ -66,6 +67,9 @@ msgid "" "Analytic policy is set to 'Posted moves' with account %s '%s' but the " "analytic account is missing in the account move line with label '%s'." msgstr "" +"A política analítica está definida como 'Movimentos Publicados' com a conta %" +"s '%s', mas a conta analítica está ausente na linha de movimentação da conta " +"com o rótulo '%s'." #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search @@ -95,7 +99,7 @@ msgstr "Política para conta analítica" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 msgid "Posted moves" -msgstr "" +msgstr "Movimentos publicados" #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy @@ -108,3 +112,11 @@ msgid "" "defined when the move is posted ; if you select 'Never', the accountant will " "get an error message if an analytic account is present." msgstr "" +"Defina a política para contas analíticas: se você selecionar \"Opcional\", o " +"contador terá a liberdade de colocar uma conta analítica em uma linha de " +"movimentação de conta com esse tipo de conta; se você selecionar 'Sempre', o " +"contador receberá uma mensagem de erro se não houver uma conta analítica; se " +"você selecionar 'Movimentos Publicados', o contador receberá uma mensagem de " +"erro se nenhuma conta analítica for definida quando a movimentação for " +"lançada; se você selecionar \"Nunca\", o contador receberá uma mensagem de " +"erro se uma conta analítica estiver presente." From a8c02b2ef8f0a7ae8a4473e062bf8cfa47969a89 Mon Sep 17 00:00:00 2001 From: Osoul Date: Thu, 28 Jun 2018 04:41:40 +0000 Subject: [PATCH 50/89] Translated using Weblate (Arabic) Currently translated at 85.7% (12 of 14 strings) Translation: account-analytic-11.0/account-analytic-11.0-account_analytic_required Translate-URL: https://translation.odoo-community.org/projects/account-analytic-11-0/account-analytic-11-0-account_analytic_required/ar/ --- account_analytic_required/i18n/ar.po | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po index 79215b3069..403e92481b 100644 --- a/account_analytic_required/i18n/ar.po +++ b/account_analytic_required/i18n/ar.po @@ -9,15 +9,16 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-02-01 03:39+0000\n" -"PO-Revision-Date: 2018-02-01 03:39+0000\n" -"Last-Translator: OCA Transbot , 2018\n" +"PO-Revision-Date: 2018-06-29 05:00+0000\n" +"Last-Translator: Osoul \n" "Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" "Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " -"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" +"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" +"X-Generator: Weblate 3.0.1\n" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move @@ -32,12 +33,12 @@ msgstr "نوع الحساب" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 msgid "Always" -msgstr "" +msgstr "دائماً" #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" -msgstr "" +msgstr "سياسة الحسابات التحليلية" #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:59 @@ -46,6 +47,8 @@ msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " "account is missing in the account move line with label '%s'." msgstr "" +"سياسة الحسابات التحليلية هي ’دائماً‘ للحساب %s ’%s‘ ولكن الحساب التحليلي " +"فارغ في عنصر اليومية باسم ’%s‘." #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:67 @@ -54,6 +57,8 @@ msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " "line with label '%s' has an analytic account '%s'." msgstr "" +"سياسة الحسابات التحليلية هي ’ممنوع‘ للحساب %s ’%s‘ ولكن في عنصر اليومية باسم " +"’%s‘ تم تحديد حساب التحليلي ’%s‘ ." #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:77 @@ -62,26 +67,28 @@ msgid "" "Analytic policy is set to 'Posted moves' with account %s '%s' but the " "analytic account is missing in the account move line with label '%s'." msgstr "" +"سياسة الحسابات التحليلية هي ’القيود المرحّلة‘ للحساب %s ’%s‘ ولكن الحساب " +"التحليلي فارغ في عنصر اليومية باسم ’%s‘." #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" -msgstr "" +msgstr "تجميع حسب" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" -msgstr "" +msgstr "عنصر اليومية" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 msgid "Never" -msgstr "" +msgstr "ممنوع" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 msgid "Optional" -msgstr "" +msgstr "إختياري" #. module: account_analytic_required #: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy @@ -91,7 +98,7 @@ msgstr "سياسة للحسابات التحليلية" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 msgid "Posted moves" -msgstr "" +msgstr "القيود المرحّلة" #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy From e1d2f3fc527a314a1ae9efbbc431963ee959b5d8 Mon Sep 17 00:00:00 2001 From: yaseentai Date: Wed, 19 Sep 2018 16:23:05 +0000 Subject: [PATCH 51/89] Translated using Weblate (Arabic) Currently translated at 100.0% (14 of 14 strings) Translation: account-analytic-11.0/account-analytic-11.0-account_analytic_required Translate-URL: https://translation.odoo-community.org/projects/account-analytic-11-0/account-analytic-11-0-account_analytic_required/ar/ --- account_analytic_required/i18n/ar.po | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po index 403e92481b..9768794a0f 100644 --- a/account_analytic_required/i18n/ar.po +++ b/account_analytic_required/i18n/ar.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-02-01 03:39+0000\n" -"PO-Revision-Date: 2018-06-29 05:00+0000\n" -"Last-Translator: Osoul \n" +"PO-Revision-Date: 2018-09-20 17:01+0000\n" +"Last-Translator: yaseentai \n" "Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" "Language: ar\n" "MIME-Version: 1.0\n" @@ -18,12 +18,12 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" -"X-Generator: Weblate 3.0.1\n" +"X-Generator: Weblate 3.1.1\n" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move msgid "Account Entry" -msgstr "" +msgstr "قيد الحساب" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type @@ -111,3 +111,9 @@ msgid "" "defined when the move is posted ; if you select 'Never', the accountant will " "get an error message if an analytic account is present." msgstr "" +"قم بإختيار السياسات للحسابات التحليلية: اذا قم بإختيار \"إختياري\"، للمحاسب " +"الحرية في اختيار حساب التحليلي ام لا في حركة القيد المحسابي مع هذا النوع من " +"الحساب; و إن قمت بإختيار \"دائما\"، ستظهر للمحاسب رسالة خطأ ان كان لا يوجد " +"حساب تحليلي; و ان قمت بإختيار \"قيويد مرحلة\" ستظهر للمحاسب رسالة خطأ اذا لم " +"يحدد حساب تحليلي في ترحيل القيود; و إن اخترت \"ابداً\\نهائي\"، ستظهر للمحاسب " +"رسالة خطأ اذا تم تحديد حساب تحليلي." From c637d2ac8a8a68515e449e6905257fa781ac0fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Sat, 22 Sep 2018 12:24:09 +0000 Subject: [PATCH 52/89] Translated using Weblate (Spanish) Currently translated at 28.6% (4 of 14 strings) Translation: account-analytic-11.0/account-analytic-11.0-account_analytic_required Translate-URL: https://translation.odoo-community.org/projects/account-analytic-11-0/account-analytic-11-0-account_analytic_required/es/ --- account_analytic_required/i18n/es.po | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po index 917631f820..9163874733 100644 --- a/account_analytic_required/i18n/es.po +++ b/account_analytic_required/i18n/es.po @@ -9,14 +9,15 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-02-01 03:39+0000\n" -"PO-Revision-Date: 2018-02-01 03:39+0000\n" -"Last-Translator: OCA Transbot , 2018\n" +"PO-Revision-Date: 2018-09-23 13:08+0000\n" +"Last-Translator: Darío Lodeiros \n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.1.1\n" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move @@ -31,7 +32,7 @@ msgstr "Tipo de cuenta" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 msgid "Always" -msgstr "" +msgstr "Siempre" #. module: account_analytic_required #: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search From c65e2b6bcc56a4147a12cc84fe55a1189d8df005 Mon Sep 17 00:00:00 2001 From: Raf Ven Date: Tue, 2 Oct 2018 10:21:49 +0200 Subject: [PATCH 53/89] [MIG] account_analytic_required: Migration to 12.0 --- account_analytic_required/README.rst | 82 ++-- account_analytic_required/__manifest__.py | 2 +- .../readme/CONFIGURE.rst | 6 + .../readme/CONTRIBUTORS.rst | 8 + .../readme/DESCRIPTION.rst | 2 + account_analytic_required/readme/USAGE.rst | 0 .../static/description/icon.png | Bin 0 -> 9455 bytes .../static/description/index.html | 436 ++++++++++++++++++ .../tests/test_account_analytic_required.py | 7 +- 9 files changed, 512 insertions(+), 31 deletions(-) create mode 100644 account_analytic_required/readme/CONFIGURE.rst create mode 100644 account_analytic_required/readme/CONTRIBUTORS.rst create mode 100644 account_analytic_required/readme/DESCRIPTION.rst create mode 100644 account_analytic_required/readme/USAGE.rst create mode 100644 account_analytic_required/static/description/icon.png create mode 100644 account_analytic_required/static/description/index.html diff --git a/account_analytic_required/README.rst b/account_analytic_required/README.rst index 25b5de7183..bd6b31c132 100644 --- a/account_analytic_required/README.rst +++ b/account_analytic_required/README.rst @@ -1,43 +1,69 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License - ========================= Account Analytic Required ========================= +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--analytic-lightgray.png?logo=github + :target: https://github.com/OCA/account-analytic/tree/12.0/account_analytic_required + :alt: OCA/account-analytic +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-account_analytic_required + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/87/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module adds an option *analytic policy* on account types. -You have the choice between 4 policies : *always*, *never*, *posted moves* and -*optional*. +You have the choice between 4 policies : *always*, *never*, *posted moves* and *optional*. + +**Table of contents** + +.. contents:: + :local: Configuration ============= -For example, if you want to have an analytic account on all your expenses, -set the policy to *always* for the account type *expense* ; then, if you -try to save an account move line with an account of type *expense* -without analytic account, you will get an error message. - -Usage -===== +Example: -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/87/11.0 +If you want to have an analytic account on all your *expenses*, +set the policy to *always* for the account type *expense* +If you try to save an account move line with an account of type *expense* +without analytic account, you will get an error message. Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Akretion + Contributors ------------- +~~~~~~~~~~~~ + * Alexis de Lattre * Stéphane Bidoul * Stefan Rijnhart @@ -45,17 +71,21 @@ Contributors * Luc De Meyer, Noviat * Yannick Vaucher * Akim Juillerat +* Raf Ven + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. -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. +This module is part of the `OCA/account-analytic `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_analytic_required/__manifest__.py b/account_analytic_required/__manifest__.py index acd5f3ed09..4a4c906690 100644 --- a/account_analytic_required/__manifest__.py +++ b/account_analytic_required/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { 'name': 'Account Analytic Required', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'category': 'Analytic Accounting', 'license': 'AGPL-3', 'author': "Akretion, Odoo Community Association (OCA)", diff --git a/account_analytic_required/readme/CONFIGURE.rst b/account_analytic_required/readme/CONFIGURE.rst new file mode 100644 index 0000000000..3937a62f13 --- /dev/null +++ b/account_analytic_required/readme/CONFIGURE.rst @@ -0,0 +1,6 @@ +Example: + +If you want to have an analytic account on all your *expenses*, +set the policy to *always* for the account type *expense* +If you try to save an account move line with an account of type *expense* +without analytic account, you will get an error message. diff --git a/account_analytic_required/readme/CONTRIBUTORS.rst b/account_analytic_required/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..909a48ba8f --- /dev/null +++ b/account_analytic_required/readme/CONTRIBUTORS.rst @@ -0,0 +1,8 @@ +* Alexis de Lattre +* Stéphane Bidoul +* Stefan Rijnhart +* Laetitia Gangloff +* Luc De Meyer, Noviat +* Yannick Vaucher +* Akim Juillerat +* Raf Ven diff --git a/account_analytic_required/readme/DESCRIPTION.rst b/account_analytic_required/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..0f312f48fc --- /dev/null +++ b/account_analytic_required/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module adds an option *analytic policy* on account types. +You have the choice between 4 policies : *always*, *never*, *posted moves* and *optional*. diff --git a/account_analytic_required/readme/USAGE.rst b/account_analytic_required/readme/USAGE.rst new file mode 100644 index 0000000000..e69de29bb2 diff --git a/account_analytic_required/static/description/icon.png b/account_analytic_required/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h zFfekr30S!-LHmV_Su-W+rEwYXJ^;6&3|L$mMC8*bQptyOo9;>Qb9Q9`ySe3%V$A*9 zeKEe+b0{#KWGp$F+tga)0RtI)nhMa-K@JS}2krK~n8vJ=Ngm?R!9G<~RyuU0d?nz# z-5EK$o(!F?hmX*2Yt6+coY`6jGbb7tF#6nHA zuKk=GGJ;ZwON1iAfG$E#Y7MnZVmrY|j0eVI(DN_MNFJmyZ|;w4tf@=CCDZ#5N_0K= z$;R~bbk?}TpfDjfB&aiQ$VA}s?P}xPERJG{kxk5~R`iRS(SK5d+Xs9swCozZISbnS zk!)I0>t=A<-^z(cmSFz3=jZ23u13X><0b)P)^1T_))Kr`e!-pb#q&J*Q`p+B6la%C zuVl&0duN<;uOsB3%T9Fp8t{ED108<+W(nOZd?gDnfNBC3>M8WE61$So|P zVvqH0SNtDTcsUdzaMDpT=Ty0pDHHNL@Z0w$Y`XO z2M-_r1S+GaH%pz#Uy0*w$Vdl=X=rQXEzO}d6J^R6zjM1u&c9vYLvLp?W7w(?np9x1 zE_0JSAJCPB%i7p*Wvg)pn5T`8k3-uR?*NT|J`eS#_#54p>!p(mLDvmc-3o0mX*mp_ zN*AeS<>#^-{S%W<*mz^!X$w_2dHWpcJ6^j64qFBft-o}o_Vx80o0>}Du;>kLts;$8 zC`7q$QI(dKYG`Wa8#wl@V4jVWBRGQ@1dr-hstpQL)Tl+aqVpGpbSfN>5i&QMXfiZ> zaA?T1VGe?rpQ@;+pkrVdd{klI&jVS@I5_iz!=UMpTsa~mBga?1r}aRBm1WS;TT*s0f0lY=JBl66Upy)-k4J}lh=P^8(SXk~0xW=T9v*B|gzIhN z>qsO7dFd~mgxAy4V?&)=5ieYq?zi?ZEoj)&2o)RLy=@hbCRcfT5jigwtQGE{L*8<@Yd{zg;CsL5mvzfDY}P-wos_6PfprFVaeqNE%h zKZhLtcQld;ZD+>=nqN~>GvROfueSzJD&BE*}XfU|H&(FssBqY=hPCt`d zH?@s2>I(|;fcW&YM6#V#!kUIP8$Nkdh0A(bEVj``-AAyYgwY~jB zT|I7Bf@%;7aL7Wf4dZ%VqF$eiaC38OV6oy3Z#TER2G+fOCd9Iaoy6aLYbPTN{XRPz z;U!V|vBf%H!}52L2gH_+j;`bTcQRXB+y9onc^wLm5wi3-Be}U>k_u>2Eg$=k!(l@I zcCg+flakT2Nej3i0yn+g+}%NYb?ta;R?(g5SnwsQ49U8Wng8d|{B+lyRcEDvR3+`O{zfmrmvFrL6acVP%yG98X zo&+VBg@px@i)%o?dG(`T;n*$S5*rnyiR#=wW}}GsAcfyQpE|>a{=$Hjg=-*_K;UtD z#z-)AXwSRY?OPefw^iI+ z)AXz#PfEjlwTes|_{sB?4(O@fg0AJ^g8gP}ex9Ucf*@_^J(s_5jJV}c)s$`Myn|Kd z$6>}#q^n{4vN@+Os$m7KV+`}c%4)4pv@06af4-x5#wj!KKb%caK{A&Y#Rfs z-po?Dcb1({W=6FKIUirH&(yg=*6aLCekcKwyfK^JN5{wcA3nhO(o}SK#!CINhI`-I z1)6&n7O&ZmyFMuNwvEic#IiOAwNkR=u5it{B9n2sAJV5pNhar=j5`*N!Na;c7g!l$ z3aYBqUkqqTJ=Re-;)s!EOeij=7SQZ3Hq}ZRds%IM*PtM$wV z@;rlc*NRK7i3y5BETSKuumEN`Xu_8GP1Ri=OKQ$@I^ko8>H6)4rjiG5{VBM>B|%`&&s^)jS|-_95&yc=GqjNo{zFkw%%HHhS~e=s zD#sfS+-?*t|J!+ozP6KvtOl!R)@@-z24}`9{QaVLD^9VCSR2b`b!KC#o;Ki<+wXB6 zx3&O0LOWcg4&rv4QG0)4yb}7BFSEg~=IR5#ZRj8kg}dS7_V&^%#Do==#`u zpy6{ox?jWuR(;pg+f@mT>#HGWHAJRRDDDv~@(IDw&R>9643kK#HN`!1vBJHnC+RM&yIh8{gG2q zA%e*U3|N0XSRa~oX-3EAneep)@{h2vvd3Xvy$7og(sayr@95+e6~Xvi1tUqnIxoIH zVWo*OwYElb#uyW{Imam6f2rGbjR!Y3`#gPqkv57dB6K^wRGxc9B(t|aYDGS=m$&S!NmCtrMMaUg(c zc2qC=2Z`EEFMW-me5B)24AqF*bV5Dr-M5ig(l-WPS%CgaPzs6p_gnCIvTJ=Y<6!gT zVt@AfYCzjjsMEGi=rDQHo0yc;HqoRNnNFeWZgcm?f;cp(6CNylj36DoL(?TS7eU#+ z7&mfr#y))+CJOXQKUMZ7QIdS9@#-}7y2K1{8)cCt0~-X0O!O?Qx#E4Og+;A2SjalQ zs7r?qn0H044=sDN$SRG$arw~n=+T_DNdSrarmu)V6@|?1-ZB#hRn`uilTGPJ@fqEy zGt(f0B+^JDP&f=r{#Y_wi#AVDf-y!RIXU^0jXsFpf>=Ji*TeqSY!H~AMbJdCGLhC) zn7Rx+sXw6uYj;WRYrLd^5IZq@6JI1C^YkgnedZEYy<&4(z%Q$5yv#Boo{AH8n$a zhb4Y3PWdr269&?V%uI$xMcUrMzl=;w<_nm*qr=c3Rl@i5wWB;e-`t7D&c-mcQl7x! zZWB`UGcw=Y2=}~wzrfLx=uet<;m3~=8I~ZRuzvMQUQdr+yTV|ATf1Uuomr__nDf=X zZ3WYJtHp_ri(}SQAPjv+Y+0=fH4krOP@S&=zZ-t1jW1o@}z;xk8 z(Nz1co&El^HK^NrhVHa-_;&88vTU>_J33=%{if;BEY*J#1n59=07jrGQ#IP>@u#3A z;!q+E1Rj3ZJ+!4bq9F8PXJ@yMgZL;>&gYA0%_Kbi8?S=XGM~dnQZQ!yBSgcZhY96H zrWnU;k)qy`rX&&xlDyA%(a1Hhi5CWkmg(`Gb%m(HKi-7Z!LKGRP_B8@`7&hdDy5n= z`OIxqxiVfX@OX1p(mQu>0Ai*v_cTMiw4qRt3~NBvr9oBy0)r>w3p~V0SCm=An6@3n)>@z!|o-$HvDK z|3D2ZMJkLE5loMKl6R^ez@Zz%S$&mbeoqH5`Bb){Ei21q&VP)hWS2tjShfFtGE+$z zzCR$P#uktu+#!w)cX!lWN1XU%K-r=s{|j?)Akf@q#3b#{6cZCuJ~gCxuMXRmI$nGtnH+-h z+GEi!*X=AP<|fG`1>MBdTb?28JYc=fGvAi2I<$B(rs$;eoJCyR6_bc~p!XR@O-+sD z=eH`-ye})I5ic1eL~TDmtfJ|8`0VJ*Yr=hNCd)G1p2MMz4C3^Mj?7;!w|Ly%JqmuW zlIEW^Ft%z?*|fpXda>Jr^1noFZEwFgVV%|*XhH@acv8rdGxeEX{M$(vG{Zw+x(ei@ zmfXb22}8-?Fi`vo-YVrTH*C?a8%M=Hv9MqVH7H^J$KsD?>!SFZ;ZsvnHr_gn=7acz z#W?0eCdVhVMWN12VV^$>WlQ?f;P^{(&pYTops|btm6aj>_Uz+hqpGwB)vWp0Cf5y< zft8-je~nn?W11plq}N)4A{l8I7$!ks_x$PXW-2XaRFswX_BnF{R#6YIwMhAgd5F9X zGmwdadS6(a^fjHtXg8=l?Rc0Sm%hk6E9!5cLVloEy4eh(=FwgP`)~I^5~pBEWo+F6 zSf2ncyMurJN91#cJTy_u8Y}@%!bq1RkGC~-bV@SXRd4F{R-*V`bS+6;W5vZ(&+I<9$;-V|eNfLa5n-6% z2(}&uGRF;p92eS*sE*oR$@pexaqr*meB)VhmIg@h{uzkk$9~qh#cHhw#>O%)b@+(| z^IQgqzuj~Sk(J;swEM-3TrJAPCq9k^^^`q{IItKBRXYe}e0Tdr=Huf7da3$l4PdpwWDop%^}n;dD#K4s#DYA8SHZ z&1!riV4W4R7R#C))JH1~axJ)RYnM$$lIR%6fIVA@zV{XVyx}C+a-Dt8Y9M)^KU0+H zR4IUb2CJ{Hg>CuaXtD50jB(_Tcx=Z$^WYu2u5kubqmwp%drJ6 z?Fo40g!Qd<-l=TQxqHEOuPX0;^z7iX?Ke^a%XT<13TA^5`4Xcw6D@Ur&VT&CUe0d} z1GjOVF1^L@>O)l@?bD~$wzgf(nxX1OGD8fEV?TdJcZc2KoUe|oP1#=$$7ee|xbY)A zDZq+cuTpc(fFdj^=!;{k03C69lMQ(|>uhRfRu%+!k&YOi-3|1QKB z z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zl&#s4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6# z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f# zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv! zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG z-wfS zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9 z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE# z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1 zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/account_analytic_required/static/description/index.html b/account_analytic_required/static/description/index.html new file mode 100644 index 0000000000..ffaf31e349 --- /dev/null +++ b/account_analytic_required/static/description/index.html @@ -0,0 +1,436 @@ + + + + + + +Account Analytic Required + + + +
+

Account Analytic Required

+ + +

Beta License: AGPL-3 OCA/account-analytic Translate me on Weblate Try me on Runbot

+

This module adds an option analytic policy on account types. +You have the choice between 4 policies : always, never, posted moves and optional.

+

Table of contents

+ +
+

Configuration

+

Example:

+

If you want to have an analytic account on all your expenses, +set the policy to always for the account type expense +If you try to save an account move line with an account of type expense +without analytic account, you will get an error message.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/account-analytic project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_analytic_required/tests/test_account_analytic_required.py b/account_analytic_required/tests/test_account_analytic_required.py index b5cc8c845e..e25e412369 100644 --- a/account_analytic_required/tests/test_account_analytic_required.py +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -12,26 +12,25 @@ class TestAccountAnalyticRequired(common.SavepointCase): def setUpClass(cls): super(TestAccountAnalyticRequired, cls).setUpClass() cls.account_obj = cls.env['account.account'] - cls.account_type_obj = cls.env['account.account.type'] cls.move_obj = cls.env['account.move'] cls.move_line_obj = cls.env['account.move.line'] cls.analytic_account_obj = cls.env['account.analytic.account'] cls.analytic_account = cls.analytic_account_obj.create( {'name': 'test aa'}) - cls.account_sales = cls.env['account.account'].create({ + cls.account_sales = cls.account_obj.create({ 'code': "X1020", 'name': "Product Sales - (test)", 'user_type_id': cls.env.ref( 'account.data_account_type_revenue').id }) - cls.account_recv = cls.env['account.account'].create({ + cls.account_recv = cls.account_obj.create({ 'code': "X11002", 'name': "Debtors - (test)", 'reconcile': True, 'user_type_id': cls.env.ref( 'account.data_account_type_receivable').id }) - cls.account_exp = cls.env['account.account'].create({ + cls.account_exp = cls.account_obj.create({ 'code': "X2110", 'name': "Expenses - (test)", 'user_type_id': cls.env.ref( From 74614c0037d954960c60f91a3b2ee9a09ef603ea Mon Sep 17 00:00:00 2001 From: Raf Ven Date: Tue, 15 Jan 2019 16:16:05 +0100 Subject: [PATCH 54/89] [FIX] TypeError: post() got an unexpected keyword argument 'invoice' --- .../i18n/account_analytic_required.pot | 20 +++++------ account_analytic_required/i18n/ar.po | 27 ++++++++------- account_analytic_required/i18n/ca.po | 18 +++++----- account_analytic_required/i18n/de.po | 23 ++++++++----- account_analytic_required/i18n/es.po | 20 ++++++----- account_analytic_required/i18n/es_CO.po | 20 ++++++----- account_analytic_required/i18n/fr.po | 23 ++++++++----- account_analytic_required/i18n/hr_HR.po | 20 ++++++----- account_analytic_required/i18n/nl.po | 18 +++++----- account_analytic_required/i18n/pt_BR.po | 33 +++++++++++-------- account_analytic_required/models/account.py | 4 +-- 11 files changed, 126 insertions(+), 100 deletions(-) diff --git a/account_analytic_required/i18n/account_analytic_required.pot b/account_analytic_required/i18n/account_analytic_required.pot index 40ded4f54e..d7142a0d33 100644 --- a/account_analytic_required/i18n/account_analytic_required.pot +++ b/account_analytic_required/i18n/account_analytic_required.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -13,11 +13,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -29,7 +24,7 @@ msgid "Always" msgstr "" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "" @@ -52,10 +47,15 @@ msgid "Analytic policy is set to 'Posted moves' with account %s '%s' but the ana msgstr "" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entries" +msgstr "" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -72,7 +72,7 @@ msgid "Optional" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "" @@ -82,7 +82,7 @@ msgid "Posted moves" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Posted moves', the accountant will get an error message if no analytic account is defined when the move is posted ; if you select 'Never', the accountant will get an error message if an analytic account is present." msgstr "" diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po index 9768794a0f..47b145bc09 100644 --- a/account_analytic_required/i18n/ar.po +++ b/account_analytic_required/i18n/ar.po @@ -20,11 +20,6 @@ msgstr "" "&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" "X-Generator: Weblate 3.1.1\n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "قيد الحساب" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -36,7 +31,7 @@ msgid "Always" msgstr "دائماً" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "سياسة الحسابات التحليلية" @@ -47,8 +42,8 @@ msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " "account is missing in the account move line with label '%s'." msgstr "" -"سياسة الحسابات التحليلية هي ’دائماً‘ للحساب %s ’%s‘ ولكن الحساب التحليلي " -"فارغ في عنصر اليومية باسم ’%s‘." +"سياسة الحسابات التحليلية هي ’دائماً‘ للحساب %s ’%s‘ ولكن الحساب التحليلي فارغ " +"في عنصر اليومية باسم ’%s‘." #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:67 @@ -71,10 +66,17 @@ msgstr "" "التحليلي فارغ في عنصر اليومية باسم ’%s‘." #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "تجميع حسب" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +#, fuzzy +#| msgid "Journal Item" +msgid "Journal Entries" +msgstr "عنصر اليومية" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -91,7 +93,7 @@ msgid "Optional" msgstr "إختياري" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "سياسة للحسابات التحليلية" @@ -101,7 +103,7 @@ msgid "Posted moves" msgstr "القيود المرحّلة" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " @@ -117,3 +119,6 @@ msgstr "" "حساب تحليلي; و ان قمت بإختيار \"قيويد مرحلة\" ستظهر للمحاسب رسالة خطأ اذا لم " "يحدد حساب تحليلي في ترحيل القيود; و إن اخترت \"ابداً\\نهائي\"، ستظهر للمحاسب " "رسالة خطأ اذا تم تحديد حساب تحليلي." + +#~ msgid "Account Entry" +#~ msgstr "قيد الحساب" diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po index a53150890a..b09fab0eb3 100644 --- a/account_analytic_required/i18n/ca.po +++ b/account_analytic_required/i18n/ca.po @@ -18,11 +18,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -34,7 +29,7 @@ msgid "Always" msgstr "" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "" @@ -63,10 +58,15 @@ msgid "" msgstr "" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entries" +msgstr "" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -83,7 +83,7 @@ msgid "Optional" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "Política per als comptes analítics" @@ -93,7 +93,7 @@ msgid "Posted moves" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " diff --git a/account_analytic_required/i18n/de.po b/account_analytic_required/i18n/de.po index b59b31b766..af95316fc4 100644 --- a/account_analytic_required/i18n/de.po +++ b/account_analytic_required/i18n/de.po @@ -18,11 +18,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "Kontoeintrag" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -34,7 +29,7 @@ msgid "Always" msgstr "Immer" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "Analytische Richtlinie" @@ -72,10 +67,17 @@ msgstr "" "Label ' %s'." #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "Gruppe Von" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +#, fuzzy +#| msgid "Journal Item" +msgid "Journal Entries" +msgstr "Tageseintrag" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -92,7 +94,7 @@ msgid "Optional" msgstr "Wahlweise" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "Richtlinie für analytisches Konto" @@ -102,7 +104,7 @@ msgid "Posted moves" msgstr "Buchungen" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " @@ -120,3 +122,6 @@ msgstr "" "Buchhalter eine Fehlermeldung, wenn bei der Buchung kein analytisches Konto " "definiert wurde. Wenn Sie \"Nie\" auswählen, erhält der Buchhalter eine " "Fehlermeldung, wenn ein analytisches Konto vorhanden ist." + +#~ msgid "Account Entry" +#~ msgstr "Kontoeintrag" diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po index 9163874733..af75a85af5 100644 --- a/account_analytic_required/i18n/es.po +++ b/account_analytic_required/i18n/es.po @@ -19,11 +19,6 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 3.1.1\n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -35,7 +30,7 @@ msgid "Always" msgstr "Siempre" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "" @@ -64,10 +59,17 @@ msgid "" msgstr "" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +#, fuzzy +#| msgid "Journal Item" +msgid "Journal Entries" +msgstr "Apunte contable" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -84,7 +86,7 @@ msgid "Optional" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "Política para las cuentas analíticas" @@ -94,7 +96,7 @@ msgid "Posted moves" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " diff --git a/account_analytic_required/i18n/es_CO.po b/account_analytic_required/i18n/es_CO.po index 59edc61335..47bfa7374f 100644 --- a/account_analytic_required/i18n/es_CO.po +++ b/account_analytic_required/i18n/es_CO.po @@ -20,11 +20,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -36,7 +31,7 @@ msgid "Always" msgstr "Siempre" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "" @@ -65,10 +60,17 @@ msgid "" msgstr "" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +#, fuzzy +#| msgid "Journal Item" +msgid "Journal Entries" +msgstr "Elemento del Libro" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -85,7 +87,7 @@ msgid "Optional" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "" @@ -95,7 +97,7 @@ msgid "Posted moves" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po index b1e7bb226e..2e0357168b 100644 --- a/account_analytic_required/i18n/fr.po +++ b/account_analytic_required/i18n/fr.po @@ -20,11 +20,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "Ecriture comptable" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -36,7 +31,7 @@ msgid "Always" msgstr "Toujours" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "Stratégie analytique" @@ -72,10 +67,17 @@ msgstr "" "'%s'." #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "Grouper par" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +#, fuzzy +#| msgid "Journal Item" +msgid "Journal Entries" +msgstr "Écriture du journal" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -92,7 +94,7 @@ msgid "Optional" msgstr "Facultatif" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "Politique pour les comptes analytiques" @@ -102,7 +104,7 @@ msgid "Posted moves" msgstr "Ecritures comptabilisées" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " @@ -120,3 +122,6 @@ msgstr "" "recevra un message d'erreur si aucun compte analytique n'est défini lors de " "la comptabilisation de l'écriture; si vous sélectionnez \"Jamais\", le " "comptable recevra un message d'erreur si un compte analytique est présent." + +#~ msgid "Account Entry" +#~ msgstr "Ecriture comptable" diff --git a/account_analytic_required/i18n/hr_HR.po b/account_analytic_required/i18n/hr_HR.po index 2f07673c69..11e63e2731 100644 --- a/account_analytic_required/i18n/hr_HR.po +++ b/account_analytic_required/i18n/hr_HR.po @@ -20,11 +20,6 @@ msgstr "" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -36,7 +31,7 @@ msgid "Always" msgstr "Uvijek" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "Analitička pravila" @@ -69,10 +64,17 @@ msgid "" msgstr "" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "Grupiraj po" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +#, fuzzy +#| msgid "Journal Item" +msgid "Journal Entries" +msgstr "Stavka dnevnika" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -89,7 +91,7 @@ msgid "Optional" msgstr "Opcionalno" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "Pravila za analitička konta" @@ -99,7 +101,7 @@ msgid "Posted moves" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " diff --git a/account_analytic_required/i18n/nl.po b/account_analytic_required/i18n/nl.po index 0654705b4c..408656bf8f 100644 --- a/account_analytic_required/i18n/nl.po +++ b/account_analytic_required/i18n/nl.po @@ -18,11 +18,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -34,7 +29,7 @@ msgid "Always" msgstr "" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "" @@ -65,10 +60,15 @@ msgid "" msgstr "" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entries" +msgstr "" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -85,7 +85,7 @@ msgid "Optional" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "Kostenplaatsenbeleid" @@ -95,7 +95,7 @@ msgid "Posted moves" msgstr "" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " diff --git a/account_analytic_required/i18n/pt_BR.po b/account_analytic_required/i18n/pt_BR.po index 5666d4abf2..971560b890 100644 --- a/account_analytic_required/i18n/pt_BR.po +++ b/account_analytic_required/i18n/pt_BR.po @@ -11,8 +11,8 @@ msgstr "" "POT-Creation-Date: 2018-02-01 03:39+0000\n" "PO-Revision-Date: 2018-06-28 14:00+0000\n" "Last-Translator: Rodrigo Macedo \n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" -"23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,11 +20,6 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 3.0.1\n" -#. module: account_analytic_required -#: model:ir.model,name:account_analytic_required.model_account_move -msgid "Account Entry" -msgstr "Entrada de conta" - #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type msgid "Account Type" @@ -36,7 +31,7 @@ msgid "Always" msgstr "Sempre" #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" msgstr "Política Analítica" @@ -67,15 +62,22 @@ msgid "" "Analytic policy is set to 'Posted moves' with account %s '%s' but the " "analytic account is missing in the account move line with label '%s'." msgstr "" -"A política analítica está definida como 'Movimentos Publicados' com a conta %" -"s '%s', mas a conta analítica está ausente na linha de movimentação da conta " -"com o rótulo '%s'." +"A política analítica está definida como 'Movimentos Publicados' com a conta " +"%s '%s', mas a conta analítica está ausente na linha de movimentação da " +"conta com o rótulo '%s'." #. module: account_analytic_required -#: model:ir.ui.view,arch_db:account_analytic_required.view_account_type_search +#: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" msgstr "Agrupar por" +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +#, fuzzy +#| msgid "Journal Item" +msgid "Journal Entries" +msgstr "Item diário" + #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line msgid "Journal Item" @@ -92,7 +94,7 @@ msgid "Optional" msgstr "Opcional" #. module: account_analytic_required -#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" msgstr "Política para conta analítica" @@ -102,7 +104,7 @@ msgid "Posted moves" msgstr "Movimentos publicados" #. module: account_analytic_required -#: model:ir.model.fields,help:account_analytic_required.field_account_account_type_analytic_policy +#: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy msgid "" "Set the policy for analytic accounts : if you select 'Optional', the " "accountant is free to put an analytic account on an account move line with " @@ -120,3 +122,6 @@ msgstr "" "erro se nenhuma conta analítica for definida quando a movimentação for " "lançada; se você selecionar \"Nunca\", o contador receberá uma mensagem de " "erro se uma conta analítica estiver presente." + +#~ msgid "Account Entry" +#~ msgstr "Entrada de conta" diff --git a/account_analytic_required/models/account.py b/account_analytic_required/models/account.py index 280b3108f4..8dd826a085 100644 --- a/account_analytic_required/models/account.py +++ b/account_analytic_required/models/account.py @@ -32,8 +32,8 @@ class AccountMove(models.Model): _inherit = "account.move" @api.multi - def post(self): - res = super(AccountMove, self).post() + def post(self, *args, **kwargs): + res = super(AccountMove, self).post(*args, **kwargs) self.mapped('line_ids')._check_analytic_required() return res From 8e6db7611e9498b08ecc0d7956d7b35d83102978 Mon Sep 17 00:00:00 2001 From: Josep M Date: Mon, 22 Jul 2019 17:46:42 +0000 Subject: [PATCH 55/89] Translated using Weblate (Spanish) Currently translated at 100.0% (14 of 14 strings) Translation: account-analytic-12.0/account-analytic-12.0-account_analytic_required Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-account_analytic_required/es/ --- account_analytic_required/i18n/es.po | 39 +++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/account_analytic_required/i18n/es.po b/account_analytic_required/i18n/es.po index af75a85af5..6b9c1d65a3 100644 --- a/account_analytic_required/i18n/es.po +++ b/account_analytic_required/i18n/es.po @@ -9,15 +9,15 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-02-01 03:39+0000\n" -"PO-Revision-Date: 2018-09-23 13:08+0000\n" -"Last-Translator: Darío Lodeiros \n" +"PO-Revision-Date: 2019-07-22 19:43+0000\n" +"Last-Translator: Josep M \n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.1.1\n" +"X-Generator: Weblate 3.7.1\n" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_account_type @@ -32,7 +32,7 @@ msgstr "Siempre" #. module: account_analytic_required #: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Analytic Policy" -msgstr "" +msgstr "Política Analítica" #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:59 @@ -41,6 +41,9 @@ msgid "" "Analytic policy is set to 'Always' with account %s '%s' but the analytic " "account is missing in the account move line with label '%s'." msgstr "" +"La política analítica está configurada como \"Siempre\" para la cuenta %s '%" +"s' pero falta la cuenta análitica en la línea de movimiento de la cuenta con " +"la etiqueta '%s'." #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:67 @@ -49,6 +52,9 @@ msgid "" "Analytic policy is set to 'Never' with account %s '%s' but the account move " "line with label '%s' has an analytic account '%s'." msgstr "" +"La política analítica está configurada como \"Nunca\" para la cuenta %s '%s' " +"pero la línea de movimiento de la cuenta con la etiqueta '%s' tiene una " +"cuenta analítica '%s'." #. module: account_analytic_required #: code:addons/account_analytic_required/models/account.py:77 @@ -57,18 +63,19 @@ msgid "" "Analytic policy is set to 'Posted moves' with account %s '%s' but the " "analytic account is missing in the account move line with label '%s'." msgstr "" +"La política analítica está configurada como \"Movimientos publicados\" para " +"la cuenta %s '%s' pero falta la cuenta análitica en la línea de movimiento " +"de la cuenta con la etiqueta '%s'." #. module: account_analytic_required #: model_terms:ir.ui.view,arch_db:account_analytic_required.view_account_type_search msgid "Group By" -msgstr "" +msgstr "Agrupar por" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move -#, fuzzy -#| msgid "Journal Item" msgid "Journal Entries" -msgstr "Apunte contable" +msgstr "Apuntes contables" #. module: account_analytic_required #: model:ir.model,name:account_analytic_required.model_account_move_line @@ -78,22 +85,22 @@ msgstr "Apunte contable" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 msgid "Never" -msgstr "" +msgstr "Nunca" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 msgid "Optional" -msgstr "" +msgstr "Opcional" #. module: account_analytic_required #: model:ir.model.fields,field_description:account_analytic_required.field_account_account_type__analytic_policy msgid "Policy for analytic account" -msgstr "Política para las cuentas analíticas" +msgstr "Política para la cuenta analítica" #. module: account_analytic_required #: selection:account.account.type,analytic_policy:0 msgid "Posted moves" -msgstr "" +msgstr "Movimientos públicados" #. module: account_analytic_required #: model:ir.model.fields,help:account_analytic_required.field_account_account_type__analytic_policy @@ -106,3 +113,11 @@ msgid "" "defined when the move is posted ; if you select 'Never', the accountant will " "get an error message if an analytic account is present." msgstr "" +"Establezca la política para las cuentas analíticas: si selecciona " +"'Opcional', el contable es libre de poner una cuenta analítica en una línea " +"de movimiento de una cuenta con este tipo de cuenta; si selecciona " +"'Siempre', el contable recibirá un mensaje de error si no hay una cuenta " +"analítica; si selecciona 'Movimientos publicados', el contable recibirá un " +"mensaje de error si no se define una cuenta analítica cuando se publica el " +"movimiento; si selecciona 'Nunca', el contable recibirá un mensaje de error " +"si hay una cuenta analítica presente." From fc98b760d34a7e6902ef8865ec20ef4746d00ed3 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 29 Jul 2019 02:31:47 +0000 Subject: [PATCH 56/89] [UPD] README.rst --- account_analytic_required/static/description/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_analytic_required/static/description/index.html b/account_analytic_required/static/description/index.html index ffaf31e349..13df94128a 100644 --- a/account_analytic_required/static/description/index.html +++ b/account_analytic_required/static/description/index.html @@ -3,7 +3,7 @@ - + Account Analytic Required