diff --git a/account_analytic_required/README.rst b/account_analytic_required/README.rst new file mode 100644 index 0000000000..9578ea624d --- /dev/null +++ b/account_analytic_required/README.rst @@ -0,0 +1,123 @@ +========================= +Account Analytic Required +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a730f262f22e1e9c4c933b5b63d3d99bd213aa3a221d3b2b3295275730a5176d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/17.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-17-0/account-analytic-17-0-account_analytic_required + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-analytic&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds an option *analytic policy* on accounts. You have the +choice between 4 policies : *always*, *never*, *posted moves* and +*optional*. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Example: + +If you want to have an analytic account on all your *expenses*, set the +policy to *always* for the account of type *expense*. If you try to save +a journal items with an account of type *expense* without analytic +account, you will get an error message. + +Usage +===== + + + +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 to smash 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 + +- Laetitia Gangloff + +- Luc De Meyer, Noviat + +- Yannick Vaucher + +- Akim Juillerat + +- Raf Ven + +- Iván Todorovich + +- `Trobz `__: + + - Nguyễn Minh Chiến + +- `APSL-Nagarro `__: + + - Antoni Marroig + +Other credits +------------- + +The migration of this module from 15.0 to 16.0 was financially supported +by Camptocamp + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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/__init__.py b/account_analytic_required/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/account_analytic_required/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_analytic_required/__manifest__.py b/account_analytic_required/__manifest__.py new file mode 100644 index 0000000000..c8d7a5a83c --- /dev/null +++ b/account_analytic_required/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright Akretion - Alexis de Lattre +# Copyright Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +{ + "name": "Account Analytic Required", + "version": "17.0.1.0.0", + "category": "Analytic Accounting", + "license": "AGPL-3", + "author": "Akretion, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-analytic", + "depends": ["account_usability"], + "data": ["views/account_account_views.xml"], + "installable": True, +} 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..b0ad62c759 --- /dev/null +++ b/account_analytic_required/i18n/account_analytic_required.pot @@ -0,0 +1,95 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_account +msgid "Account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account" +" move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic account.\n" +"- Posted moves: The accountant will get an error message if no analytic account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is present.\n" +"\n" +"This field is company dependent." +msgstr "" diff --git a/account_analytic_required/i18n/ar.po b/account_analytic_required/i18n/ar.po new file mode 100644 index 0000000000..4fcfcb34a1 --- /dev/null +++ b/account_analytic_required/i18n/ar.po @@ -0,0 +1,114 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-02-17 07:26+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \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_account +msgid "Account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "دائماً" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"سياسة الحسابات التحليلية هي ’دائماً‘ للحساب ’%(account)s‘ ولكن الحساب " +"التحليلي فارغ في عنصر اليومية باسم ’%(move)s‘." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"سياسة الحسابات التحليلية هي ’ممنوع‘ للحساب ’%(account)s‘ ولكن في عنصر " +"اليومية باسم ’%(move)s‘ تم تحديد حساب التحليلي ’%(analytic_account)s‘ ." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"سياسة الحسابات التحليلية هي ’القيود المرحّلة‘ للحساب ’%(account)s‘ ولكن " +"الحساب التحليلي فارغ في عنصر اليومية باسم ’%(move)s‘." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "عنصر اليومية" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "عنصر اليومية" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "ممنوع" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "إختياري" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "سياسة للحسابات التحليلية" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "القيود المرحّلة" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +msgstr "" +"قم بإختيار السياسات للحسابات التحليلية: اذا قم بإختيار \"إختياري\"، للمحاسب " +"الحرية في اختيار حساب التحليلي ام لا في حركة القيد المحسابي مع هذا النوع من " +"الحساب; و إن قمت بإختيار \"دائما\"، ستظهر للمحاسب رسالة خطأ ان كان لا يوجد " +"حساب تحليلي; و ان قمت بإختيار \"قيويد مرحلة\" ستظهر للمحاسب رسالة خطأ اذا لم " +"يحدد حساب تحليلي في ترحيل القيود; و إن اخترت \"ابداً\\نهائي\"، ستظهر للمحاسب " +"رسالة خطأ اذا تم تحديد حساب تحليلي." diff --git a/account_analytic_required/i18n/ca.po b/account_analytic_required/i18n/ca.po new file mode 100644 index 0000000000..11cf19a0d5 --- /dev/null +++ b/account_analytic_required/i18n/ca.po @@ -0,0 +1,121 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-02-17 07:26+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \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_account +msgid "Account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Sempre" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"La política analítica s'ha establert en 'Sempre' en el compte '%(account)s' " +"però falta el compte analític a la línia de moviment del compte amb " +"l'etiqueta '%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"La política analítica s'ha establert en 'Mai' '%(account)s' però l'apunt " +"'%(move)s' té el compte analític '%(analytic_account)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"La política analítica conté el valor 'Moviments publicats' al compte " +"%(account)s però el compte analític no existeix en l'apunt amb etiqueta " +"'%(move)s'." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Assentaments" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Apunts" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "Mai" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "Opcional" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Política per als comptes analítics" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "Moviments publicats" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +msgstr "" +"Estableix la política dels comptes analítics.\n" +"Si seleccioneu:\n" +"- Opcional: el comptable és lliure de posar un compte analític en una línia " +"de moviment de compte amb aquest tipus de compte.\n" +"- Sempre: el comptable rebrà un missatge d'error si no hi ha cap compte " +"analític.\n" +"- Moviments publicats: el comptable rebrà un missatge d'error si no es " +"defineix cap compte analític quan es publica el moviment.\n" +"- Mai: el comptable rebrà un missatge d'error si hi ha un compte analític.\n" +"\n" +"Aquest camp depèn de l'empresa." diff --git a/account_analytic_required/i18n/de.po b/account_analytic_required/i18n/de.po new file mode 100644 index 0000000000..5f9b68afab --- /dev/null +++ b/account_analytic_required/i18n/de.po @@ -0,0 +1,120 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-02-17 07:26+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \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_account +msgid "Account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Immer" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"Die Analytic-Richtlinie ist mit dem Konto '%(account)s' auf 'Immer' " +"eingestellt, aber im Analysekonto fehlt in der Buchungslinie mit der " +"Bezeichnung '%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"Die Analytic-Richtlinie ist auf \"Nie\" eingestellt mit Konto %(account)s " +"aber die Buchungslinie mit Marke '%(move)s' hat ein anlaytisches Konto " +"'%(analytic_account)s'. " + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"Die Analytic-Richtlinie ist auf \"Posted moves\" eingestellt mit dem " +"Konto \n" +"'%(account)s' aber das analytische Konto fehlt in der Buchungslinie mit dem " +"Label '%(move)s'." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Journaleintrag" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Journaleintrag" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "Nie" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "Wahlweise" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Richtlinie für analytisches Konto" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "Buchungen" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +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 new file mode 100644 index 0000000000..0328badf4c --- /dev/null +++ b/account_analytic_required/i18n/es.po @@ -0,0 +1,124 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-07-11 10:10+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: \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 4.17\n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account +msgid "Account" +msgstr "Cuenta" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Siempre" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"La política analítica está configurada como \"Siempre\" para la cuenta " +"'%(account)s' pero falta la cuenta análitica en la línea de movimiento de la " +"cuenta con la etiqueta '%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"La política analítica está configurada como \"Nunca\" para la cuenta " +"'%(account)s' pero la línea de movimiento de la cuenta con la etiqueta " +"'%(move)s' tiene una cuenta analítica '%(analytic_account)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"La política analítica está configurada como \"Movimientos publicados\" para " +"la cuenta '%(account)s' pero falta la cuenta análitica en la línea de " +"movimiento de la cuenta con la etiqueta '%(move)s'." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Apuntes contables" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Apunte contable" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "Nunca" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "Opcional" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Política para la cuenta analítica" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "Movimientos públicados" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +msgstr "" +"Establezca la política para las cuentas analíticas: \n" +"Si selecciona:\n" +"- '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. \n" +"- 'Siempre', el contable recibirá un mensaje de error si no hay una cuenta " +"analítica; si selecciona. \n" +"- 'Movimientos publicados', el contable recibirá un mensaje de error si no " +"se define una cuenta analítica cuando se publica el movimiento. \n" +"- 'Nunca', el contable recibirá un mensaje de error si hay una cuenta " +"analítica presente.\n" +"\n" +"Este campo depende de la compañía." diff --git a/account_analytic_required/i18n/es_CO.po b/account_analytic_required/i18n/es_CO.po new file mode 100644 index 0000000000..c2ebd3c678 --- /dev/null +++ b/account_analytic_required/i18n/es_CO.po @@ -0,0 +1,102 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-02-17 07:26+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \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_account +msgid "Account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Siempre" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Elemento del Libro" + +#. 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 +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +msgstr "" diff --git a/account_analytic_required/i18n/fr.po b/account_analytic_required/i18n/fr.po new file mode 100644 index 0000000000..efb6251df4 --- /dev/null +++ b/account_analytic_required/i18n/fr.po @@ -0,0 +1,118 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-02-17 07:26+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \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_account +msgid "Account" +msgstr "Compte" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Toujours" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"La règle analytique est définie sur 'Toujours' pour le comptes '%(account)s' " +"mais le compte analytique est absent de l'écriture ayant libellé '%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"La règle analytique est définie sur 'Jamais' pour le compte '%(account)s' " +"mais l'écriture avec le libellé '%(move)s' a un compte analytique de définit " +"'%(analytic_account)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"La règle analytique est définie à 'Ecritures comptabilisées' pour le compte " +"'%(account)s' mais le compte analytique est absent de l'écriture ayant le " +"libellé '%(move)s'." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Pièce comptable" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Écriture comptable" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "Jamais" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "Facultatif" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Politique pour les comptes analytiques" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "Ecritures comptabilisées" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +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 " +"é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.po b/account_analytic_required/i18n/hr.po new file mode 100644 index 0000000000..ca74c3b2db --- /dev/null +++ b/account_analytic_required/i18n/hr.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-06-17 17:37+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \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" +"X-Generator: Weblate 4.17\n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account +msgid "Account" +msgstr "Konto" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Uvijek" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"Analitičko pravilo je postavljeno na 'Uvijek' za konto '%(account)s' ali " +"analitički konto nedostaje u stavci temeljnice sa naslovom '%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account" +" move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"Analitičko pravilo je postavljeno na 'Nikada' za konto '%(account)s' ali na " +"stavci temeljnice sa oznakom '%(move)s' postoji analitički konto " +"'%(analytic_account)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"Analitičko pravilo je postavljeno na \"Proknjiženo\" na kontima '%(account)" +"s' ali analitičkikonto nedostaje na stavci knjiženja pod nazivom '%(move)s'." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Stavka dnevnika" + +#. 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 +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "Nikad" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "Opcionalno" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Pravila za analitička konta" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "Proknjjižene temeljnice" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic account.\n" +"- Posted moves: The accountant will get an error message if no analytic account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is present.\n" +"\n" +"This field is company dependent." +msgstr "" diff --git a/account_analytic_required/i18n/hr_HR.po b/account_analytic_required/i18n/hr_HR.po new file mode 100644 index 0000000000..00c3d5fde3 --- /dev/null +++ b/account_analytic_required/i18n/hr_HR.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-02-17 07:26+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \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_account +msgid "Account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Uvijek" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"Analitičko pravilo je postavljeno na 'Uvijek' za konto '%(account)s' ali " +"analitički konto nedostaje u stavci temeljnice sa naslovom '%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"Analitičko pravilo je postavljeno na 'Nikada' za konto '%(account)s' ali na " +"stavci temeljnice sa oznakom '%(move)s' postoji analitički konto " +"'%(analytic_account)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Stavka dnevnika" + +#. 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 +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "Nikad" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "Opcionalno" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Pravila za analitička konta" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +msgstr "" diff --git a/account_analytic_required/i18n/it.po b/account_analytic_required/i18n/it.po new file mode 100644 index 0000000000..73a9904cfb --- /dev/null +++ b/account_analytic_required/i18n/it.po @@ -0,0 +1,119 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-02-23 08:43+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\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 4.17\n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account +msgid "Account" +msgstr "Conto" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Sempre" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"La politica analitica è impostata a 'Sempre' per il conto '%(account)s' ma " +"il conto analitico non è presente nel movimento contabile con etichetta " +"'%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account" +" move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"La politica analitica è impostata a 'Mai' per il conto '%(account)s' ma il " +"movimento contabile con etichetta '%(move)s' ha un conto analitico " +"'%(analytic_account)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"La politica analitica è impostata a 'Registrazioni confermate' per il conto " +"'%(account)s' ma il conto analitico non è presente nel movimento contabile " +"con etichetta '%(move)s'." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Registrazione contabile" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Movimento contabile" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "Mai" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "Opzionale" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Politica per il conto analitico" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "Registrazioni confermate" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic account.\n" +"- Posted moves: The accountant will get an error message if no analytic account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is present.\n" +"\n" +"This field is company dependent." +msgstr "" +"Impostare la politica per i conti analitici:\n" +"se selezioni:\n" +"- 'Opzionale', il contabile è libero di mettere un conto analitico su un " +"movimento contabile di questo tipo; \n" +"- 'Sempre', il contabile otterrà un messaggio di errore se non c'è un conto " +"analitico; \n" +"- 'Registrazioni confermate', il contabile otterrà un messaggio di errore se " +"nessun conto analitico è definito quando il movimento viene confermato; \n" +"- 'Mai', il contabile otterrà un messaggio di errore se un conto analitico è " +"presente.\n" +"\n" +"Questo campo dipende dall'azienda." diff --git a/account_analytic_required/i18n/nl.po b/account_analytic_required/i18n/nl.po new file mode 100644 index 0000000000..1399e88e42 --- /dev/null +++ b/account_analytic_required/i18n/nl.po @@ -0,0 +1,105 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-02-17 07:26+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \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_account +msgid "Account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"Het is verplicht een kostenplaats op te geven bij boekingen op rekening " +"'%(account)s' , maar deze ontbreekt in de boekingsregel met de omschrijving " +"'%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Kostenplaatsenbeleid" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +msgstr "" diff --git a/account_analytic_required/i18n/pt_BR.po b/account_analytic_required/i18n/pt_BR.po new file mode 100644 index 0000000000..3ef53c6e60 --- /dev/null +++ b/account_analytic_required/i18n/pt_BR.po @@ -0,0 +1,124 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-10-28 13:31+0000\n" +"Last-Translator: Adriano Prado \n" +"Language-Team: \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" +"X-Generator: Weblate 4.17\n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account +msgid "Account" +msgstr "Conta" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Sempre" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"A política analítica é definida como \"Sempre\" com conta '%(account)s' Mas " +"a conta analítica está faltando na linha de mudança de conta com o rótulo " +"'%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"A política analítica é definida como 'Nunca' com conta'%(account)s' mas a " +"linha de movimento da conta com o rótulo '%(move)s' tem uma conta analítica " +"'%(analytic_account)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"A política analítica está definida como 'Movimentos Publicados' com a conta " +"'%(account)s', mas a conta analítica está ausente na linha de movimentação " +"da conta com o rótulo '%(move)s'." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Entrada de Diário" + +#. 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 +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "Nunca" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "Opcional" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Política para conta analítica" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "Movimentos publicados" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +msgstr "" +"Define a política para contas analíticas.\n" +"Se você selecionar:\n" +"- Opcional: o contador é livre para colocar uma conta analítica em uma linha " +"de movimentação de conta com este tipo de conta.\n" +"- Sempre: o contador receberá uma mensagem de erro se não houver conta " +"analítica.\n" +"- Movimentos publicados: O contador receberá uma mensagem de erro se nenhuma " +"conta analítica for definida quando o movimento for publicado.\n" +"- Nunca: o contador receberá uma mensagem de erro se uma conta analítica " +"estiver presente.\n" +"\n" +"Este campo depende da empresa." diff --git a/account_analytic_required/i18n/sv.po b/account_analytic_required/i18n/sv.po new file mode 100644 index 0000000000..d059cc169f --- /dev/null +++ b/account_analytic_required/i18n/sv.po @@ -0,0 +1,120 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2024-02-27 18:34+0000\n" +"Last-Translator: jakobkrabbe \n" +"Language-Team: \n" +"Language: sv\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 4.17\n" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_account +msgid "Account" +msgstr "Konto" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "Alltid" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"Objektkontopolicyn är inställd på 'Alltid' för konto '%(account)s' men " +"objektkonto saknas på raden med etiketten '%(move)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"Objektkontopolicyn är inställd på 'Aldrig' för konto '%(account)s' men raden " +"med etiketten '%(move)s' har ett objektkonto '%(analytic_account)s'." + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"Objektkontopolicyn är inställd på 'Bokförda poster' för konto '%(account)s' " +"men objektkonto saknas på raden med etiketten '%(move)s'." + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "Verifikat" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "Journalrad" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "Aldrig" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "Valfritt" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "Objektkontopolicy" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "Bokförda transaktioner" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +msgstr "" +"Anger policyn för objektkonton.\n" +"Om du väljer:\n" +"- Valfritt: Bokföraren kan välja att ange ett objektkonto på en rad med den " +"här typen av konto.\n" +"- Alltid: Bokföraren får ett felmeddelande om det inte finns något " +"objektkonto.\n" +"- Bokförda poster: Bokföraren får ett felmeddelande om det inte finns något " +"objektkonto när posten bokförs.\n" +"- Aldrig: Bokföraren får ett felmeddelande om det finns ett objektkonto.\n" +"\n" +"Detta fält är bolagsberoende." diff --git a/account_analytic_required/i18n/zh_CN.po b/account_analytic_required/i18n/zh_CN.po new file mode 100644 index 0000000000..96cad255bb --- /dev/null +++ b/account_analytic_required/i18n/zh_CN.po @@ -0,0 +1,112 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-17 07:26+0000\n" +"PO-Revision-Date: 2023-02-17 07:26+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \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_account +msgid "Account" +msgstr "" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__always +msgid "Always" +msgstr "总是" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Always' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"分析策略设置为“始终”,帐户为 '%(account)s',但标签为 '%(move)s' 的帐户移动行中" +"缺少分析帐户。" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Never' with account '%(account)s' but the account " +"move line with label '%(move)s' has an analytic account " +"'%(analytic_account)s'." +msgstr "" +"分析策略设置为“从不”,帐户为 '%(account)s',但标签为 '%(move)s' 的帐户移动行" +"具有分析帐户 '%(analytic_account)s'。" + +#. module: account_analytic_required +#. odoo-python +#: code:addons/account_analytic_required/models/account.py:0 +#, python-format +msgid "" +"Analytic policy is set to 'Posted moves' with account '%(account)s' but the " +"analytic account is missing in the account move line with label '%(move)s'." +msgstr "" +"分析策略设置为“已发布移动”,帐户为 '%(account)s',但在标签为 '%(move)s' 的帐" +"户移动行中缺少分析帐户。" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move +msgid "Journal Entry" +msgstr "日记帐分录" + +#. module: account_analytic_required +#: model:ir.model,name:account_analytic_required.model_account_move_line +msgid "Journal Item" +msgstr "日记帐项目" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__never +msgid "Never" +msgstr "从未" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__optional +msgid "Optional" +msgstr "可选" + +#. module: account_analytic_required +#: model:ir.model.fields,field_description:account_analytic_required.field_account_account__analytic_policy +msgid "Policy for analytic account" +msgstr "分析帐户策略" + +#. module: account_analytic_required +#: model:ir.model.fields.selection,name:account_analytic_required.selection__account_account__analytic_policy__posted +msgid "Posted moves" +msgstr "已发布的移动" + +#. module: account_analytic_required +#: model:ir.model.fields,help:account_analytic_required.field_account_account__analytic_policy +msgid "" +"Sets the policy for analytic accounts.\n" +"If you select:\n" +"- Optional: The accountant is free to put an analytic account on an account " +"move line with this type of account.\n" +"- Always: The accountant will get an error message if there is no analytic " +"account.\n" +"- Posted moves: The accountant will get an error message if no analytic " +"account is defined when the move is posted.\n" +"- Never: The accountant will get an error message if an analytic account is " +"present.\n" +"\n" +"This field is company dependent." +msgstr "" +"为分析帐户设置策略:如果选择“可选”,会计可以使用此类帐户在帐户移动行上自由放" +"置分析帐户; 如果您选择“始终”,如果没有分析帐户,会计将收到错误消息; 如果您选" +"择“已发布的移动”,则如果在发布移动时未定义分析帐户,则会计将收到错误消息; 如" +"果您选择“从不”,如果存在分析帐户,会计将收到错误消息。" 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..f06570eb42 --- /dev/null +++ b/account_analytic_required/models/account.py @@ -0,0 +1,105 @@ +# Copyright 2011-2020 Akretion - Alexis de Lattre +# Copyright 2016-2020 Camptocamp SA +# Copyright 2020 Druidoo - Iván Todorovich +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import _, api, exceptions, fields, models + + +class AccountAccount(models.Model): + _inherit = "account.account" + + analytic_policy = fields.Selection( + selection=[ + ("optional", "Optional"), + ("always", "Always"), + ("posted", "Posted moves"), + ("never", "Never"), + ], + string="Policy for analytic account", + default="optional", + company_dependent=True, + help=( + "Sets the policy for analytic accounts.\n" + "If you select:\n" + "- Optional: The accountant is free to put an analytic account " + "on an account move line with this type of account.\n" + "- Always: The accountant will get an error message if " + "there is no analytic account.\n" + "- Posted moves: The accountant will get an error message if no " + "analytic account is defined when the move is posted.\n" + "- Never: The accountant will get an error message if an analytic " + "account is present.\n\n" + "This field is company dependent." + ), + ) + + def _get_analytic_policy(self): + """Extension point to obtain analytic policy for an account""" + self.ensure_one() + return self.analytic_policy + + +class AccountMove(models.Model): + _inherit = "account.move" + + def _post(self, soft=True): + res = super()._post(soft=soft) + self.mapped("line_ids")._check_analytic_required() + return res + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + def _check_analytic_required_msg(self): + self.ensure_one() + company_cur = self.company_currency_id + if company_cur.is_zero(self.debit) and company_cur.is_zero(self.credit): + return None + analytic_policy = self.account_id._get_analytic_policy() + if analytic_policy == "always" and not self.analytic_distribution: + return _( + "Analytic policy is set to 'Always' with account " + "'%(account)s' but the analytic account is missing in " + "the account move line with label '%(move)s'." + ) % { + "account": self.account_id.display_name, + "move": self.name or "", + } + elif analytic_policy == "never" and (self.analytic_distribution): + analytic_account = self.analytic_distribution + analytic_acc_ids = [int(k) for k in analytic_account.keys()] + analytic_accs = self.env["account.analytic.account"].browse( + analytic_acc_ids + ) + return _( + "Analytic policy is set to 'Never' with account " + "'%(account)s' but the account move line with label '%(move)s' " + "has an analytic account '%(analytic_account)s'." + ) % { + "account": self.account_id.display_name, + "move": self.name or "", + "analytic_account": ", ".join(analytic_accs.mapped("name")), + } + elif ( + analytic_policy == "posted" + and not self.analytic_distribution + and self.move_id.state == "posted" + ): + return _( + "Analytic policy is set to 'Posted moves' with " + "account '%(account)s' but the analytic account is missing " + "in the account move line with label '%(move)s'." + ) % { + "account": self.account_id.display_name, + "move": self.name or "", + } + return None + + @api.constrains("analytic_distribution", "account_id", "debit", "credit") + def _check_analytic_required(self): + for rec in self: + message = rec._check_analytic_required_msg() + if message: + raise exceptions.ValidationError(message) diff --git a/account_analytic_required/pyproject.toml b/account_analytic_required/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/account_analytic_required/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_analytic_required/readme/CONFIGURE.md b/account_analytic_required/readme/CONFIGURE.md new file mode 100644 index 0000000000..ccd3292709 --- /dev/null +++ b/account_analytic_required/readme/CONFIGURE.md @@ -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 of type *expense*. If you try to save +a journal items with an account of type *expense* without analytic +account, you will get an error message. diff --git a/account_analytic_required/readme/CONTRIBUTORS.md b/account_analytic_required/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..ebf6b94db5 --- /dev/null +++ b/account_analytic_required/readme/CONTRIBUTORS.md @@ -0,0 +1,25 @@ +- Alexis de Lattre \<\> + +- Stéphane Bidoul + +- Stefan Rijnhart + +- Laetitia Gangloff + +- Luc De Meyer, Noviat \<\> + +- Yannick Vaucher \<\> + +- Akim Juillerat \<\> + +- Raf Ven \<\> + +- Iván Todorovich \<\> + +- [Trobz](https://trobz.com): + + > - Nguyễn Minh Chiến \<\> + +- [APSL-Nagarro](https://apsl.tech): + + > - Antoni Marroig \<\> diff --git a/account_analytic_required/readme/CREDITS.md b/account_analytic_required/readme/CREDITS.md new file mode 100644 index 0000000000..291e14c81e --- /dev/null +++ b/account_analytic_required/readme/CREDITS.md @@ -0,0 +1,2 @@ +The migration of this module from 15.0 to 16.0 was financially supported +by Camptocamp diff --git a/account_analytic_required/readme/DESCRIPTION.md b/account_analytic_required/readme/DESCRIPTION.md new file mode 100644 index 0000000000..a26d24b55c --- /dev/null +++ b/account_analytic_required/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module adds an option *analytic policy* on accounts. You have the +choice between 4 policies : *always*, *never*, *posted moves* and +*optional*. diff --git a/account_analytic_required/readme/USAGE.md b/account_analytic_required/readme/USAGE.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/account_analytic_required/readme/USAGE.md @@ -0,0 +1 @@ + diff --git a/account_analytic_required/static/description/icon.png b/account_analytic_required/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/account_analytic_required/static/description/icon.png differ diff --git a/account_analytic_required/static/description/index.html b/account_analytic_required/static/description/index.html new file mode 100644 index 0000000000..bc695a8a31 --- /dev/null +++ b/account_analytic_required/static/description/index.html @@ -0,0 +1,472 @@ + + + + + +Account Analytic Required + + + +
+

Account Analytic Required

+ + +

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

+

This module adds an option analytic policy on accounts. 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 of type expense. If you try to save +a journal items with an account of type expense without analytic +account, you will get an error message.

+
+
+

Usage

+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 15.0 to 16.0 was financially supported +by Camptocamp

+
+
+

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/__init__.py b/account_analytic_required/tests/__init__.py new file mode 100644 index 0000000000..fc369e3ef6 --- /dev/null +++ b/account_analytic_required/tests/__init__.py @@ -0,0 +1 @@ +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 new file mode 100644 index 0000000000..e7bb8f3205 --- /dev/null +++ b/account_analytic_required/tests/test_account_analytic_required.py @@ -0,0 +1,163 @@ +# Copyright 2014 Acsone +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +from datetime import datetime + +from odoo import exceptions +from odoo.tests import common + + +class TestAccountAnalyticRequired(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.account_obj = cls.env["account.account"] + 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_plan_obj = cls.env["account.analytic.plan"] + cls.analytic_plan = cls.analytic_plan_obj.create({"name": "test aa plan"}) + cls.analytic_account_1 = cls.analytic_account_obj.create( + {"name": "test aa 1 for distribution", "plan_id": cls.analytic_plan.id} + ) + cls.analytic_account_2 = cls.analytic_account_obj.create( + {"name": "test aa 2 for distribution", "plan_id": cls.analytic_plan.id} + ) + cls.account_sales = cls.account_obj.create( + { + "code": "X1020", + "name": "Product Sales - (test)", + "account_type": "income", + } + ) + cls.account_recv = cls.account_obj.create( + { + "code": "X11002", + "name": "Debtors - (test)", + "reconcile": True, + "account_type": "asset_receivable", + } + ) + cls.account_exp = cls.account_obj.create( + { + "code": "X2110", + "name": "Expenses - (test)", + "account_type": "expense", + } + ) + cls.sales_journal = cls.env["account.journal"].create( + { + "name": "Sales Journal - (test)", + "code": "TSAJ", + "type": "sale", + } + ) + cls.analytic_distribution_1 = { + str(cls.analytic_account_1.id): 50.0, + } + cls.analytic_distribution_2 = { + str(cls.analytic_account_2.id): 50.0, + } + + 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 = {"name": "/", "journal_id": self.sales_journal.id, "date": date} + move = self.move_obj.create(move_vals) + move_line = ml_obj.create( + { + "move_id": move.id, + "name": "/", + "debit": 0, + "credit": amount, + "account_id": self.account_sales.id, + "analytic_distribution": self.analytic_distribution_1 + if with_analytic + else {}, + } + ) + ml_obj.create( + { + "move_id": move.id, + "name": "/", + "debit": amount, + "credit": 0, + "account_id": self.account_recv.id, + } + ) + return move_line + + def _set_analytic_policy(self, policy, account=None): + if account is None: + account = self.account_sales + account.analytic_policy = policy + + def test_optional(self): + self._set_analytic_policy("optional") + 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(exceptions.ValidationError): + 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(exceptions.ValidationError): + 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 analytic when policy is always + self._set_analytic_policy("always") + line = self._create_move(with_analytic=True) + with self.assertRaises(exceptions.ValidationError): + line.write({"analytic_distribution": {}}) + + def test_change_account(self): + 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(exceptions.ValidationError): + line.write({"account_id": self.account_exp.id}) + # change account to a_expense with policy always + # with analytic account -> ok + line.write( + { + "account_id": self.account_exp.id, + "analytic_distribution": self.analytic_distribution_1, + } + ) + + def test_posted_raise(self): + self._set_analytic_policy("posted") + line = self._create_move(with_analytic=False) + move = line.move_id + with self.assertRaises(exceptions.ValidationError): + move.action_post() + + def test_posted_ok(self): + self._set_analytic_policy("posted") + line = self._create_move(with_analytic=True) + move = line.move_id + move.action_post() + self.assertEqual(move.state, "posted") diff --git a/account_analytic_required/views/account_account_views.xml b/account_analytic_required/views/account_account_views.xml new file mode 100644 index 0000000000..3e9ff6d445 --- /dev/null +++ b/account_analytic_required/views/account_account_views.xml @@ -0,0 +1,37 @@ + + + + + + account_analytic_required.account_account_form + account.account + + + + + + + + + + account_analytic_required.account_account_tree + account.account + + + + + + + + +