2
0

Merge PR #1738 into 16.0

Signed-off-by moylop260
This commit is contained in:
OCA-git-bot 2023-10-09 18:49:19 +00:00
commit e9b17f371c
3 changed files with 8 additions and 4 deletions

View File

@ -1,2 +1,2 @@
from .post_install import create_journal_sequences from .hooks import post_init_hook
from . import models from . import models

View File

@ -12,7 +12,7 @@
"license": "AGPL-3", "license": "AGPL-3",
"summary": "Generate journal entry number from sequence", "summary": "Generate journal entry number from sequence",
"author": "Akretion,Vauxoo,Odoo Community Association (OCA)", "author": "Akretion,Vauxoo,Odoo Community Association (OCA)",
"maintainers": ["alexis-via", "moylop260", "frahikLV"], "maintainers": ["alexis-via", "moylop260", "frahikLV", "luisg123v"],
"website": "https://github.com/OCA/account-financial-tools", "website": "https://github.com/OCA/account-financial-tools",
"depends": [ "depends": [
"account", "account",
@ -22,6 +22,6 @@
"views/account_move.xml", "views/account_move.xml",
"security/ir.model.access.csv", "security/ir.model.access.csv",
], ],
"post_init_hook": "create_journal_sequences", "post_init_hook": "post_init_hook",
"installable": True, "installable": True,
} }

View File

@ -8,8 +8,12 @@
from odoo import SUPERUSER_ID, api from odoo import SUPERUSER_ID, api
def create_journal_sequences(cr, registry): def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {}) env = api.Environment(cr, SUPERUSER_ID, {})
create_journal_sequences(env)
def create_journal_sequences(env):
journals = ( journals = (
env["account.journal"] env["account.journal"]
.with_context(active_test=False) .with_context(active_test=False)