Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] hr_expense_operating_unit: Migration to 16.0 #701

Open
wants to merge 39 commits into
base: 16.0
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b3d21cc
migrated hr-expense-operating-unit to 9.0
SerpentCS Aug 24, 2016
b010481
added OU to account move
SerpentCS Aug 29, 2016
97c069c
added Readme file and minor fixes
SerpentCS Aug 29, 2016
c320e5a
Added Test Cases.
SerpentCS Sep 14, 2016
f577b76
Added Copyrights in xml files and made minor changes.
SerpentCS Sep 14, 2016
c4a71ea
PEP8 issues
AaronHForgeFlow Sep 15, 2016
663ae8e
Add constraint
AaronHForgeFlow Feb 13, 2017
6504416
travis
AaronHForgeFlow Feb 14, 2017
2e86cc6
security
LoisRForgeFlow May 9, 2017
286d8f0
[MIG] hr_expense_operating_unit v10
nikul-serpentcs Jul 21, 2017
bd4a3fc
[FIX] hr_expense_operating_unit test failing
bjeficent Feb 25, 2019
7d01b6c
[MIG] hr_expense_operating_unit: Migration to version 12.0
bjeficent Mar 11, 2019
fba501f
[FIX]domain operating units on expenses
AaronHForgeFlow Oct 14, 2019
4dab436
[UPD] Update hr_expense_operating_unit.pot
oca-travis Oct 14, 2019
b26a9fb
[UPD] README.rst
OCA-git-bot Oct 14, 2019
dbd2fdb
[FIX] Fixed unknown Fields
nikul-serpentcs Dec 30, 2019
7dbe599
hr_expense_operating_unit 12.0.1.0.1
OCA-git-bot Dec 30, 2019
bd175a6
[IMP] hr_expense_operating_unit: black, isort
alan196 Feb 12, 2020
412af08
[MIG] hr_expense_operating_unit: Migration to V13
alan196 Feb 12, 2020
2edcd74
[UPD] Update hr_expense_operating_unit.pot
oca-travis Apr 16, 2020
441d5db
[UPD] README.rst
OCA-git-bot Apr 16, 2020
f9e3f85
[FIX] hr_expense_operating_unit: adapt to v13 changes
hbrunn Sep 21, 2020
b414229
hr_expense_operating_unit 13.0.1.0.1
OCA-git-bot Sep 21, 2020
44fdb81
[UPD] Eficent -> ForgeFlow
MiquelRForgeFlow Oct 5, 2020
452129e
[UPD] README.rst
OCA-git-bot Oct 5, 2020
43bbcd9
[14.0][MIG] hr_expense_operating_unit
kittiu Dec 9, 2020
a2f8926
[FIX] multi operating-unit can't create expense sheet
Saran440 Feb 24, 2021
891f582
[FIX] default ou on move
Saran440 Apr 21, 2021
8ca81f1
[UPD] Update hr_expense_operating_unit.pot
oca-travis Jun 3, 2021
9e38a08
[UPD] README.rst
OCA-git-bot Jun 3, 2021
b7d4b0c
[MIG] Migrated hr_expense_operating_unit in v15
Rajan-SCS Jan 24, 2022
94174f0
[FIX] hr_expense_operating_unit: reconcile move with expense
Saran440 Mar 30, 2023
b873ca2
[UPD] Update hr_expense_operating_unit.pot
May 18, 2023
668cdf8
[UPD] README.rst
OCA-git-bot May 18, 2023
55a44ee
[UPD] README.rst
OCA-git-bot Sep 3, 2023
7eb0e72
[IMP] hr_expense_operating_unit: pre-commit stuff
hbrunn Aug 8, 2024
dfe3663
[MIG] hr_expense_operating_unit: Migration to 16.0
hbrunn Aug 8, 2024
e6136cd
[ADD] hr_expense_operating_unit: test for onchange function
hbrunn Aug 8, 2024
b17ea7c
fixup! [MIG] hr_expense_operating_unit: Migration to 16.0
hbrunn Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FIX] hr_expense_operating_unit: adapt to v13 changes
hbrunn committed Aug 8, 2024
commit f9e3f859e87d93190b7400c10a5efe3ac886651a
11 changes: 4 additions & 7 deletions hr_expense_operating_unit/models/hr_expense.py
Original file line number Diff line number Diff line change
@@ -51,8 +51,8 @@ def _check_expense_operating_unit(self):
)
)

def action_submit_expenses(self):
res = super(HrExpenseExpense, self).action_submit_expenses()
def _create_sheet_from_expenses(self):
sheet = super()._create_sheet_from_expenses()
if len(self.mapped("operating_unit_id")) != 1 or any(
not expense.operating_unit_id for expense in self
):
@@ -63,11 +63,8 @@ def action_submit_expenses(self):
"no Operating Unit"
)
)
if res.get("context"):
res.get("context").update(
{"default_operating_unit_id": self[0].operating_unit_id.id}
)
return res
sheet.write({"operating_unit_id": self.mapped("operating_unit_id").id})
return sheet

def _get_account_move_line_values(self):
res = super(HrExpenseExpense, self)._get_account_move_line_values()
39 changes: 6 additions & 33 deletions hr_expense_operating_unit/tests/test_hr_expense_operating_unit.py
Original file line number Diff line number Diff line change
@@ -113,17 +113,8 @@ def test_security(self):
)
# Create the expense sheet
hr_expense_dict1 = self.hr_expense1.action_submit_expenses()
self.hr_expense_sheet1 = self.hr_expense_sheet_model.create(
{
"name": hr_expense_dict1["context"]["default_name"],
"employee_id": hr_expense_dict1["context"]["default_employee_id"],
"expense_line_ids": [
(4, hr_expense_dict1["context"]["default_expense_line_ids"][0])
],
"operating_unit_id": hr_expense_dict1["context"][
"default_operating_unit_id"
],
}
self.hr_expense_sheet1 = self.hr_expense_sheet_model.browse(
hr_expense_dict1["res_id"]
)
self.hr_expense1.write({"sheet_id": self.hr_expense_sheet1.id})
self._post_journal_entries(self.hr_expense_sheet1)
@@ -137,17 +128,8 @@ def test_security(self):
def test_constrains_error(self):
with self.assertRaises(ValidationError):
hr_expense_dict1 = self.hr_expense1.action_submit_expenses()
self.hr_expense_sheet1 = self.hr_expense_sheet_model.create(
{
"name": hr_expense_dict1["context"]["default_name"],
"employee_id": hr_expense_dict1["context"]["default_employee_id"],
"expense_line_ids": [
(4, hr_expense_dict1["context"]["default_expense_line_ids"][0])
],
"operating_unit_id": hr_expense_dict1["context"][
"default_operating_unit_id"
],
}
self.hr_expense_sheet1 = self.hr_expense_sheet_model.browse(
hr_expense_dict1["res_id"]
)
self.hr_expense1.write({"sheet_id": self.hr_expense_sheet1.id})
self.hr_expense_sheet1.expense_line_ids.write(
@@ -164,17 +146,8 @@ def test_constrains_error(self):

with self.assertRaises(ValidationError):
hr_expense_dict2 = self.hr_expense2.action_submit_expenses()
self.hr_expense_sheet2 = self.hr_expense_sheet_model.create(
{
"name": hr_expense_dict2["context"]["default_name"],
"employee_id": hr_expense_dict2["context"]["default_employee_id"],
"expense_line_ids": [
(4, hr_expense_dict2["context"]["default_expense_line_ids"][0])
],
"operating_unit_id": hr_expense_dict2["context"][
"default_operating_unit_id"
],
}
self.hr_expense_sheet2 = self.hr_expense_sheet_model.browse(
hr_expense_dict2["res_id"]
)
self.hr_expense_sheet2.expense_line_ids.write({"company_id": company_id.id})