-
Notifications
You must be signed in to change notification settings - Fork 248
[IMP] l10n_ar_tax: agregado de etiquetas y secuencias a impuestos de ret ganancias. #1326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 18.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -71,9 +71,9 @@ def _add_wh_taxes(self, company): | |||||||
| ] | ||||||||
| for tax_ref, state_ref in tax_state_tupples: | ||||||||
| # Identificamos el impuesto al que se le va a agregar la/s etiqueta/s | ||||||||
| tax = self.env.ref("account.%s_%s" % (company.id, tax_ref), raise_if_not_found=False) | ||||||||
| if tax: | ||||||||
| tax.l10n_ar_state_id = self.env.ref(state_ref).id | ||||||||
| if tax := self.env.ref("account.%s_%s" % (company.id, tax_ref), raise_if_not_found=False): | ||||||||
| if not tax.l10n_ar_state_id: | ||||||||
| tax.l10n_ar_state_id = self.env.ref(state_ref).id | ||||||||
|
|
||||||||
| # creacion de secuencias y agregado de etiquetas para liquidación de impuestos | ||||||||
| withholdings_domain = [ | ||||||||
|
|
@@ -85,31 +85,36 @@ def _add_wh_taxes(self, company): | |||||||
| non_profits_domain = withholdings_domain + [("l10n_ar_tax_type", "not in", ["earnings", "earnings_scale"])] | ||||||||
|
|
||||||||
| for tax in self.env["account.tax"].with_context(active_test=False).search(non_profits_domain): | ||||||||
| if not tax.l10n_ar_withholding_sequence_id: | ||||||||
| sequence_name = (tax.invoice_label or tax.name).replace("0", "").replace("%", "") | ||||||||
| sequence = self.env["ir.sequence"].create( | ||||||||
| { | ||||||||
| "name": sequence_name, | ||||||||
| "prefix": "%(year)s-", | ||||||||
| "padding": 8, | ||||||||
| "number_increment": 1, | ||||||||
| "implementation": "standard", | ||||||||
| "company_id": company.id, | ||||||||
| } | ||||||||
| ) | ||||||||
| tax.l10n_ar_withholding_sequence_id = sequence.id | ||||||||
|
|
||||||||
| profits_domain = withholdings_domain + [("l10n_ar_tax_type", "in", ["earnings", "earnings_scale"])] | ||||||||
| profits_taxes = self.env["account.tax"].with_context(active_test=False).search(profits_domain) | ||||||||
| # Todos los impuestos de retención de ganancias deben compartir la misma secuencia | ||||||||
| if not all(prof_tax.l10n_ar_withholding_sequence_id for prof_tax in profits_taxes): | ||||||||
| sequence = self.env["ir.sequence"].create( | ||||||||
|
pablohmontenegro marked this conversation as resolved.
|
||||||||
| { | ||||||||
| "name": tax.invoice_label or tax.name, | ||||||||
| "name": "Retención de Ganancias", | ||||||||
|
pablohmontenegro marked this conversation as resolved.
|
||||||||
| "prefix": "%(year)s-", | ||||||||
| "padding": 8, | ||||||||
| "number_increment": 1, | ||||||||
| "implementation": "standard", | ||||||||
| "company_id": company.id, | ||||||||
| } | ||||||||
| ) | ||||||||
| tax.l10n_ar_withholding_sequence_id = sequence.id | ||||||||
|
|
||||||||
| profits_domain = withholdings_domain + [("l10n_ar_tax_type", "in", ["earnings", "earnings_scale"])] | ||||||||
| sequence = self.env["ir.sequence"].create( | ||||||||
| { | ||||||||
| "name": "Retención de Ganancias", | ||||||||
| "prefix": "%(year)s-", | ||||||||
| "padding": 8, | ||||||||
| "number_increment": 1, | ||||||||
| "implementation": "standard", | ||||||||
| "company_id": company.id, | ||||||||
| } | ||||||||
| ) | ||||||||
| profits_taxes = self.env["account.tax"].with_context(active_test=False).search(profits_domain) | ||||||||
| profits_taxes.l10n_ar_withholding_sequence_id = sequence.id | ||||||||
| for prof_tax in profits_taxes.filtered(lambda tax: not tax.l10n_ar_withholding_sequence_id): | ||||||||
| prof_tax.l10n_ar_withholding_sequence_id = sequence.id | ||||||||
|
Comment on lines
+116
to
+117
|
||||||||
| for prof_tax in profits_taxes.filtered(lambda tax: not tax.l10n_ar_withholding_sequence_id): | |
| prof_tax.l10n_ar_withholding_sequence_id = sequence.id | |
| profits_taxes.filtered(lambda tax: not tax.l10n_ar_withholding_sequence_id).l10n_ar_withholding_sequence_id = sequence.id |
Uh oh!
There was an error while loading. Please reload this page.