Skip to content

Commit

Permalink
[ADD] tracking on hr.expense
Browse files Browse the repository at this point in the history
  • Loading branch information
Saran440 committed Nov 23, 2021
1 parent ab81972 commit cc84b2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions l10n_th_account_tax_expense/models/hr_expense.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ class HrExpense(models.Model):
bill_partner_id = fields.Many2one(
comodel_name="res.partner",
string="Vendor",
tracking=True,
)
wht_tax_id = fields.Many2one(
comodel_name="account.withholding.tax",
string="WHT",
compute="_compute_wht_tax_id",
store=True,
readonly=False,
tracking=True,
)

@api.onchange("tax_ids", "wht_tax_id")
Expand Down
2 changes: 1 addition & 1 deletion l10n_th_account_tax_expense/views/hr_expense_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<field
name="wht_tax_id"
options="{'no_create': True}"
attrs="{'readonly': [('advance', '=', True)]}"
attrs="{'readonly': ['|', ('advance', '=', True), ('state', 'in', ['post', 'done', 'cancel'])]}"
force_save="1"
/>
</xpath>
Expand Down

0 comments on commit cc84b2a

Please sign in to comment.