| 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 |
from odoo import fields, models, api |
| 3 |
|
| 4 |
|
| 5 |
class AccountMove(models.Model): |
| 6 |
_inherit = 'account.move' |
| 7 |
|
| 8 |
l10n_ar_withholding_ids = fields.One2many( |
| 9 |
'account.move.line', 'move_id', string='Withholdings', |
| 10 |
compute='_compute_l10n_ar_withholding_ids', |
| 11 |
readonly=True |
| 12 |
) |
| 13 |
|
| 14 |
@api.depends('line_ids') |
| 15 |
def _compute_l10n_ar_withholding_ids(self): |
| 16 |
for move in self: |
| 17 |
move.l10n_ar_withholding_ids = move.line_ids.filtered(lambda l: l.tax_line_id.l10n_ar_withholding_payment_type) |