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

[FIX] tax origantor must be set for reporting #103

Open
wants to merge 1 commit into
base: 10.0
Choose a base branch
from
Open
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion hr_expense_usability/hr_expense.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ def _get_expense_move_lines_values(self, partner):
'amount': self.untaxed_amount_company_currency,
'name': self.employee_id.name + ': ' +
self.name.split('\n')[0][:64],
'tax_ids': self.tax_ids and [
(6, 0, [self.tax_ids[0].id])] or [(6, 0, [])],
'tax_line_id': False,
'product_id': self.product_id.id,
'product_uom_id': self.product_uom_id.id,
'quantity': self.quantity,
Expand All @@ -294,6 +297,8 @@ def _get_expense_move_lines_tax_values(self, partner, dp):
'type': 'tax',
'partner_id': partner.id,
'account_id': tax_account_id,
'tax_line_id': tax.id,
'tax_ids': [(6, 0, [])],
'analytic_account_id': analytic_account_id,
'amount': self.tax_amount_company_currency,
'name': self.name.split('\n')[0][:64],
Expand Down Expand Up @@ -415,10 +420,12 @@ def _get_group_key(self, mline, group, i):
key = [
mline['type'],
mline['account_id'],
mline['tax_line_id'],
mline['tax_ids'],
mline['analytic_account_id'],
False]
else:
key = [False, False, False, i]
key = [False, False, False, False, False, i]
return key

@api.model
Expand All @@ -433,6 +440,8 @@ def _prepare_expense_move_lines_values(self, gmlines, dp):
else:
return False
return {
'tax_line_id': gmlines['tax_line_id'],
'tax_ids': gmlines['tax_ids'],
'partner_id': gmlines['partner_id'],
'account_id': gmlines['account_id'],
'analytic_account_id': gmlines['analytic_account_id'],
Expand Down