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 2523cf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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
4 changes: 2 additions & 2 deletions l10n_th_account_tax_expense/views/hr_expense_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
<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>
<xpath expr="//field[@name='payment_mode']" position="attributes">
<attribute
name="attrs"
>{'readonly': [('advance', '=', True)]}</attribute>
>{'readonly': ['|', ('advance', '=', True), ('state', 'in', ['done', 'approved', 'reported'])]}</attribute>
<attribute name="force_save">1</attribute>
</xpath>
</field>
Expand Down

0 comments on commit 2523cf9

Please sign in to comment.