Commit c6cc711 1 parent ee82a06 commit c6cc711 Copy full SHA for c6cc711
File tree 1 file changed +7
-6
lines changed
account_invoice_line_sequence
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 2
2
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
3
3
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
4
4
5
- from odoo import SUPERUSER_ID
6
- from odoo .api import Environment
5
+ from odoo import SUPERUSER_ID , api
7
6
8
7
9
- def post_init_hook (cr , pool ):
8
+ def post_init_hook (cr , registry ):
10
9
"""
11
10
Fetches all invoice and resets the sequence of their invoice line
12
11
"""
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 ()
You can’t perform that action at this time.
0 commit comments