[FIX] account: secure_sequence_id not being created on create

closes odoo/odoo#157306

X-original-commit: 707c5e4903add7c06d11c30e12f1271fdfe293a3
Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
bt-crodriguez
2024-03-12 10:34:55 +00:00
committed by william-andre
parent 4c8f7c9011
commit 47dd0c3fb3
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -706,6 +706,10 @@ class AccountJournal(models.Model):
if journal.type == 'bank' and not journal.bank_account_id and vals.get('bank_acc_number'):
journal.set_bank_account(vals.get('bank_acc_number'), vals.get('bank_id'))
# Create the secure_sequence_id if necessary
if journal.restrict_mode_hash_table and not journal.secure_sequence_id:
journal._create_secure_sequence(['secure_sequence_id'])
return journals
def set_bank_account(self, acc_number, bank_id=None):
+1 -1
View File
@@ -16,4 +16,4 @@ List of contributors:
Raul Martin raul.martin@braintec.com https://github.com/BT-rmartin
Frédéric Garbely frederic.garbely@braintec.com https://github.com/BT-fgarbely
Carlos Serra Toro carlos.serra@braintec.com https://github.com/BT-cserra
Cristian Rodriguez Navarro cristian.rodriguez@braintec.com https://github.com/BT-crodriguez