Skip to content

Commit

Permalink
[FIX] default ou on move
Browse files Browse the repository at this point in the history
  • Loading branch information
Saran440 committed Apr 21, 2021
1 parent 7f23b9d commit 369fa75
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hr_expense_operating_unit/models/hr_expense.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,17 @@ def _create_sheet_from_expenses(self):
return sheet

def _get_account_move_line_values(self):
res = super(HrExpenseExpense, self)._get_account_move_line_values()
res = super()._get_account_move_line_values()
for expense in self:
res[expense.id][0].update({"operating_unit_id": self.operating_unit_id.id})
res[expense.id][1].update({"operating_unit_id": self.operating_unit_id.id})
return res

def _prepare_move_values(self):
move_values = super()._prepare_move_values()
move_values["operating_unit_id"] = self.operating_unit_id.id
return move_values


class HrExpenseSheet(models.Model):

Expand Down

0 comments on commit 369fa75

Please sign in to comment.