Skip to content

Commit

Permalink
[FIX] l10n_th_account_tax
Browse files Browse the repository at this point in the history
  • Loading branch information
ps-tubtim authored and Saran440 committed Nov 12, 2021
1 parent 39c3158 commit 0b480d5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions l10n_th_account_tax/models/account_withholding_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class AccountWithholdingMove(models.Model):
WHT_CERT_INCOME_TYPE,
string="Type of Income",
)
wht_cert_income_desc = fields.Char(
string="Income Description",
size=500,
)
currency_id = fields.Many2one(
comodel_name="res.currency",
default=lambda self: self.env.user.company_id.currency_id,
Expand All @@ -82,3 +86,11 @@ def _compute_move_data(self):
rec.date = rec.move_id and rec.move_id.date or False
rec.calendar_year = rec.date and rec.date.strftime("%Y")
rec.payment_id = rec.move_id.payment_id

@api.onchange("wht_cert_income_type")
def _onchange_wht_cert_income_type(self):
if self.wht_cert_income_type:
select_dict = dict(WHT_CERT_INCOME_TYPE)
self.wht_cert_income_desc = select_dict[self.wht_cert_income_type]
else:
self.wht_cert_income_desc = False
1 change: 1 addition & 0 deletions l10n_th_account_tax/views/account_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
<field name="calendar_year" invisible="1" />
<field name="partner_id" readonly="1" />
<field name="wht_cert_income_type" />
<field name="wht_cert_income_desc" optional="show" />
<field name="amount_income" />
<field name="amount_wht" />
<field name="is_pit" />
Expand Down
1 change: 1 addition & 0 deletions l10n_th_account_tax/views/account_payment_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<field name="calendar_year" invisible="1" />
<field name="partner_id" readonly="1" />
<field name="wht_cert_income_type" />
<field name="wht_cert_income_desc" optional="show" />
<field name="amount_income" />
<field name="amount_wht" />
<field name="is_pit" />
Expand Down
1 change: 1 addition & 0 deletions l10n_th_account_tax/views/account_withholding_move.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<field name="date" optional="show" />
<field name="calendar_year" optional="show" />
<field name="wht_cert_income_type" />
<field name="wht_cert_income_desc" optional="show" />
<field name="amount_income" sum="Total Income" />
<field name="amount_wht" sum="Total Amount Withholding Tax" />
<field name="cancelled" optional="show" />
Expand Down
2 changes: 1 addition & 1 deletion l10n_th_account_tax/views/withholding_tax_cert.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<tree editable="bottom">
<field name="company_id" invisible="1" />
<field name="wht_cert_income_type" />
<field name="wht_cert_income_desc" />
<field name="wht_cert_income_desc" optional="show" />
<field name="amount" sum="Total Tax" />
<field name="wht_tax_id" optional="hide" />
<field name="wht_percent" required="1" />
Expand Down

0 comments on commit 0b480d5

Please sign in to comment.