Wrong Argentina withholding payment date behaviour
Nobody has claimed this yet.
- Dominant language
- reStructuredText
- Stars
- 1.3k
- Forks
- 12.1k
- PR merge metrics
- No merged PRs in 30d
Description
In Argentina pay witholding documentation To date and From do not do what they say. In account_payment_register.py:132-144 it says that withholding will not be applied if date is after from_date (or from_date is empty) or if date is before to_date, which is exactly the opposite of what documentation says.
@api.depends('partner_id', 'payment_date')
def _compute_l10n_ar_withholding_ids(self):
for wizard in self:
date = wizard.payment_date or fields.Date.context_today(self)
partner_taxes = self.env['l10n_ar.partner.tax'].search([
*self.env['l10n_ar.partner.tax']._check_company_domain(wizard.company_id),
'|', ('from_date', '>=', date), ('from_date', '=', False),
'|', ('to_date', '<=', date), ('to_date', '=', False),
('partner_id', '=', wizard.partner_id.commercial_partner_id.id),
('tax_id.l10n_ar_withholding_payment_type', '=', wizard.partner_type),
('tax_id.active', '=', True)
])
wizard.l10n_ar_withholding_ids = [Command.clear()] + [Command.create({'tax_id': x.tax_id.id}) for x in partner_taxes]
It could be a bug in code, but I think that from_date and to_date were intended to set an exemption for this withholding, that is when that withholding does not to apply to a specific range because tax Agency wanted to make an exemption.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Argentina withholding documentation and account_payment_register.py:132-144, comparing the documented To date and From date behavior with the shown search conditions. Determine whether the documentation or the implementation reflects the intended exemption semantics; done means the intended date range is unambiguous and the affected source or documentation is updated accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100