Skip to content

Commit

Permalink
[MIG] hr_expense_sequence: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Saran440 committed Jul 18, 2024
1 parent 08da89d commit dc88276
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion hr_expense_sequence/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "HR expense sequence",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"category": "Human Resources",
"author": "Serv. Tecnol. Avanzados - Pedro M. Baeza,"
Expand Down
5 changes: 1 addition & 4 deletions hr_expense_sequence/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
# Pedro M. Baeza <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import SUPERUSER_ID, api


def assign_old_sequences(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
def assign_old_sequences(env):
expense_obj = env["hr.expense.sheet"]
sequence_obj = env["ir.sequence"]
for expense in expense_obj.search([], order="id"):
Expand Down
7 changes: 2 additions & 5 deletions hr_expense_sequence/tests/test_hr_expense_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ def setUpClass(cls):
cls.expense_sheet_model = cls.env["hr.expense.sheet"]
cls.product = cls.env.ref("product.product_product_4")

employee_home = cls.env["res.partner"].create({"name": "Employee Home Address"})
cls.employee = cls.env["hr.employee"].create(
{"name": "Employee", "address_home_id": employee_home.id}
)
cls.employee = cls.env["hr.employee"].create({"name": "Employee"})
cls.expense = cls.create_expense(cls, "Expense")

def create_expense(self, name):
Expand All @@ -26,7 +23,7 @@ def create_expense(self, name):
"name": name,
"employee_id": self.employee.id,
"product_id": self.product.id,
"unit_amount": self.product.standard_price,
"total_amount_currency": self.product.standard_price,
"quantity": 1,
}
)
Expand Down

0 comments on commit dc88276

Please sign in to comment.