Skip to content

Conversation

@RyanTranAVB
Copy link

No description provided.

alexis-via and others added 30 commits November 27, 2025 17:56
This module restores the good old behavior where journal entry numbers
were generated from a sequence configured on the journal.
Add post-install script to create a sequence for all existing journals
Update README accordingly
…ange_day

More info about:
 - odoo/odoo#91019

TODO: Revert this commit after it is merged
After remove required=True for journal.sequence_id field it is possible to post an invoice with misconfigured journal with empty sequence

So, this constraint will raise an error for this kind of cases since that using '/' could raise the unique constraint for all other moves
The required flag was wrong for sequence_id and refund_sequence_id

So, it was not possible to store any change in journal for journal different to sale and purchase
…efix

In case you want name your invoice YYYY-MM-SEQ (ie: 2022-07-00001)
where:
 * YYYY: is the account move year
 * MM: is the account move month
 * SEQ: is a numerical sequence that is continue along the fiscal year
   assuming fiscal year is over two years (ie: from july to june next year)

Before this commit the sequence prefix use now() to be compute but the
range is selected with the account move date.

This commit make consistency computing prefix with the account
move date as well.

So account move manage the first janunary for the last day of
the previous year will properly use the account move date.

Co-authored-by: Alexis de Lattre <[email protected]>
…supplier_reference method

same issue OCA#1501
this fix not working for v16 OCA#1514
…e" module the "_get_last_sequence" method does not have to propagate the with_prefix parameter. The sequence_prefix parameter will not be completed and will give error as it is False in this line of code. https://github.com/OCA/OCB/blob/16.0/addons/account/models/sequence_mixin.py#L169
Currently translated at 100.0% (20 of 20 strings)

Translation: account-financial-tools-16.0/account-financial-tools-16.0-account_move_name_sequence
Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_move_name_sequence/fr/
Rename hooks file and use post_init_hook method to create journal sequences
after module installation.
…the name

The core compute function for the name is calling at the end the function self._inverse_name(),
which updates the payment_reference when required.
This code was currently missing, causing the payment_reference not being properly computed,
for example, when using QR-Bills.
petrus-v and others added 22 commits November 27, 2025 18:05
In case an alias is configured to fecth email to generate
account entries. the new_message method directly call the
_compute_name on account move which call the legacy code
provide by account odoo module which should be avoid here.

To reproduce:

* configure an alias on your purchase journal
* send an email to that alias
* the invoice is draft with a number

to mitigate this behavior the suggested patch overwritte
the former method '_compute_name' and call the new implemented
method '_compute_name_by_sequence'.
…invoices

Add demo data with standard implementation sequences

In order to test locks issues without changing data (then reverting)
Split the context definition in sequence_id and refund_sequence_id
fields into multiple lines to improve readability.
Update name of view files to follow guidelines.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-financial-tools-17.0/account-financial-tools-17.0-account_move_name_sequence
Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-17-0/account-financial-tools-17-0-account_move_name_sequence/
Changelog:
- Replace `_()` by `self.env._()`.
- Replace `_fetch_duplicate_supplier_reference` by
  `_fetch_duplicate_reference` to include both sale and purchase
  documents.
- Use `mute_logger` to suppress warnings when executing the
  `_prepare_sequence_current_moves` method without moves in the journals
  from the `post_init_hook`.
- Patch the `_validate_fields` and `_hash_moves` methods in tests to
  simulate the same behavior as if the journal entries were unlocked.
  This is necessary because, in the pipeline, the
  `account_journal_restrict_mode` module is installed, which locks
  posted entries, preventing them from being set to draft or deleted
  afterward.
- Enter test mode when executing threads in the
  `test_sequence_concurrency_95_pay2inv_inv2pay` test to avoid locks.
- Replace `_clean_moves` by `_clean_moves_and_payments`, since entries
  created from a payment cannot be deleted on their own and must be
  deleted along with the payment.

Co-authored-by: Bert Van Groenendael <[email protected]>
Co-authored-by: oury.balde <[email protected]>
…ndling

Changelog:
- Use Command syntax for better record manipulation.
- Use `eval` for non-string field values to ensure proper evaluation.
- Refactor tests to use `SetUpClass`, adding cleanup methods, new
  cursors, and test mode setup within it.
- Add additional tests for sequence prefix and chain to increase
  coverage.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-financial-tools-18.0/account-financial-tools-18.0-account_move_name_sequence
Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-18-0/account-financial-tools-18-0-account_move_name_sequence/
Call leave_test_mode once tests where enter_test_mode has been
explicitly called are done.

This fixes issues with conflicting users when running tests of this
module alongside base account tests / tests of the sale_order_type
module.

Note we still need to isolate this module in test runs (see commit
8da2b37) as other tests in this repo
(namely those in purchase_unreconciled) rely on default sequences.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-financial-tools-18.0/account-financial-tools-18.0-account_move_name_sequence
Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-18-0/account-financial-tools-18-0-account_move_name_sequence/
@RyanTranAVB RyanTranAVB force-pushed the 19.0-mig-account_move_name_sequence branch from e0b9350 to fe5c274 Compare November 27, 2025 11:11
@RyanTranAVB RyanTranAVB mentioned this pull request Nov 27, 2025
34 tasks
@RyanTranAVB RyanTranAVB changed the title [MIG] account_move_name_sequence: Migrate to 19.0 [19.0][MIG] account_move_name_sequence: Migrate to 19.0 Nov 27, 2025
Copy link

@mt-software-de mt-software-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the migration. LGTM
Also functional tested.

Copy link

@isaako34 isaako34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.