diff --git a/pos_analytic_by_config/README.rst b/pos_analytic_by_config/README.rst new file mode 100644 index 0000000000..c5cc054428 --- /dev/null +++ b/pos_analytic_by_config/README.rst @@ -0,0 +1,117 @@ +=================== +POS Analytic Config +=================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d9e9a16dc39889632d437be5d71d540c859e02d9cd77763d4ff5d4325eacd97a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/pos_analytic_by_config + :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-pos_analytic_by_config + :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 allows to generate analytic distributions from the PoS +orders. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure the analytic distributions by store: + +1. Go to *Invoicing > Configuration > Analytic Distribution Models* +2. We'll create one for every pos config. +3. Select an account prefix (Normally your incoming account prefix) +4. Select a PoS config (unhide it from the optionl fields). +5. Choose your desired distribution for that store. + +Usage +===== + +When you reconcile your sessions, the analytic distribution should go as +expected for your point of sale. + +Known issues / Roadmap +====================== + +- Add ``account_analytic_id`` in ``pos.order`` so we can use it in + reports. +- In ``13.0`` the session reconciliation has been refactored and thus + the journal items are now very simplified. There's no product detail + now, so we won't be able to analyze that level of detail anymore. For + invoices it remains as it was. + +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 +------- + +* ACSONE SA/NV +* Tecnativa + +Contributors +------------ + +- `ACSONE SA/NV `__ + + - Adrien Peiffer + - Cédric Pigeon + - Xavier Bouquiaux + +- `Tecnativa `__ + + - David Vidal + +- `APSL-Nagarro `__ + + - Antoni Marroig + +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/pos_analytic_by_config/__init__.py b/pos_analytic_by_config/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_analytic_by_config/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_analytic_by_config/__manifest__.py b/pos_analytic_by_config/__manifest__.py new file mode 100644 index 0000000000..4649d0d37b --- /dev/null +++ b/pos_analytic_by_config/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2015 ACSONE SA/NV +# Copyright 2020 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "POS Analytic Config", + "summary": "Use analytic account defined on POS configuration for POS orders", + "author": "ACSONE SA/NV, Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-analytic", + "category": "Point Of Sale, Accounting", + "version": "17.0.1.0.0", + "license": "AGPL-3", + "depends": ["point_of_sale"], + "data": [ + "views/account_analytic_distribution_model_views.xml", + ], +} diff --git a/pos_analytic_by_config/i18n/ar.po b/pos_analytic_by_config/i18n/ar.po new file mode 100644 index 0000000000..c119eabf1f --- /dev/null +++ b/pos_analytic_by_config/i18n/ar.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-02-14 17:23+0000\n" +"Last-Translator: Rachid Al Assir \n" +"Language-Team: none\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 ? 4 : 5;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "أوامر نقطة البيع" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "جلسة نقطة البيع" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "الحساب التحليلي" + +#~ msgid "Analytic Account for this config." +#~ msgstr "حساب تحليلي لهذا التكوين." + +#~ msgid "Analytic Account that these orders link to" +#~ msgstr "الحساب التحليلي الذي ترتبط به هذه الطلبات" + +#~ msgid "Journal Item" +#~ msgstr "عنصر اليومية" + +#~ msgid "Point of Sale Configuration" +#~ msgstr "إعدادات نقطة البيع" + +#~ msgid "Display Name" +#~ msgstr "الاسم المعروض" + +#~ msgid "ID" +#~ msgstr "المُعرف" + +#~ msgid "Last Modified on" +#~ msgstr "آخر تعديل في" diff --git a/pos_analytic_by_config/i18n/ca.po b/pos_analytic_by_config/i18n/ca.po new file mode 100644 index 0000000000..6c8c68039f --- /dev/null +++ b/pos_analytic_by_config/i18n/ca.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# Carles Antoli , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-13 23:06+0000\n" +"PO-Revision-Date: 2022-03-21 13:17+0000\n" +"Last-Translator: Noel estudillo \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" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "Comandes al punt de venda" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Compte analític" + +#~ msgid "Analytic Account for this config." +#~ msgstr "Compte analític per a aquesta configuració." + +#~ msgid "Analytic Account that these orders link to" +#~ msgstr "Compte analític al qual enllacen aquestes comandes" + +#~ msgid "Point of Sale Configuration" +#~ msgstr "Configuració del punt de venda" + +#~ msgid "Invoice Line" +#~ msgstr "Línia de factura" diff --git a/pos_analytic_by_config/i18n/de.po b/pos_analytic_by_config/i18n/de.po new file mode 100644 index 0000000000..5bfa481456 --- /dev/null +++ b/pos_analytic_by_config/i18n/de.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# Rudolf Schnapka , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-20 23:05+0000\n" +"PO-Revision-Date: 2017-01-20 23:05+0000\n" +"Last-Translator: Rudolf Schnapka , 2017\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" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Kostenstelle" diff --git a/pos_analytic_by_config/i18n/el_GR.po b/pos_analytic_by_config/i18n/el_GR.po new file mode 100644 index 0000000000..070499e8c2 --- /dev/null +++ b/pos_analytic_by_config/i18n/el_GR.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# Kostas Goutoudis , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-30 22:27+0000\n" +"PO-Revision-Date: 2016-09-30 22:27+0000\n" +"Last-Translator: Kostas Goutoudis , 2016\n" +"Language-Team: Greek (Greece) (https://www.transifex.com/oca/teams/23907/" +"el_GR/)\n" +"Language: el_GR\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" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Αναλυτικός Λογαριασμός" diff --git a/pos_analytic_by_config/i18n/es.po b/pos_analytic_by_config/i18n/es.po new file mode 100644 index 0000000000..90753fca4d --- /dev/null +++ b/pos_analytic_by_config/i18n/es.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 17:04+0000\n" +"PO-Revision-Date: 2024-03-18 00:59+0000\n" +"Last-Translator: Ivorra78 \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 4.17\n" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "Modelo Analítico de Distribución" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "Pedidos en el punto de venta" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "Sesión del Puto de Venta" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "Configuración de posición" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" +"Seleccione un punto de venta para el que se utilizará la distribución " +"analítica" + +#~ msgid "Analytic Account" +#~ msgstr "Cuenta analítica" + +#~ msgid "Analytic Account for this config." +#~ msgstr "Cuenta analítica para esta configuración." + +#~ msgid "Analytic Account that these orders link to" +#~ msgstr "Cuenta analítica relacionada con estos pedidos" + +#~ msgid "Journal Item" +#~ msgstr "Artículo Diario" + +#~ msgid "Point of Sale Configuration" +#~ msgstr "Configuración del Punto de Venta" + +#~ msgid "Invoice Line" +#~ msgstr "Línea de Factura" diff --git a/pos_analytic_by_config/i18n/es_MX.po b/pos_analytic_by_config/i18n/es_MX.po new file mode 100644 index 0000000000..f2026d8b30 --- /dev/null +++ b/pos_analytic_by_config/i18n/es_MX.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# Juan González , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-12-03 13:34+0000\n" +"PO-Revision-Date: 2016-12-03 13:34+0000\n" +"Last-Translator: Juan González , 2016\n" +"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/" +"es_MX/)\n" +"Language: es_MX\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" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Cuenta analítica" diff --git a/pos_analytic_by_config/i18n/fi.po b/pos_analytic_by_config/i18n/fi.po new file mode 100644 index 0000000000..b2d70e1117 --- /dev/null +++ b/pos_analytic_by_config/i18n/fi.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-06 02:55+0000\n" +"PO-Revision-Date: 2017-04-06 02:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\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" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Analyyttinen tili" diff --git a/pos_analytic_by_config/i18n/fr.po b/pos_analytic_by_config/i18n/fr.po new file mode 100644 index 0000000000..97743b4995 --- /dev/null +++ b/pos_analytic_by_config/i18n/fr.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# OCA Transbot , 2016 +# Zwygart , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-30 22:27+0000\n" +"PO-Revision-Date: 2016-09-30 22:27+0000\n" +"Last-Translator: Zwygart , 2016\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" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Compte analytique" diff --git a/pos_analytic_by_config/i18n/it.po b/pos_analytic_by_config/i18n/it.po new file mode 100644 index 0000000000..cca7dc96df --- /dev/null +++ b/pos_analytic_by_config/i18n/it.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-03-04 10:36+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: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "Modello distribuzione analitica" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "Ordini punto vendita" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "Sessione punto vendita" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "Configurazione POS" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "" +"Select a Point of Sale for which the analytic distribution will be used" +msgstr "" +"Selezionare un Punto vendita per il quale verrà usata la distribuzione " +"analitica" diff --git a/pos_analytic_by_config/i18n/pos_analytic_by_config.pot b/pos_analytic_by_config/i18n/pos_analytic_by_config.pot new file mode 100644 index 0000000000..f6f97b9fcc --- /dev/null +++ b/pos_analytic_by_config/i18n/pos_analytic_by_config.pot @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +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: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "" +"Select a Point of Sale for which the analytic distribution will be used" +msgstr "" diff --git a/pos_analytic_by_config/i18n/pt_BR.po b/pos_analytic_by_config/i18n/pt_BR.po new file mode 100644 index 0000000000..c92906132e --- /dev/null +++ b/pos_analytic_by_config/i18n/pt_BR.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-06 02:55+0000\n" +"PO-Revision-Date: 2022-10-31 20:44+0000\n" +"Last-Translator: Douglas Custódio \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" +"X-Generator: Weblate 4.14.1\n" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "Pedido do Ponto de Venda" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Conta analítica" + +#~ msgid "Analytic Account for this config." +#~ msgstr "Conta Analítica para essa config." + +#~ msgid "Analytic Account that these orders link to" +#~ msgstr "Conta analítica que essas ordem estão vinculadas" + +#~ msgid "Point of Sale Configuration" +#~ msgstr "Configuração do Ponto de Venda" + +#~ msgid "Invoice Line" +#~ msgstr "Linha da Fatura" diff --git a/pos_analytic_by_config/i18n/sk_SK.po b/pos_analytic_by_config/i18n/sk_SK.po new file mode 100644 index 0000000000..d9bc99d88b --- /dev/null +++ b/pos_analytic_by_config/i18n/sk_SK.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-06 02:55+0000\n" +"PO-Revision-Date: 2017-04-06 02:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovak (Slovakia) (https://www.transifex.com/oca/teams/23907/" +"sk_SK/)\n" +"Language: sk_SK\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Analytický účet" diff --git a/pos_analytic_by_config/i18n/sl.po b/pos_analytic_by_config/i18n/sl.po new file mode 100644 index 0000000000..6a06474fa3 --- /dev/null +++ b/pos_analytic_by_config/i18n/sl.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# Matjaž Mozetič , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-30 09:13+0000\n" +"PO-Revision-Date: 2016-07-30 09:13+0000\n" +"Last-Translator: Matjaž Mozetič , 2016\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Analitični konto" diff --git a/pos_analytic_by_config/i18n/zh_CN.po b/pos_analytic_by_config/i18n/zh_CN.po new file mode 100644 index 0000000000..c53ed31328 --- /dev/null +++ b/pos_analytic_by_config/i18n/zh_CN.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_analytic_by_config +# +# Translators: +# ITGeeker , 2017 +# liAnGjiA , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-06 02:55+0000\n" +"PO-Revision-Date: 2017-04-06 02:55+0000\n" +"Last-Translator: liAnGjiA , 2017\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_account_analytic_distribution_model +msgid "Analytic Distribution Model" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model,name:pos_analytic_by_config.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,field_description:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Pos Config" +msgstr "" + +#. module: pos_analytic_by_config +#: model:ir.model.fields,help:pos_analytic_by_config.field_account_analytic_distribution_model__pos_config_id +msgid "Select a Point of Sale for which the analytic distribution will be used" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "核算科目" diff --git a/pos_analytic_by_config/models/__init__.py b/pos_analytic_by_config/models/__init__.py new file mode 100644 index 0000000000..47284c73ce --- /dev/null +++ b/pos_analytic_by_config/models/__init__.py @@ -0,0 +1,3 @@ +from . import analytic_distribution_model +from . import pos_order +from . import pos_session diff --git a/pos_analytic_by_config/models/analytic_distribution_model.py b/pos_analytic_by_config/models/analytic_distribution_model.py new file mode 100644 index 0000000000..42b0079e1f --- /dev/null +++ b/pos_analytic_by_config/models/analytic_distribution_model.py @@ -0,0 +1,21 @@ +# Copyright 2020 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import fields, models + + +class AccountAnalyticDistributionModel(models.Model): + _inherit = "account.analytic.distribution.model" + + pos_config_id = fields.Many2one( + comodel_name="pos.config", + ondelete="cascade", + help="Select a Point of Sale for which the analytic distribution will be used", + ) + + def _get_distribution(self, vals): + vals = vals.copy() + pos_config_id = self.env.context.get("pos_config_id") + if pos_config_id: + vals["pos_config_id"] = pos_config_id + res = super()._get_distribution(vals) + return res diff --git a/pos_analytic_by_config/models/pos_order.py b/pos_analytic_by_config/models/pos_order.py new file mode 100644 index 0000000000..5d19691709 --- /dev/null +++ b/pos_analytic_by_config/models/pos_order.py @@ -0,0 +1,12 @@ +# Copyright 2015 ACSONE SA/NV +# Copyright 2020 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class PosOrder(models.Model): + _inherit = "pos.order" + + def _generate_pos_order_invoice(self): + self = self.with_context(pos_config_id=self.config_id.id) + return super()._generate_pos_order_invoice() diff --git a/pos_analytic_by_config/models/pos_session.py b/pos_analytic_by_config/models/pos_session.py new file mode 100644 index 0000000000..91a65252d6 --- /dev/null +++ b/pos_analytic_by_config/models/pos_session.py @@ -0,0 +1,21 @@ +# Copyright 2021 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class PosSession(models.Model): + _inherit = "pos.session" + + def _validate_session( + self, + balancing_account=False, + amount_to_balance=0, + bank_payment_method_diffs=None, + ): + return super( + PosSession, self.with_context(pos_config_id=self.config_id.id) + )._validate_session( + balancing_account=balancing_account, + amount_to_balance=amount_to_balance, + bank_payment_method_diffs=bank_payment_method_diffs, + ) diff --git a/pos_analytic_by_config/pyproject.toml b/pos_analytic_by_config/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_analytic_by_config/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_analytic_by_config/readme/CONFIGURE.md b/pos_analytic_by_config/readme/CONFIGURE.md new file mode 100644 index 0000000000..b2a4520990 --- /dev/null +++ b/pos_analytic_by_config/readme/CONFIGURE.md @@ -0,0 +1,7 @@ +To configure the analytic distributions by store: + +1. Go to *Invoicing \> Configuration \> Analytic Distribution Models* +2. We'll create one for every pos config. +3. Select an account prefix (Normally your incoming account prefix) +4. Select a PoS config (unhide it from the optionl fields). +5. Choose your desired distribution for that store. diff --git a/pos_analytic_by_config/readme/CONTRIBUTORS.md b/pos_analytic_by_config/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..463601d1e1 --- /dev/null +++ b/pos_analytic_by_config/readme/CONTRIBUTORS.md @@ -0,0 +1,8 @@ +- [ACSONE SA/NV](https://www.acsone.eu) + - Adrien Peiffer \<\> + - Cédric Pigeon \<\> + - Xavier Bouquiaux \<\> +- [Tecnativa](https://www.tecnativa.com) + - David Vidal +- [APSL-Nagarro](https://www.apsl.tech) + - Antoni Marroig \<\> diff --git a/pos_analytic_by_config/readme/DESCRIPTION.md b/pos_analytic_by_config/readme/DESCRIPTION.md new file mode 100644 index 0000000000..9a1df0dc64 --- /dev/null +++ b/pos_analytic_by_config/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows to generate analytic distributions from the PoS +orders. diff --git a/pos_analytic_by_config/readme/ROADMAP.md b/pos_analytic_by_config/readme/ROADMAP.md new file mode 100644 index 0000000000..5d364aadab --- /dev/null +++ b/pos_analytic_by_config/readme/ROADMAP.md @@ -0,0 +1,5 @@ +- Add `account_analytic_id` in `pos.order` so we can use it in reports. +- In `13.0` the session reconciliation has been refactored and thus the + journal items are now very simplified. There's no product detail now, + so we won't be able to analyze that level of detail anymore. For + invoices it remains as it was. diff --git a/pos_analytic_by_config/readme/USAGE.md b/pos_analytic_by_config/readme/USAGE.md new file mode 100644 index 0000000000..d3fb8e9bdb --- /dev/null +++ b/pos_analytic_by_config/readme/USAGE.md @@ -0,0 +1,2 @@ +When you reconcile your sessions, the analytic distribution should go as +expected for your point of sale. diff --git a/pos_analytic_by_config/static/description/icon.png b/pos_analytic_by_config/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_analytic_by_config/static/description/icon.png differ diff --git a/pos_analytic_by_config/static/description/index.html b/pos_analytic_by_config/static/description/index.html new file mode 100644 index 0000000000..2756ddf85c --- /dev/null +++ b/pos_analytic_by_config/static/description/index.html @@ -0,0 +1,469 @@ + + + + + + +POS Analytic Config + + + +
+

POS Analytic Config

+ + +

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

+

This module allows to generate analytic distributions from the PoS +orders.

+

Table of contents

+ +
+

Configuration

+

To configure the analytic distributions by store:

+
    +
  1. Go to Invoicing > Configuration > Analytic Distribution Models
  2. +
  3. We’ll create one for every pos config.
  4. +
  5. Select an account prefix (Normally your incoming account prefix)
  6. +
  7. Select a PoS config (unhide it from the optionl fields).
  8. +
  9. Choose your desired distribution for that store.
  10. +
+
+
+

Usage

+

When you reconcile your sessions, the analytic distribution should go as +expected for your point of sale.

+
+
+

Known issues / Roadmap

+
    +
  • Add account_analytic_id in pos.order so we can use it in +reports.
  • +
  • In 13.0 the session reconciliation has been refactored and thus +the journal items are now very simplified. There’s no product detail +now, so we won’t be able to analyze that level of detail anymore. For +invoices it remains as it was.
  • +
+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
  • Tecnativa
  • +
+
+
+

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/pos_analytic_by_config/tests/__init__.py b/pos_analytic_by_config/tests/__init__.py new file mode 100644 index 0000000000..c2cfede05e --- /dev/null +++ b/pos_analytic_by_config/tests/__init__.py @@ -0,0 +1 @@ +from . import test_pos_analytic_by_config diff --git a/pos_analytic_by_config/tests/test_pos_analytic_by_config.py b/pos_analytic_by_config/tests/test_pos_analytic_by_config.py new file mode 100644 index 0000000000..339513f858 --- /dev/null +++ b/pos_analytic_by_config/tests/test_pos_analytic_by_config.py @@ -0,0 +1,84 @@ +# Copyright 2015 ACSONE SA/NV +# Copyright 2024 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo.tests import tagged + +from odoo.addons.point_of_sale.tests.common import TestPointOfSaleCommon, TestPoSCommon + + +@tagged("post_install", "-at_install") +class TestPosAnalyticConfig(TestPointOfSaleCommon, TestPoSCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env.user.groups_id += cls.env.ref("analytic.group_analytic_accounting") + cls.analytic_plan = cls.env["account.analytic.plan"].create( + { + "name": "Stores", + } + ) + cls.env["account.analytic.applicability"].create( + { + "business_domain": "general", + "analytic_plan_id": cls.analytic_plan.id, + "applicability": "mandatory", + } + ) + cls.analytic_account = cls.env["account.analytic.account"].create( + { + "name": "Test Analytic Account", + "plan_id": cls.analytic_plan.id, + } + ) + cls.env["account.analytic.distribution.model"].create( + { + "account_prefix": cls.sales_account.code, + "pos_config_id": cls.basic_config.id, + "analytic_distribution": {cls.analytic_account.id: 100}, + } + ) + cls.config = cls.basic_config + # Set the cash payment method to False for split transactions + cls.config.payment_method_ids.filtered_domain( + [("type", "=", "cash")] + ).split_transactions = False + cls.session = cls.open_new_session(cls) + + def _create_order(self): + order_data = self.create_ui_order_data([(self.product_a, 1)]) + order = self.env["pos.order"].create_from_ui([order_data]) + self.pos_order = self.env["pos.order"].browse(order[0]["id"]) + + def _close_session(self, amount_paid): + self.session.post_closing_cash_details(amount_paid) + self.session.close_session_from_ui() + + def test_order_simple_receipt(self): + """Simple tickets are grouped by account in single move lines""" + self._create_order() + aml_domain = [ + ("account_id", "=", self.sales_account.id), + ("analytic_distribution", "=", {f"{self.analytic_account.id}": 100.0}), + ] + # There aren't lines with the analytic account yet + self.assertFalse(self.env["account.move.line"].search(aml_domain)) + self._close_session(self.pos_order.amount_total) + # There they are + self.assertEqual(len(self.env["account.move.line"].search(aml_domain)), 1) + + def test_order_invoice(self): + """Tickets with invoice are posted prior to session reconcilation""" + self._create_order() + self.pos_order.partner_id = self.partner_a + aml_domain = [ + ("account_id", "=", self.sales_account.id), + ("product_id", "=", self.product_a.id), + ("analytic_distribution", "=", {f"{self.analytic_account.id}": 100.0}), + ] + lines = self.env["account.move.line"].search(aml_domain) + # There aren't lines with the analytic account yet + self.assertEqual(len(lines), 0) + self.pos_order.action_pos_order_invoice() + lines = self.env["account.move.line"].search(aml_domain) + # There they are + self.assertEqual(len(lines), 1) diff --git a/pos_analytic_by_config/views/account_analytic_distribution_model_views.xml b/pos_analytic_by_config/views/account_analytic_distribution_model_views.xml new file mode 100644 index 0000000000..f0b2da82d9 --- /dev/null +++ b/pos_analytic_by_config/views/account_analytic_distribution_model_views.xml @@ -0,0 +1,15 @@ + + + + account.analytic.distribution.model + + + + + + + +