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 authored and kittiu committed Jun 3, 2021
1 parent 004dccf commit 6017910
Show file tree
Hide file tree
Showing 3 changed files with 13 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
6 changes: 6 additions & 0 deletions setup/hr_expense_operating_unit/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 6017910

Please sign in to comment.