diff --git a/README.md b/README.md index bc04a7df1f8..c2269e2f8c7 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ addon | version | maintainers | summary [account_move_line_partner_country](account_move_line_partner_country/) | 12.0.1.0.0 | [![alexey-pelykh](https://github.com/alexey-pelykh.png?size=30px)](https://github.com/alexey-pelykh) | Show Partner's Country on Account Move Line. [account_move_line_purchase_info](account_move_line_purchase_info/) | 12.0.2.0.0 | | Introduces the purchase order line to the journal items [account_move_line_tax_editable](account_move_line_tax_editable/) | 12.0.1.1.0 | | Allows to edit taxes on non-posted account move lines +[account_move_post_date_user](account_move_post_date_user/) | 12.0.1.0.0 | [![JordiMForgeFlow](https://github.com/JordiMForgeFlow.png?size=30px)](https://github.com/JordiMForgeFlow) | Trace journal entry posting date and user. [account_move_template](account_move_template/) | 12.0.1.1.0 | | Templates for recurring Journal Entries [account_netting](account_netting/) | 12.0.1.0.0 | | Compensate AR/AP accounts from the same partner [account_partner_required](account_partner_required/) | 12.0.1.0.0 | | Adds an option 'partner policy' on account types diff --git a/account_lock_to_date/i18n/it.po b/account_lock_to_date/i18n/it.po index d5724c25c3e..1be4253cb77 100644 --- a/account_lock_to_date/i18n/it.po +++ b/account_lock_to_date/i18n/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-02-23 14:40+0000\n" +"PO-Revision-Date: 2024-11-18 19:06+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" @@ -14,7 +14,7 @@ msgstr "" "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" +"X-Generator: Weblate 5.6.2\n" #. module: account_lock_to_date #: model:ir.model,name:account_lock_to_date.model_account_update_lock_to_date @@ -80,7 +80,7 @@ msgstr "Ultimo aggiornamento il" #: model:ir.model.fields,field_description:account_lock_to_date.field_account_update_lock_to_date__fiscalyear_lock_to_date #: model:ir.model.fields,field_description:account_lock_to_date.field_res_company__fiscalyear_lock_to_date msgid "Lock To Date" -msgstr "Blocca alla data futura" +msgstr "Blocca alla data" #. module: account_lock_to_date #: model:ir.model.fields,field_description:account_lock_to_date.field_account_update_lock_to_date__period_lock_to_date @@ -94,8 +94,8 @@ msgid "" "No users, including Advisers, can edit accounts after and inclusive of this " "date. Use it for fiscal year locking for example." msgstr "" -"Nessun utente, inclusi i Consulenti, può modificare i movimenti contabili " -"dopo, e incluso, questa data. Usarla per bloccare gli anni fiscali, per " +"Nessun utente, inclusi i consulenti, può modificare i movimenti contabili " +"dopo, e inclusa, questa data. Usarla per bloccare gli anni fiscali, per " "esempio." #. module: account_lock_to_date @@ -104,7 +104,7 @@ msgid "" "No users, including Advisers, can edit accounts after this date. Use it for " "fiscal year locking for example." msgstr "" -"Nessun utente, inclusi i Consulenti, può modificare i movimenti contabili " +"Nessun utente, inclusi i consulenti, può modificare i movimenti contabili " "dopo questa data. Usarla per bloccare gli anni fiscali, per esempio." #. module: account_lock_to_date @@ -132,7 +132,7 @@ msgstr "" #, python-format msgid "The lock date for advisors is irreversible and can't be removed." msgstr "" -"La data di blocco per i Consulenti è immodificabile e non può essere rimossa." +"La data di blocco per i consulenti è immodificabile e non può essere rimossa." #. module: account_lock_to_date #: code:addons/account_lock_to_date/models/res_company.py:65 @@ -151,8 +151,8 @@ msgid "" "There are still unposted entries in the period to date you want to lock. You " "should either post or delete them." msgstr "" -"Ci sono ancora movimenti non confermati nel periodo in cui vuoi bloccare la " -"data. Dovresti confermarli oppure eliminarli." +"Ci sono ancora movimenti non confermati nel periodo in cui si vuole bloccare " +"la data. Si dovrebbe confermarli oppure eliminarli." #. module: account_lock_to_date #: model_terms:ir.ui.view,arch_db:account_lock_to_date.account_update_lock_to_date_form_view diff --git a/account_move_post_date_user/README.rst b/account_move_post_date_user/README.rst new file mode 100644 index 00000000000..6dcce6d13d7 --- /dev/null +++ b/account_move_post_date_user/README.rst @@ -0,0 +1,88 @@ +=========================== +Account Move Post Date User +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:6ca1e274956149a6946165264dcb0c3d379d4c16f369b386beb59eb07ff9b2f2 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github + :target: https://github.com/OCA/account-financial-tools/tree/12.0/account_move_post_date_user + :alt: OCA/account-financial-tools +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-financial-tools-12-0/account-financial-tools-12-0-account_move_post_date_user + :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-financial-tools&target_branch=12.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module stores the date when a journal entry is posted and the user that +posted it. + +**Table of contents** + +.. contents:: + :local: + +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 +~~~~~~~ + +* ForgeFlow S.L. + +Contributors +~~~~~~~~~~~~ + +* `ForgeFlow S.L. `__: + + * Jordi Masvidal + * Guillem Casassas + +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. + +.. |maintainer-JordiMForgeFlow| image:: https://github.com/JordiMForgeFlow.png?size=40px + :target: https://github.com/JordiMForgeFlow + :alt: JordiMForgeFlow + +Current `maintainer `__: + +|maintainer-JordiMForgeFlow| + +This module is part of the `OCA/account-financial-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_move_post_date_user/__init__.py b/account_move_post_date_user/__init__.py new file mode 100644 index 00000000000..2bc1433e720 --- /dev/null +++ b/account_move_post_date_user/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from . import models diff --git a/account_move_post_date_user/__manifest__.py b/account_move_post_date_user/__manifest__.py new file mode 100644 index 00000000000..7f22f9c954b --- /dev/null +++ b/account_move_post_date_user/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2024 ForgeFlow S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Account Move Post Date User", + "summary": "Trace journal entry posting date and user.", + "version": "12.0.1.0.0", + "category": "Accounting", + "website": "https://github.com/OCA/account-financial-tools", + "author": "ForgeFlow S.L., Odoo Community Association (OCA)", + "maintainers": ["JordiMForgeFlow"], + "license": "LGPL-3", + "depends": ["account"], + "data": ["views/account_move.xml"], +} diff --git a/account_move_post_date_user/i18n/account_move_post_date_user.pot b/account_move_post_date_user/i18n/account_move_post_date_user.pot new file mode 100644 index 00000000000..451924347d0 --- /dev/null +++ b/account_move_post_date_user/i18n/account_move_post_date_user.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_move_post_date_user +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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_move_post_date_user +#: model:ir.model,name:account_move_post_date_user.model_account_move +msgid "Journal Entries" +msgstr "" + +#. module: account_move_post_date_user +#: model:ir.model.fields,field_description:account_move_post_date_user.field_account_move__last_post_uid +msgid "Last Posted by" +msgstr "" + +#. module: account_move_post_date_user +#: model:ir.model.fields,field_description:account_move_post_date_user.field_account_move__last_post_date +msgid "Last Posted on" +msgstr "" + diff --git a/account_move_post_date_user/i18n/it.po b/account_move_post_date_user/i18n/it.po new file mode 100644 index 00000000000..8e2df3098b5 --- /dev/null +++ b/account_move_post_date_user/i18n/it.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_move_post_date_user +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-03-13 12:38+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_move_post_date_user +#: model:ir.model,name:account_move_post_date_user.model_account_move +msgid "Journal Entries" +msgstr "" + +#. module: account_move_post_date_user +#: model:ir.model.fields,field_description:account_move_post_date_user.field_account_move__last_post_uid +msgid "Last Posted by" +msgstr "Ultimo invio di" + +#. module: account_move_post_date_user +#: model:ir.model.fields,field_description:account_move_post_date_user.field_account_move__last_post_date +msgid "Last Posted on" +msgstr "Ultimo invio il" + +#~ msgid "Journal Entry" +#~ msgstr "Registrazione contabile" diff --git a/account_move_post_date_user/models/__init__.py b/account_move_post_date_user/models/__init__.py new file mode 100644 index 00000000000..1612c874422 --- /dev/null +++ b/account_move_post_date_user/models/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import account_move diff --git a/account_move_post_date_user/models/account_move.py b/account_move_post_date_user/models/account_move.py new file mode 100644 index 00000000000..562c11678bb --- /dev/null +++ b/account_move_post_date_user/models/account_move.py @@ -0,0 +1,25 @@ +# Copyright 2024 ForgeFlow S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + last_post_date = fields.Datetime( + string="Last Posted on", readonly=True, tracking=True + ) + last_post_uid = fields.Many2one( + "res.users", string="Last Posted by", readonly=True, tracking=True + ) + + def post(self, invoice=False): + res = super().post(invoice=invoice) + self.write( + { + "last_post_date": fields.Datetime.now(), + "last_post_uid": self.env.user.id, + } + ) + return res diff --git a/account_move_post_date_user/readme/CONTRIBUTORS.rst b/account_move_post_date_user/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..d4ab9295398 --- /dev/null +++ b/account_move_post_date_user/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `ForgeFlow S.L. `__: + + * Jordi Masvidal + * Guillem Casassas diff --git a/account_move_post_date_user/readme/DESCRIPTION.rst b/account_move_post_date_user/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..e2306709ce1 --- /dev/null +++ b/account_move_post_date_user/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module stores the date when a journal entry is posted and the user that +posted it. diff --git a/account_move_post_date_user/static/description/icon.png b/account_move_post_date_user/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/account_move_post_date_user/static/description/icon.png differ diff --git a/account_move_post_date_user/static/description/index.html b/account_move_post_date_user/static/description/index.html new file mode 100644 index 00000000000..93f0299fb91 --- /dev/null +++ b/account_move_post_date_user/static/description/index.html @@ -0,0 +1,430 @@ + + + + + +Account Move Post Date User + + + +
+

Account Move Post Date User

+ + +

Beta License: LGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runboat

+

This module stores the date when a journal entry is posted and the user that +posted it.

+

Table of contents

+ +
+

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

+
    +
  • ForgeFlow S.L.
  • +
+
+ +
+

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.

+

Current maintainer:

+

JordiMForgeFlow

+

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

+

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

+
+
+
+ + diff --git a/account_move_post_date_user/tests/__init__.py b/account_move_post_date_user/tests/__init__.py new file mode 100644 index 00000000000..6f33e48aa3c --- /dev/null +++ b/account_move_post_date_user/tests/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_account_move_post_date_user diff --git a/account_move_post_date_user/tests/test_account_move_post_date_user.py b/account_move_post_date_user/tests/test_account_move_post_date_user.py new file mode 100644 index 00000000000..f68038208bd --- /dev/null +++ b/account_move_post_date_user/tests/test_account_move_post_date_user.py @@ -0,0 +1,71 @@ +# Copyright 2024 ForgeFlow S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields +from odoo.tests import tagged +from odoo.addons.account.tests.account_test_classes import AccountingTestCase + + +@tagged("post_install", "-at_install") +class TestAccountMovePostDateUser(AccountingTestCase): + def setUp(self): + super(TestAccountMovePostDateUser, self).setUp() + self.account_move_obj = self.env["account.move"] + self.partner = self.browse_ref("base.res_partner_12") + self.user_type_revenue = self.env.ref('account.data_account_type_revenue') + self.account = self.env['account.account'].create({ + 'code': 'NC1114', + 'name': 'Revenue Account', + 'user_type_id': self.user_type_revenue.id, + 'reconcile': True + }) + self.account2 = self.account_expense = self.env['account.account'].search([ + ('user_type_id', '=', self.env.ref( + 'account.data_account_type_expenses').id) + ], limit=1) + self.bank = self.env['res.partner.bank'].create({ + 'acc_number': '123456', + 'partner_id': self.env.ref('base.main_partner').id, + 'company_id': self.env.ref('base.main_company').id, + 'bank_id': self.env.ref('base.res_bank_1').id, + }) + self.journal = self.env['account.journal'].create({ + 'name': 'Bank Journal TEST OFX', + 'code': 'BNK12', + 'type': 'bank', + 'bank_account_id': self.bank.id, + }) + + # create a move and post it + self.move = self.account_move_obj.create( + { + "date": fields.Date.today(), + "journal_id": self.journal.id, + "line_ids": [ + ( + 0, + 0, + { + "account_id": self.account.id, + "credit": 1000.0, + "name": "Credit line", + }, + ), + ( + 0, + 0, + { + "account_id": self.account2.id, + "debit": 1000.0, + "name": "Debit line", + }, + ), + ], + } + ) + + def test_account_move_post_date_user(self): + self.move.action_post() + self.assertEqual(self.move.state, "posted") + self.assertEqual(self.move.last_post_date.date(), fields.Date.today()) + self.assertEqual(self.move.last_post_uid, self.env.user) diff --git a/account_move_post_date_user/views/account_move.xml b/account_move_post_date_user/views/account_move.xml new file mode 100644 index 00000000000..2f5d37bc123 --- /dev/null +++ b/account_move_post_date_user/views/account_move.xml @@ -0,0 +1,14 @@ + + + + account.move.form - account_move_post_date_user + account.move + + + + + + + + + diff --git a/setup/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt index 63be355ab4d..ba3d1ff24fe 100644 --- a/setup/_metapackage/VERSION.txt +++ b/setup/_metapackage/VERSION.txt @@ -1 +1 @@ -12.0.20211204.0 \ No newline at end of file +12.0.20241118.0 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index 602ae69ad7d..0f2ebd69a4e 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -40,6 +40,7 @@ 'odoo12-addon-account_move_line_partner_country', 'odoo12-addon-account_move_line_purchase_info', 'odoo12-addon-account_move_line_tax_editable', + 'odoo12-addon-account_move_post_date_user', 'odoo12-addon-account_move_template', 'odoo12-addon-account_netting', 'odoo12-addon-account_partner_required', diff --git a/setup/account_move_post_date_user/odoo/addons/account_move_post_date_user b/setup/account_move_post_date_user/odoo/addons/account_move_post_date_user new file mode 120000 index 00000000000..d851a4986f2 --- /dev/null +++ b/setup/account_move_post_date_user/odoo/addons/account_move_post_date_user @@ -0,0 +1 @@ +../../../../account_move_post_date_user \ No newline at end of file diff --git a/setup/account_move_post_date_user/setup.py b/setup/account_move_post_date_user/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/account_move_post_date_user/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)