Skip to content

Commit ba679fc

Browse files
authored
Refactor tax calculation logic in hr_expense.py
1 parent 1653c64 commit ba679fc

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

hr_expense_tax_adjust/models/hr_expense.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ def _get_expense_price_tax(self):
3333
@api.depends("currency_id", "tax_ids", "total_amount", "unit_amount", "quantity")
3434
def _compute_amount_price_tax(self):
3535
for expense in self:
36-
if not expense.tax_adjust:
37-
price_tax = expense._get_expense_price_tax()
38-
expense.price_tax = price_tax
3936
if not expense.tax_ids:
4037
expense.price_tax = 0.0
38+
continue
39+
40+
if not expense.tax_adjust:
41+
expense.price_tax = expense._get_expense_price_tax()
4142

4243
@api.onchange("price_tax", "tax_ids", "total_amount", "unit_amount", "quantity")
4344
def _onchange_price_tax(self):

0 commit comments

Comments
 (0)