mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
opt seq sale
This commit is contained in:
15
app_sale_order_line_sequence/init_hooks.py
Normal file
15
app_sale_order_line_sequence/init_hooks.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import SUPERUSER_ID
|
||||
from odoo.api import Environment
|
||||
|
||||
|
||||
def post_init_hook(cr, pool):
|
||||
"""
|
||||
Fetches all the sale order and resets the sequence of the order lines
|
||||
"""
|
||||
env = Environment(cr, SUPERUSER_ID, {})
|
||||
sale = env['sale.order'].search([])
|
||||
sale._reset_sequence()
|
||||
Reference in New Issue
Block a user