Skip to content

Commit c6cc711

Browse files
zamberjodocker-odoo
authored and
docker-odoo
committed
[OPENUPGRADE]
account_invoice_line_sequence/init_hooks.py: - odoo.exceptions.CacheMiss: ('account.move.line(76778,).sequence', None)
1 parent ee82a06 commit c6cc711

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

account_invoice_line_sequence/init_hooks.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
33
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
44

5-
from odoo import SUPERUSER_ID
6-
from odoo.api import Environment
5+
from odoo import SUPERUSER_ID, api
76

87

9-
def post_init_hook(cr, pool):
8+
def post_init_hook(cr, registry):
109
"""
1110
Fetches all invoice and resets the sequence of their invoice line
1211
"""
13-
env = Environment(cr, SUPERUSER_ID, {})
14-
invoice = env["account.move"].search([])
15-
invoice._reset_sequence()
12+
with api.Environment.manage():
13+
env = api.Environment(cr, SUPERUSER_ID, {})
14+
invoice = env["account.move"].search([])
15+
invoice.read(["sequence"])
16+
invoice._reset_sequence()

0 commit comments

Comments
 (0)