Initial commit: Odoo 18.0-20251222 extra-addons
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1,148 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association
====================================
General sequence in account journals
====================================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ebbf67cd950dbf83980c1c355f4298865c64e2ceded9112377e39e1f0c0d105f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/license-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/18.0/account_journal_general_sequence
: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-18-0/account-financial-tools-18-0-account_journal_general_sequence
: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=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module extends the functionality of account to support sequenced
entry numbers and to allow you to renumber them if needed, on demand.
It adds a new field called *Entry number*. This is independent from the
*Number* that Odoo adds by default, and has different purpose.
**Table of contents**
.. contents::
:local:
Installation
============
After installing this module, no entry numbers will be generated because
that could have a very negative impact in installations that already had
a lot of account moves.
If you need to add numbers to preexisting account moves, please use the
renumbering wizard as explained in the *Usage* section.
Configuration
=============
To configure journal sequences:
1. Have full accounting permissions.
2. Go to *Invoicing > Configuration > Accounting > Journals*.
3. Select or create the journal you want to configure.
4. Use *Account entry number sequence* to configure a sequence.
Note that:
- Various journals can share the same sequence.
- All journals get a shared default sequence, per company.
- Entry numbers must be unique per company. So, if you use different
sequences per journal, make sure they don't produce colliding results.
Usage
=====
To see journal entry numbers:
1. Go to *Invoicing > Accounting > Miscellaneous > Journal Entries*.
2. Notice the new field *Entry Number*. Only posted moves get an entry
number.
Note that:
- You can use that new field in quick searches.
- You can see it also in *Invoicing > Accounting > Miscellaneous >
Journal Items*.
To renumber journal entries:
1. Have full accounting permissions.
2. Have *Accounting / Invoicing / Billing Administrator* permissions.
3. Go to *Invoicing > Accounting > Actions > Renumber journal entries*.
4. Configure those parameters.
5. Click on *Renumber*.
Note that:
- You will only be able to select sequences related to journals.
- A sequence usually affects various journals, if not all.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/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 <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_journal_general_sequence%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
-------
* Moduon
Contributors
------------
- Jairo Llopis (`Moduon <https://www.moduon.team/>`__)
- Rafael Blasco (`Moduon <https://www.moduon.team/>`__)
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-yajo| image:: https://github.com/yajo.png?size=40px
:target: https://github.com/yajo
:alt: yajo
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-yajo|
This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/18.0/account_journal_general_sequence>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -0,0 +1,2 @@
from . import models
from . import wizards

View File

@@ -0,0 +1,23 @@
# Copyright 2022 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": "General sequence in account journals",
"summary": "Add configurable sequence to account moves, per journal",
"version": "18.0.1.0.1",
"category": "Accounting/Accounting",
"website": "https://github.com/OCA/account-financial-tools",
"author": "Moduon, Odoo Community Association (OCA)",
"license": "LGPL-3",
"external_dependencies": {"python": ["freezegun"]},
"maintainers": ["yajo"],
"depends": [
"account",
],
"data": [
"security/ir.model.access.csv",
"views/account_journal.xml",
"views/account_move_line.xml",
"views/account_move.xml",
"wizards/account_move_renumber_wizard_views.xml",
],
}

View File

@@ -0,0 +1,175 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_journal_general_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.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_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/models/account_journal.py:0
msgid "Account entry default numbering (%s)"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Account entry number sequence"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_renumber_wizard
msgid "Account move entry renumbering wizard"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_line__entry_number
msgid "Automatic numbering, based on journal configuration."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__available_sequence_ids
msgid "Available sequences"
msgstr ""
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Cancel"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_uid
msgid "Created by"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_date
msgid "Created on"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__display_name
msgid "Display Name"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_line__entry_number
msgid "Entry Number"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.constraint,message:account_journal_general_sequence.constraint_account_move_entry_number_unique
msgid "Entry number must be unique per journal."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__id
msgid "ID"
msgstr ""
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid ""
"If you have already filed and legalized your journals with the competent "
"authority, this action could change it. Continue?"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_journal
msgid "Journal"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move
msgid "Journal Entry"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_uid
msgid "Last Updated by"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_date
msgid "Last Updated on"
msgstr ""
#. module: account_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/wizards/account_move_renumber_wizard.py:0
msgid "No account moves found."
msgstr ""
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber"
msgstr ""
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber account entry numbers"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Renumber account moves starting this day."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.actions.act_window,name:account_journal_general_sequence.account_move_renumber_wizard_action
#: model:ir.ui.menu,name:account_journal_general_sequence.account_move_renumber_wizard_menu
msgid "Renumber journal entries"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Reset sequence to this number before starting."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid "Sequence"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id_name
msgid "Sequence Code"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid ""
"Sequence to use for renumbering. Affects all journals that use this "
"sequence."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Sequence used for account entry numbering."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Starting Date"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Starting Number"
msgstr ""

View File

@@ -0,0 +1,185 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_journal_general_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ca_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"
#. module: account_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/models/account_journal.py:0
#, python-format
msgid "Account entry default numbering (%s)"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Account entry number sequence"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_renumber_wizard
msgid "Account move entry renumbering wizard"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_line__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_payment__entry_number
msgid "Automatic numbering, based on journal configuration."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__available_sequence_ids
msgid "Available sequences"
msgstr ""
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Cancel"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_uid
msgid "Created by"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_date
msgid "Created on"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__display_name
msgid "Display Name"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_line__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_payment__entry_number
msgid "Entry Number"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.constraint,message:account_journal_general_sequence.constraint_account_move_entry_number_unique
msgid "Entry number must be unique per journal."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__id
msgid "ID"
msgstr ""
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid ""
"If you have already filed and legalized your journals with the competent "
"authority, this action could change it. Continue?"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_journal
msgid "Journal"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move
msgid "Journal Entry"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard____last_update
msgid "Last Modified on"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_uid
msgid "Last Updated by"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_date
msgid "Last Updated on"
msgstr ""
#. module: account_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/wizards/account_move_renumber_wizard.py:0
#, python-format
msgid "No account moves found."
msgstr ""
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber"
msgstr ""
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber account entry numbers"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Renumber account moves starting this day."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.actions.act_window,name:account_journal_general_sequence.account_move_renumber_wizard_action
#: model:ir.ui.menu,name:account_journal_general_sequence.account_move_renumber_wizard_menu
msgid "Renumber journal entries"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Reset sequence to this number before starting."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid "Sequence"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id_name
msgid "Sequence Code"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid ""
"Sequence to use for renumbering. Affects all journals that use this "
"sequence."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Sequence used for account entry numbering."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Starting Date"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Starting Number"
msgstr ""

View File

@@ -0,0 +1,195 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_move_numbered
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-27 08:32+0000\n"
"PO-Revision-Date: 2023-07-28 21:10+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
#. module: account_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/models/account_journal.py:0
#, python-format
msgid "Account entry default numbering (%s)"
msgstr "Numeración por defecto de la entrada contable (%s)"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Account entry number sequence"
msgstr "Secuencia para numerar los asientos"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_renumber_wizard
msgid "Account move entry renumbering wizard"
msgstr "Asistente para renumerar asientos contables"
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_line__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_payment__entry_number
msgid "Automatic numbering, based on journal configuration."
msgstr "Numeración automática, basada en la configuración por diario."
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__available_sequence_ids
msgid "Available sequences"
msgstr "Secuencias disponibles"
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Cancel"
msgstr "Cancelar"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_uid
msgid "Created by"
msgstr "Creado por"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_date
msgid "Created on"
msgstr "Creado el"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__display_name
msgid "Display Name"
msgstr "Nombre mostrado"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_line__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_payment__entry_number
msgid "Entry Number"
msgstr "Número de asiento"
#. module: account_journal_general_sequence
#: model:ir.model.constraint,message:account_journal_general_sequence.constraint_account_move_entry_number_unique
msgid "Entry number must be unique per journal."
msgstr "El número de asiento debe ser único por diario."
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__id
msgid "ID"
msgstr "ID"
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid ""
"If you have already filed and legalized your journals with the competent "
"authority, this action could change it. Continue?"
msgstr ""
"Si ya ha presentado y legalizado sus diarios ante la autoridad competente, "
"esta acción podría modificarlo. ¿Continuar?"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_journal
msgid "Journal"
msgstr "Diario"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move
msgid "Journal Entry"
msgstr "Asiento contable"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_line
msgid "Journal Item"
msgstr "Apunte contable"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard____last_update
msgid "Last Modified on"
msgstr "Última modificación el"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_uid
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_date
msgid "Last Updated on"
msgstr "Última actualización el"
#. module: account_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/wizards/account_move_renumber_wizard.py:0
#, python-format
msgid "No account moves found."
msgstr "No se ha encontrado ningún asiento contable."
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber"
msgstr "Renumerar"
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber account entry numbers"
msgstr "Renumerar asientos contables"
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Renumber account moves starting this day."
msgstr "Renumerar asientos contables a partir de este día."
#. module: account_journal_general_sequence
#: model:ir.actions.act_window,name:account_journal_general_sequence.account_move_renumber_wizard_action
#: model:ir.ui.menu,name:account_journal_general_sequence.account_move_renumber_wizard_menu
msgid "Renumber journal entries"
msgstr "Renumerar asientos contables"
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Reset sequence to this number before starting."
msgstr "Reiniciar la secuencia a este número antes de empezar."
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid "Sequence"
msgstr "Secuencia"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id_name
msgid "Sequence Code"
msgstr "Código secuencial"
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid ""
"Sequence to use for renumbering. Affects all journals that use this sequence."
msgstr ""
"Secuencia usada al renumerar. Afectará a todos los diarios que usen esta "
"secuencia."
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Sequence used for account entry numbering."
msgstr "Secuencia usada para renumerar los asientos contables."
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Starting Date"
msgstr "Fecha de inicio"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Starting Number"
msgstr "Número inicial"
#, python-format
#~ msgid "Account entry default numbering"
#~ msgstr "Numeración por defecto de asientos contables"

View File

@@ -0,0 +1,196 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_journal_general_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-05-25 15:09+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>\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_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/models/account_journal.py:0
#, python-format
msgid "Account entry default numbering (%s)"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Account entry number sequence"
msgstr "Brojeni krug stavke"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_renumber_wizard
msgid "Account move entry renumbering wizard"
msgstr "Čarobnjak za renumeraciju stavaka"
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_line__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_payment__entry_number
msgid "Automatic numbering, based on journal configuration."
msgstr "Automatska renumeracija, bazirana na postavkama dnevnika."
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__available_sequence_ids
msgid "Available sequences"
msgstr "Raspoložive sekvence"
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Cancel"
msgstr "Otkaži"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_uid
msgid "Created by"
msgstr "Kreirao"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_date
msgid "Created on"
msgstr "Kreirano"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__display_name
msgid "Display Name"
msgstr "Prikazani naziv"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_line__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_payment__entry_number
msgid "Entry Number"
msgstr "Broj stavke"
#. module: account_journal_general_sequence
#: model:ir.model.constraint,message:account_journal_general_sequence.constraint_account_move_entry_number_unique
msgid "Entry number must be unique per journal."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__id
msgid "ID"
msgstr "ID"
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid ""
"If you have already filed and legalized your journals with the competent "
"authority, this action could change it. Continue?"
msgstr ""
"Ukoliko ste već podnesli porezni izvještaj, ova radnja bi moga izmjeniti "
"negove vrijednosti. Nastaviti?"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_journal
msgid "Journal"
msgstr "Dnevnik"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move
msgid "Journal Entry"
msgstr "Stavka dnevnika"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_line
msgid "Journal Item"
msgstr "Stavka dnevnika"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard____last_update
msgid "Last Modified on"
msgstr "Zadnje modificirano"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_uid
msgid "Last Updated by"
msgstr "Zadnji ažurirao"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_date
msgid "Last Updated on"
msgstr "Zadnje ažurirano"
#. module: account_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/wizards/account_move_renumber_wizard.py:0
#, python-format
msgid "No account moves found."
msgstr "Nisu pronađene temeljnice."
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber"
msgstr "Renumeriraj"
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber account entry numbers"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Renumber account moves starting this day."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.actions.act_window,name:account_journal_general_sequence.account_move_renumber_wizard_action
#: model:ir.ui.menu,name:account_journal_general_sequence.account_move_renumber_wizard_menu
msgid "Renumber journal entries"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Reset sequence to this number before starting."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid "Sequence"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id_name
msgid "Sequence Code"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid ""
"Sequence to use for renumbering. Affects all journals that use this sequence."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Sequence used for account entry numbering."
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Starting Date"
msgstr ""
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Starting Number"
msgstr ""
#, python-format
#~ msgid "Account entry default numbering"
#~ msgstr "Zadano odbrojavanje računovodstvenih stavaka"
#~ msgid "Entry number must be unique per company."
#~ msgstr "Broj stavke mora biti jedinstven unutar tvrtke."

View File

@@ -0,0 +1,191 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_journal_general_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-19 09:58+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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 5.6.2\n"
#. module: account_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/models/account_journal.py:0
#, python-format
msgid "Account entry default numbering (%s)"
msgstr "Numerazione automatica registrazioni contabili (%s)"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Account entry number sequence"
msgstr "Sequenza numerica registrazione contabile"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_renumber_wizard
msgid "Account move entry renumbering wizard"
msgstr "Procedura guidata rinumerazione registrazione movimento contabile"
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_line__entry_number
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_payment__entry_number
msgid "Automatic numbering, based on journal configuration."
msgstr "Numerazione automatica, in base alla configurazione del registro."
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__available_sequence_ids
msgid "Available sequences"
msgstr "Sequenze disponibili"
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Cancel"
msgstr "Annulla"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_uid
msgid "Created by"
msgstr "Creato da"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__create_date
msgid "Created on"
msgstr "Creato il"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__display_name
msgid "Display Name"
msgstr "Nome visualizzato"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_bank_statement_line__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_line__entry_number
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_payment__entry_number
msgid "Entry Number"
msgstr "Numero registrazione"
#. module: account_journal_general_sequence
#: model:ir.model.constraint,message:account_journal_general_sequence.constraint_account_move_entry_number_unique
msgid "Entry number must be unique per journal."
msgstr "Il numero registrazione deve essere univoco per registro."
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__id
msgid "ID"
msgstr "ID"
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid ""
"If you have already filed and legalized your journals with the competent "
"authority, this action could change it. Continue?"
msgstr ""
"Se i registri sono già stati archiviati e legalizzati dall'autorità "
"competente, questa azione li potrebbe modificare. Continuare?"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_journal
msgid "Journal"
msgstr "Registro"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move
msgid "Journal Entry"
msgstr "Registrazione contabile"
#. module: account_journal_general_sequence
#: model:ir.model,name:account_journal_general_sequence.model_account_move_line
msgid "Journal Item"
msgstr "Movimento contabile"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"
#. module: account_journal_general_sequence
#. odoo-python
#: code:addons/account_journal_general_sequence/wizards/account_move_renumber_wizard.py:0
#, python-format
msgid "No account moves found."
msgstr "Nessun movimento contabile trovato."
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber"
msgstr "Rinumerazione"
#. module: account_journal_general_sequence
#: model_terms:ir.ui.view,arch_db:account_journal_general_sequence.account_move_renumber_wizard_view_form
msgid "Renumber account entry numbers"
msgstr "Numeri rinumerazione registrazione contabile"
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Renumber account moves starting this day."
msgstr "Rinumera i movimenti contabili iniziando da questo giorno."
#. module: account_journal_general_sequence
#: model:ir.actions.act_window,name:account_journal_general_sequence.account_move_renumber_wizard_action
#: model:ir.ui.menu,name:account_journal_general_sequence.account_move_renumber_wizard_menu
msgid "Renumber journal entries"
msgstr "Rinumera movimenti contabili"
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Reset sequence to this number before starting."
msgstr "Resetta la sequenza a questo numero prima di iniziare."
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid "Sequence"
msgstr "Sequenza"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__entry_number_sequence_id_name
msgid "Sequence Code"
msgstr "Codice sequenza"
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_move_renumber_wizard__sequence_id
msgid ""
"Sequence to use for renumbering. Affects all journals that use this "
"sequence."
msgstr ""
"Sequenza da utilizzare per la rinumerazione. Modifica tutti i registri che "
"usano questa sequenza."
#. module: account_journal_general_sequence
#: model:ir.model.fields,help:account_journal_general_sequence.field_account_journal__entry_number_sequence_id
msgid "Sequence used for account entry numbering."
msgstr "Sequenza utilizzata per la numerazione delle registrazioni contabili."
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_date
msgid "Starting Date"
msgstr "Data inizio"
#. module: account_journal_general_sequence
#: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_move_renumber_wizard__starting_number
msgid "Starting Number"
msgstr "Numero iniziale"

View File

@@ -0,0 +1,45 @@
# Copyright 2023 Moduon Team S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)
from odoo import SUPERUSER_ID, api, fields
def migrate(cr, version):
"""One journal sequence per company."""
env = api.Environment(cr, SUPERUSER_ID, {})
journals = env["account.journal"].search(
[
(
"entry_number_sequence_id.code",
"=",
"account_journal_general_sequence.default",
)
]
)
for journal in journals:
if journal.company_id != journal.entry_number_sequence_id.company_id:
new_sequence = env["ir.sequence"].search(
[
("code", "=", "account_journal_general_sequence.default"),
("company_id", "=", journal.company_id.id),
]
) or journal.entry_number_sequence_id.copy(
{
"company_id": journal.company_id.id,
"name": f"{journal.entry_number_sequence_id.name} "
f"({journal.company_id.name})",
"number_next_actual": (
journal.entry_number_sequence_id.number_next_actual
),
"date_range_ids": [
fields.Command.create(
{
"date_from": rng.date_from,
"date_to": rng.date_to,
"number_next_actual": rng.number_next_actual,
}
)
for rng in journal.entry_number_sequence_id.date_range_ids
],
}
)
journal.entry_number_sequence_id = new_sequence

View File

@@ -0,0 +1,3 @@
from . import account_journal
from . import account_move
from . import account_move_line

View File

@@ -0,0 +1,52 @@
# Copyright 2022 Moduon
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
class AccountJournal(models.Model):
_inherit = "account.journal"
entry_number_sequence_id = fields.Many2one(
comodel_name="ir.sequence",
string="Account entry number sequence",
compute="_compute_entry_number_sequence",
domain="[('company_id', '=', company_id)]",
check_company=True,
readonly=False,
store=True,
copy=False,
help="Sequence used for account entry numbering.",
)
entry_number_sequence_id_name = fields.Char(related="entry_number_sequence_id.code")
@api.depends("company_id")
def _compute_entry_number_sequence(self):
"""Get the default sequence for all journals."""
for one in self:
sequence = self.env["ir.sequence"].search(
[
("code", "=", "account_journal_general_sequence.default"),
("company_id", "=", one.company_id.id),
]
)
if not sequence:
_logger.info("Creating default sequence for account move numbers")
sequence = self.env["ir.sequence"].create(
{
"name": self.env._(
"Account entry default numbering (%s)",
one.company_id.name,
),
"code": "account_journal_general_sequence.default",
"company_id": one.company_id.id,
"implementation": "no_gap",
"prefix": "%(range_year)s/",
"padding": 8,
"use_date_range": True,
}
)
one.entry_number_sequence_id = sequence

View File

@@ -0,0 +1,75 @@
# Copyright 2022 Moduon
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
ADDON = "account_journal_general_sequence"
class AccountMove(models.Model):
_inherit = "account.move"
_sql_constraints = [
(
"entry_number_unique",
"UNIQUE(entry_number, journal_id)",
"Entry number must be unique per journal.",
),
]
entry_number = fields.Char(
index=True,
readonly=True,
store=True,
compute="_compute_entry_number",
help="Automatic numbering, based on journal configuration.",
)
@api.depends("state")
def _compute_entry_number(self):
"""Assign an entry number when posting."""
# Skip if installing module, for performance reasons
if self.env.context.get("module") == ADDON:
module = self.env["ir.module.module"].search([("name", "=", ADDON)])
if module.state == "to install":
_logger.info(
"Skipping entry number generation at install for %s.",
self,
)
return
canceled = self.filtered_domain(
[("state", "=", "cancel"), ("entry_number", "!=", False)]
)
canceled.entry_number = False
if canceled:
no_gap_seqs = canceled.mapped(
"journal_id.entry_number_sequence_id"
).filtered_domain([("implementation", "=", "no_gap")])
if no_gap_seqs:
_logger.warning(
"Emptied entry_number for %r after cancellation. "
"This created gaps on %r.",
canceled,
no_gap_seqs,
)
chosen = self.filtered_domain(
[("state", "=", "posted"), ("entry_number", "=", False)]
)
# Cache all the new numbers to avoid wasting recomputations, caused by
# searches done by _next() in the loop below
chosen_map = {}
for move in chosen.sorted(
lambda one: (one.date or "", one.name or "", one.id or 0)
):
chosen_map[move.id] = move.journal_id.entry_number_sequence_id._next(
move.date
)
# Write all the new numbers in the chosen moves
for move_id, new_number in chosen_map.items():
self.browse(move_id).entry_number = new_number
if chosen:
_logger.info("Added entry_number to %d account moves", len(chosen))
_logger.debug("Added entry_number to %r", chosen)

View File

@@ -0,0 +1,10 @@
# Copyright 2022 Moduon
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = "account.move.line"
entry_number = fields.Char(related="move_id.entry_number")

View File

@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@@ -0,0 +1,13 @@
To configure journal sequences:
1. Have full accounting permissions.
2. Go to *Invoicing \> Configuration \> Accounting \> Journals*.
3. Select or create the journal you want to configure.
4. Use *Account entry number sequence* to configure a sequence.
Note that:
- Various journals can share the same sequence.
- All journals get a shared default sequence, per company.
- Entry numbers must be unique per company. So, if you use different
sequences per journal, make sure they don't produce colliding results.

View File

@@ -0,0 +1,2 @@
- Jairo Llopis ([Moduon](https://www.moduon.team/))
- Rafael Blasco ([Moduon](https://www.moduon.team/))

View File

@@ -0,0 +1,5 @@
This module extends the functionality of account to support sequenced
entry numbers and to allow you to renumber them if needed, on demand.
It adds a new field called *Entry number*. This is independent from the
*Number* that Odoo adds by default, and has different purpose.

View File

@@ -0,0 +1,6 @@
After installing this module, no entry numbers will be generated because
that could have a very negative impact in installations that already had
a lot of account moves.
If you need to add numbers to preexisting account moves, please use the
renumbering wizard as explained in the *Usage* section.

View File

@@ -0,0 +1,25 @@
To see journal entry numbers:
1. Go to *Invoicing \> Accounting \> Miscellaneous \> Journal Entries*.
2. Notice the new field *Entry Number*. Only posted moves get an entry
number.
Note that:
- You can use that new field in quick searches.
- You can see it also in *Invoicing \> Accounting \> Miscellaneous \>
Journal Items*.
To renumber journal entries:
1. Have full accounting permissions.
2. Have *Accounting / Invoicing / Billing Administrator* permissions.
3. Go to *Invoicing \> Accounting \> Actions \> Renumber journal
entries*.
4. Configure those parameters.
5. Click on *Renumber*.
Note that:
- You will only be able to select sequences related to journals.
- A sequence usually affects various journals, if not all.

View File

@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_move_renumber_wizard,access_account_move_renumber_wizard,model_account_move_renumber_wizard,account.group_account_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_move_renumber_wizard access_account_move_renumber_wizard model_account_move_renumber_wizard account.group_account_manager 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,491 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document">
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="general-sequence-in-account-journals">
<h1>General sequence in account journals</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ebbf67cd950dbf83980c1c355f4298865c64e2ceded9112377e39e1f0c0d105f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-financial-tools/tree/18.0/account_journal_general_sequence"><img alt="OCA/account-financial-tools" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-tools-18-0/account-financial-tools-18-0-account_journal_general_sequence"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of account to support sequenced
entry numbers and to allow you to renumber them if needed, on demand.</p>
<p>It adds a new field called <em>Entry number</em>. This is independent from the
<em>Number</em> that Odoo adds by default, and has different purpose.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li>
<li><a class="reference internal" href="#configuration" id="toc-entry-2">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-3">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="installation">
<h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
<p>After installing this module, no entry numbers will be generated because
that could have a very negative impact in installations that already had
a lot of account moves.</p>
<p>If you need to add numbers to preexisting account moves, please use the
renumbering wizard as explained in the <em>Usage</em> section.</p>
</div>
<div class="section" id="configuration">
<h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
<p>To configure journal sequences:</p>
<ol class="arabic simple">
<li>Have full accounting permissions.</li>
<li>Go to <em>Invoicing &gt; Configuration &gt; Accounting &gt; Journals</em>.</li>
<li>Select or create the journal you want to configure.</li>
<li>Use <em>Account entry number sequence</em> to configure a sequence.</li>
</ol>
<p>Note that:</p>
<ul class="simple">
<li>Various journals can share the same sequence.</li>
<li>All journals get a shared default sequence, per company.</li>
<li>Entry numbers must be unique per company. So, if you use different
sequences per journal, make sure they dont produce colliding results.</li>
</ul>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-3">Usage</a></h2>
<p>To see journal entry numbers:</p>
<ol class="arabic simple">
<li>Go to <em>Invoicing &gt; Accounting &gt; Miscellaneous &gt; Journal Entries</em>.</li>
<li>Notice the new field <em>Entry Number</em>. Only posted moves get an entry
number.</li>
</ol>
<p>Note that:</p>
<ul class="simple">
<li>You can use that new field in quick searches.</li>
<li>You can see it also in <em>Invoicing &gt; Accounting &gt; Miscellaneous &gt;
Journal Items</em>.</li>
</ul>
<p>To renumber journal entries:</p>
<ol class="arabic simple">
<li>Have full accounting permissions.</li>
<li>Have <em>Accounting / Invoicing / Billing Administrator</em> permissions.</li>
<li>Go to <em>Invoicing &gt; Accounting &gt; Actions &gt; Renumber journal entries</em>.</li>
<li>Configure those parameters.</li>
<li>Click on <em>Renumber</em>.</li>
</ol>
<p>Note that:</p>
<ul class="simple">
<li>You will only be able to select sequences related to journals.</li>
<li>A sequence usually affects various journals, if not all.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-tools/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_journal_general_sequence%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-5">Credits</a></h2>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-6">Authors</a></h3>
<ul class="simple">
<li>Moduon</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-7">Contributors</a></h3>
<ul class="simple">
<li>Jairo Llopis (<a class="reference external" href="https://www.moduon.team/">Moduon</a>)</li>
<li>Rafael Blasco (<a class="reference external" href="https://www.moduon.team/">Moduon</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/yajo"><img alt="yajo" src="https://github.com/yajo.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/18.0/account_journal_general_sequence">OCA/account-financial-tools</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1 @@
from . import test_numbering

View File

@@ -0,0 +1,138 @@
# Copyright 2022 Moduon
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from freezegun import freeze_time
from odoo import fields
from odoo.tests import Form, new_test_user, tagged, users
from odoo.tools import mute_logger
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
@freeze_time("2022-05-11", tick=True)
@tagged("post_install", "-at_install")
class RenumberCase(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.company_t1 = cls.company_data["company"]
cls.company_t2 = cls._create_company(name="company_2_test_numbering_data")
cls.invoicer = new_test_user(
cls.env,
"test_invoicer",
"account.group_account_invoice",
company_ids=[fields.Command.set((cls.company_t1 + cls.company_t2).ids)],
)
cls.manager = new_test_user(
cls.env,
"test_manager",
"account.group_account_manager",
company_ids=[fields.Command.set((cls.company_t1 + cls.company_t2).ids)],
)
cls.today = fields.Date.to_string(fields.Date.today())
@users("test_invoicer")
def test_invoice_gets_entry_number(self):
# Draft invoice without entry number
invoice = self.init_invoice(
"out_invoice", invoice_date=self.today, products=self.product_a
)
self.assertFalse(invoice.entry_number)
# Gets one once posted
invoice.action_post()
self.assertTrue(invoice.entry_number.startswith("2022/"))
# Lost number when canceled
with mute_logger(
"odoo.addons.account_journal_general_sequence.models.account_move"
):
invoice.button_cancel()
self.assertFalse(invoice.entry_number)
@users("test_manager")
def test_renumber(self):
# Post invoices in wrong order
next_year_invoice = self.init_invoice(
move_type="out_invoice",
invoice_date="2023-12-31",
post=True,
products=self.product_a,
)
next_year_invoice.flush_recordset(["entry_number"])
new_invoice = self.init_invoice(
move_type="out_invoice",
invoice_date="2022-05-10",
post=True,
products=self.product_a,
)
new_invoice.flush_recordset(["entry_number"])
old_invoice = self.init_invoice(
move_type="out_invoice",
invoice_date="2022-04-30",
post=True,
products=self.product_a,
)
old_invoice.flush_recordset(["entry_number"])
self.assertLess(new_invoice.entry_number, old_invoice.entry_number)
# Fix entry number order with wizard; default values are OK
wiz_f = Form(
self.env["account.move.renumber.wizard"].with_company(
self.company_data["company"]
)
)
self.assertEqual(len(wiz_f.available_sequence_ids), 1)
wiz = wiz_f.save()
wiz.action_renumber()
self.assertGreater(new_invoice.entry_number, old_invoice.entry_number)
# Add opening move
opening_invoice = self.init_invoice(
move_type="out_invoice",
invoice_date="2022-01-01",
post=True,
products=self.product_a,
)
self.assertGreater(opening_invoice.entry_number, new_invoice.entry_number)
# Renumber again, starting from zero
wiz_f = Form(self.env["account.move.renumber.wizard"])
wiz = wiz_f.save()
wiz.action_renumber()
self.assertEqual(opening_invoice.entry_number, "2022/00000001")
self.assertEqual(old_invoice.entry_number, "2022/00000002")
self.assertEqual(new_invoice.entry_number, "2022/00000003")
self.assertEqual(next_year_invoice.entry_number, "2023/00000001")
@users("test_invoicer")
def test_install_no_entry_number(self):
"""No entry numbers assigned on module installation."""
invoice = self.init_invoice(
"out_invoice", products=self.product_a, invoice_date=self.today
)
self.assertFalse(invoice.entry_number)
# Imitate installation environment
self.env["ir.module.module"].sudo().search(
[("name", "=", "account_journal_general_sequence")]
).state = "to install"
# Do some action that would make the move get an entry number
invoice.with_context(module="account_journal_general_sequence").action_post()
# Ensure there's no entry number
self.assertFalse(invoice.entry_number)
@users("test_invoicer")
def test_new_company_journal(self):
# Create a new invoice for each company
invoice1 = self.init_invoice(
"out_invoice",
products=self.product_a,
invoice_date=self.today,
post=True,
company=self.company_t1,
)
invoice2 = self.init_invoice(
"out_invoice",
products=self.product_a,
invoice_date=self.today,
post=True,
company=self.company_t2,
)
# Each company has a different sequence, so the entry number should be the same
self.assertEqual(invoice1.entry_number, "2022/00000001")
self.assertEqual(invoice2.entry_number, "2022/00000001")

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 Moduon
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -->
<data>
<record id="view_account_journal_tree" model="ir.ui.view">
<field name="name">Add move number sequence to tree</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_tree" />
<field name="arch" type="xml">
<field name="company_id" position="before">
<field name="entry_number_sequence_id" optional="hide" />
</field>
</field>
</record>
<record id="view_account_journal_form" model="ir.ui.view">
<field name="name">Add move number sequence to form</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form" />
<field name="arch" type="xml">
<field name="refund_sequence" position="before">
<field name="entry_number_sequence_id_name" invisible="1" />
<field
name="entry_number_sequence_id"
readonly="entry_number_sequence_id_name == 'account_journal_general_sequence.default'"
/>
</field>
</field>
</record>
</data>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 Moduon
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -->
<data>
<record id="view_move_tree" model="ir.ui.view">
<field name="name">Add move number to tree</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_tree" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="entry_number" optional="show" />
</field>
</field>
</record>
<record id="view_move_form" model="ir.ui.view">
<field name="name">Add move number to form</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<xpath expr="//group[@name='accounting_info_group']">
<field name="entry_number" />
</xpath>
<xpath expr="//group[@name='misc_group']">
<field name="entry_number" />
</xpath>
</field>
</record>
<record id="view_account_move_filter" model="ir.ui.view">
<field name="name">Add move number to search</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_account_move_filter" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="entry_number" />
</field>
</field>
</record>
</data>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 Moduon
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -->
<data>
<record id="view_move_line_tree" model="ir.ui.view">
<field name="name">Add move number to tree</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_tree" />
<field name="arch" type="xml">
<field name="move_id" position="after">
<field name="entry_number" optional="show" />
</field>
</field>
</record>
<record id="view_move_line_form" model="ir.ui.view">
<field name="name">Add move number to form</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_form" />
<field name="arch" type="xml">
<field name="move_id" position="after">
<field name="entry_number" />
</field>
</field>
</record>
<record id="view_account_move_line_filter" model="ir.ui.view">
<field name="name">Add move number to search</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_account_move_line_filter" />
<field name="arch" type="xml">
<field name="move_id" position="after">
<field name="entry_number" />
</field>
</field>
</record>
</data>

View File

@@ -0,0 +1 @@
from . import account_move_renumber_wizard

View File

@@ -0,0 +1,93 @@
# Copyright 2022 Moduon
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from datetime import date
from odoo import _, api, exceptions, fields, models
class AccountMoveRenumberWizard(models.TransientModel):
_name = "account.move.renumber.wizard"
_description = "Account move entry renumbering wizard"
starting_date = fields.Date(
required=True,
default=lambda self: self._default_starting_date(),
help="Renumber account moves starting this day.",
)
starting_number = fields.Integer(
default=1, help="Reset sequence to this number before starting."
)
available_sequence_ids = fields.Many2many(
comodel_name="ir.sequence",
string="Available sequences",
default=lambda self: self._default_available_sequence_ids(),
)
sequence_id = fields.Many2one(
comodel_name="ir.sequence",
string="Sequence",
required=True,
default=lambda self: self._default_entry_number_sequence(),
domain="[('id', 'in', available_sequence_ids)]",
help="Sequence to use for renumbering. "
"Affects all journals that use this sequence.",
)
@api.model
def _default_starting_date(self):
"""Start by default on day 1 of current year."""
return date(date.today().year, 1, 1)
@api.model
def _default_entry_number_sequence(self):
"""Get default sequence if it exists."""
return self.env["ir.sequence"].search(
[
"&",
("code", "=", "account_journal_general_sequence.default"),
("company_id", "in", self.env.companies.ids),
]
)
@api.model
def _default_available_sequence_ids(self):
"""Let view display only journal-related sequences."""
return (
self.env["account.journal"]
.search([("company_id", "in", self.env.companies.ids)])
.mapped("entry_number_sequence_id")
)
def action_renumber(self):
"""Renumber moves.
Makes sure moves exist. Sorts them. Resets sequences. Renumbers them.
"""
# Find posted moves that match wizard criteria
moves = self.env["account.move"].search(
[
("state", "=", "posted"),
("date", ">=", self.starting_date),
("journal_id.entry_number_sequence_id", "=", self.sequence_id.id),
],
order="date, id",
)
if not moves:
raise exceptions.UserError(_("No account moves found."))
# Reset sequence
future_ranges = self.env["ir.sequence.date_range"].search(
[
("date_from", ">", self.starting_date),
("sequence_id", "=", self.sequence_id.id),
]
)
# Safe `sudo` calls; wizard only available for accounting managers
future_ranges.sudo().unlink()
current_range = self.sequence_id._get_current_sequence(self.starting_date)
current_range.sudo().number_next = self.starting_number
self.sequence_id.sudo().number_next = self.starting_number
# Renumber the moves
moves = moves.with_context(skip_invoice_sync=True)
moves.entry_number = False
moves.flush_recordset(["entry_number"])
moves._compute_entry_number()

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 Moduon
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -->
<data>
<record id="account_move_renumber_wizard_view_form" model="ir.ui.view">
<field name="name">Renumber form</field>
<field name="model">account.move.renumber.wizard</field>
<field name="arch" type="xml">
<form string="Renumber account entry numbers">
<sheet>
<group colspan="4">
<field name="starting_date" />
<field name="starting_number" />
<field name="available_sequence_ids" invisible="1" />
<field name="sequence_id" />
</group>
</sheet>
<footer>
<button
name="action_renumber"
type="object"
string="Renumber"
class="btn-primary"
confirm="If you have already filed and legalized your journals with the competent authority, this action could change it. Continue?"
/>
<button special="cancel" string="Cancel" class="btn-secondary" />
</footer>
</form>
</field>
</record>
<record id="account_move_renumber_wizard_action" model="ir.actions.act_window">
<field name="name">Renumber journal entries</field>
<field name="res_model">account.move.renumber.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem
id="account_move_renumber_wizard_menu"
parent="account.menu_finance_entries"
action="account_move_renumber_wizard_action"
sequence="85"
/>
</data>