1

I have to modify account.move sequence prefix and number and I try it like other odoo versions (10,12 and 13).

With developer mode activated, Settings --> Technical --> Sequences.

I have tried to search Sequence Code for account.move and does not exist.

Also, I tried to search on Journals but does not appear any sequence_id. I found secure_sequence_id and doesn't work. I have also searched on account module on addons and all my custom modules.

Anyone knows how to change it? Why on journals I don't have any sequence_id linked?

Thanks!

mit
  • 11,083
  • 11
  • 50
  • 74
  • Odoo completely changed the sequencing of account moves. Since this has nothing to do with programing, i will vote to close this question. If you want to find out more just search for "odoo invoice sequence" on google. Even the first match was helpful. – CZoellner Jan 04 '22 at 16:39
  • I’m voting to close this question because > see comment before. – CZoellner Jan 04 '22 at 16:40
  • Hello @CZoellner thanks for answering, now i understand. I am going to close this question. – Raúl Openred Jan 04 '22 at 17:08
  • Well it is also very much about programming. As a developer I need to change and understand this configuration option from the source code. The fact that the original author asked it from a user perspective does not change that. It is a convenience for end users, that there is also a gui present that allows to change the setting. – mit Sep 17 '22 at 18:52
  • The original author describes searching the setting in the sourcecode in the second half of the question. I vote for keeping this question open. It is a perfect fit for stackoverflow – mit Sep 17 '22 at 18:58

1 Answers1

0

This has changed in odoo starting version 14. It can no longer be changed in the technical sequence settings.

To understand how this setting can be accessed and changed programmatically, the following might be interesting

The _compute_name method https://stackoverflow.com/a/70749983/362951

The _get_starting_sequence method on account.move

There is an intersting thread on github: https://github.com/odoo/odoo/issues/72486

This file is also relevant: addons/account/models/sequence_mixin.py

There are 2 relevant fields in the account_move table, sequence_prefix and sequence_number:

enter image description here

But I believe they only make sense together with the name field in the same table, because only in the name field you can see the exact format, including the number of digits.

So it is not just a simple function call or looking something up or changing some configuration data entry. It has become more complex.

There is also a gui workflow that is called 're-sequencing' available to help to teach odoo how to do the sequencing. First of all you need at least one or more invoices or moves in your database. Make sure the developer mode is active.

To change the account.move sequence or the sequence of the invoices, you can go to the respective journal and select the records you want to change, or all the records, if you want to re-sequence all the records. (But in many cases it is not advisable to change old entries. Maybe selecting the unposted entries could make sense.)

After selecting one or more entries the Action menu with the wheel-icon appears (you can find it above the list, between Print and Filters. There is an entry in it: Resequence. Once you click on it, you will be presented with a wizard, where you can select the new format and starting number. If you confirm, the new scheme will be applied to the selected entries and also be used for future entries.

mit
  • 11,083
  • 11
  • 50
  • 74