Skip to content

Commit

Permalink
[FIX] hr_expense: correctly migrate expense tax amount field
Browse files Browse the repository at this point in the history
The technical refactor in [1] renamed the tax amount in currency from
`amount_tax` to `tax_amount_currency`. However, in some instances, it
was mistakenly renamed to `tax_amount`, including in the commit
description. This commit corrects this minor oversight.

[1]: odoo@68fbdc96

closes odoo#177318

Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
  • Loading branch information
xmglord committed Aug 22, 2024
1 parent 25b760a commit 76d7a64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions addons/hr_expense/tests/test_expenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def test_expense_main_flow(self):
{'total_amount': 1160.00, 'untaxed_amount': 992.65, 'total_tax_amount': 167.35, 'state': 'draft', 'accounting_date': False},
])
self.assertRecordValues(expense_sheets.expense_line_ids, [
{'total_amount_currency': 1600.00, 'untaxed_amount_currency': 1391.30, 'price_unit': 800.00, 'tax_amount': 208.70, 'state': 'reported'},
{'total_amount_currency': 160.00, 'untaxed_amount_currency': 123.08, 'price_unit': 160.00, 'tax_amount': 36.92, 'state': 'reported'},
{'total_amount_currency': 1000.00, 'untaxed_amount_currency': 869.57, 'price_unit': 1000.00, 'tax_amount': 130.43, 'state': 'reported'},
{'total_amount_currency': 160.00, 'untaxed_amount_currency': 123.08, 'price_unit': 160.00, 'tax_amount': 36.92, 'state': 'reported'},
{'total_amount_currency': 1600.00, 'untaxed_amount_currency': 1391.30, 'price_unit': 800.00, 'tax_amount_currency': 208.70, 'state': 'reported'},
{'total_amount_currency': 160.00, 'untaxed_amount_currency': 123.08, 'price_unit': 160.00, 'tax_amount_currency': 36.92, 'state': 'reported'},
{'total_amount_currency': 1000.00, 'untaxed_amount_currency': 869.57, 'price_unit': 1000.00, 'tax_amount_currency': 130.43, 'state': 'reported'},
{'total_amount_currency': 160.00, 'untaxed_amount_currency': 123.08, 'price_unit': 160.00, 'tax_amount_currency': 36.92, 'state': 'reported'},
])

# Submitting properly change states
Expand Down
2 changes: 1 addition & 1 deletion addons/hr_expense/views/hr_expense_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
widget="many2many_tags"
readonly="not is_editable"
options="{'no_create': True}"/>
<field name="tax_amount"/>
<field name="tax_amount_currency"/>
</div>
<t groups="hr_expense.group_hr_expense_team_approver">
<field name="employee_id" groups="!hr.group_hr_user"
Expand Down

0 comments on commit 76d7a64

Please sign in to comment.