forked from OCA/hr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
17 lines (14 loc) · 733 Bytes
/
Copy path__init__.py
File metadata and controls
17 lines (14 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import models
from openerp import SUPERUSER_ID
def assign_old_sequences(cr, registry):
expense_obj = registry['hr.expense.expense']
sequence_obj = registry['ir.sequence']
expense_ids = expense_obj.search(cr, SUPERUSER_ID, [], order="id")
for expense_id in expense_ids:
expense_obj.write(cr, SUPERUSER_ID, expense_id,
{'number': sequence_obj.get(
cr, SUPERUSER_ID, 'hr.expense')})