mirror of
https://github.com/bringout/oca-ocb-l10n_asia-pacific.git
synced 2026-04-27 06:22:01 +02:00
19.0 vanilla
This commit is contained in:
parent
7dc55599c6
commit
7f43bbbfcc
650 changed files with 45260 additions and 33436 deletions
|
|
@ -0,0 +1,31 @@
|
|||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountPayment(models.Model):
|
||||
_inherit = "account.payment"
|
||||
|
||||
# withholding related fields
|
||||
l10n_in_withhold_move_ids = fields.One2many(
|
||||
'account.move', 'l10n_in_withholding_ref_payment_id',
|
||||
string="Indian Payment TDS Entries",
|
||||
)
|
||||
l10n_in_total_withholding_amount = fields.Monetary(compute='_compute_l10n_in_total_withholding_amount')
|
||||
l10n_in_tds_feature_enabled = fields.Boolean(related='company_id.l10n_in_tds_feature')
|
||||
|
||||
def _compute_l10n_in_total_withholding_amount(self):
|
||||
for payment in self:
|
||||
if payment.company_id.l10n_in_tds_feature:
|
||||
payment.l10n_in_total_withholding_amount = sum(payment.l10n_in_withhold_move_ids.filtered(
|
||||
lambda m: m.state == 'posted').l10n_in_withholding_line_ids.mapped('l10n_in_withhold_tax_amount'))
|
||||
else:
|
||||
payment.l10n_in_total_withholding_amount = 0.0
|
||||
|
||||
def action_l10n_in_withholding_entries(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
'name': "TDS Entries",
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'account.move',
|
||||
'view_mode': 'list,form',
|
||||
'domain': [('id', 'in', self.l10n_in_withhold_move_ids.ids)],
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue