-
Notifications
You must be signed in to change notification settings - Fork 72
[MIG] l10n_ar_account_tax_settlement_mendoza, l10n_ar_txt_sire: Migration to 18.0 #904
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
Open
pablohmontenegro
wants to merge
1
commit into
ingadhoc:18.0
Choose a base branch
from
adhoc-dev:18.0-t-47856-pam-1
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,4 @@ | ||
| from . import account_move | ||
| from . import afip_activity | ||
| from . import res_company | ||
| from . import account_payment | ||
| from . import account_tax | ||
| from . import account_journal | ||
pablohmontenegro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
35 changes: 13 additions & 22 deletions
35
l10n_ar_account_tax_settlement_mendoza/models/account_journal.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,24 @@ | ||
| from odoo import _, models | ||
| from odoo.exceptions import RedirectWarning | ||
| from odoo.exceptions import UserError | ||
|
|
||
|
|
||
| class AccountJournal(models.Model): | ||
| _inherit = "account.journal" | ||
|
|
||
| def iibb_aplicado_sircar_files_values(self, move_lines): | ||
| """Extendemos este método del original de l10n_ar_account_tax_settlement para mendoza. El objetivo de este método es validar que el impuesto de mendoza tenga código de régimen.""" | ||
| tax_group_id_mendoza_id = self.env.ref("l10n_ar_ux.tax_group_retencion_iibb_za") | ||
| mendoza_lines = move_lines.filtered( | ||
| mendoza_state = self.env.ref("base.state_ar_m") | ||
| if missing_codigo_regimen_mendoza_taxes := move_lines.filtered( | ||
| lambda x: x.payment_id | ||
| and x.tax_line_id.withholding_type == "code" | ||
| and x.tax_group_id == tax_group_id_mendoza_id | ||
| ) | ||
| missing_codigo_regimen = mendoza_lines.filtered(lambda x: not x.payment_id.tax_withholding_id.codigo_regimen) | ||
| if mendoza_lines and missing_codigo_regimen: | ||
| raise RedirectWarning( | ||
| message=_( | ||
| "El impuesto '%s' not tiene código de regimen en solapa 'Opciones avanzadas' campo 'Codigo de regimen IVA'.", | ||
| missing_codigo_regimen.payment_id.tax_withholding_id.name, | ||
| ), | ||
| action={ | ||
| "type": "ir.actions.act_window", | ||
| "res_model": "account.tax", | ||
| "views": [(False, "form")], | ||
| "res_id": mendoza_lines.tax_line_id.id, | ||
| "name": _("Tax"), | ||
| "view_mode": "form", | ||
| }, | ||
| button_text=_("Editar Impuesto"), | ||
| and x.tax_line_id.l10n_ar_state_id == mendoza_state | ||
| and not x.tax_line_id.l10n_ar_code | ||
| ).mapped("tax_line_id"): | ||
| tax_lines = [] | ||
| for mdza_tax in missing_codigo_regimen_mendoza_taxes: | ||
| tax_lines.append(_("ID: %(id)s\t\t- Name: %(name)s", id=mdza_tax.id, name=mdza_tax.display_name)) | ||
| details = _( | ||
| "Los siguientes impuestos de Mendoza no tienen código de régimen (campo 'Código AFIP' l10n_ar_code):\n\n%(taxes)s", | ||
| taxes="\n".join(tax_lines), | ||
| ) | ||
| raise UserError(details) | ||
| return super().iibb_aplicado_sircar_files_values(move_lines) |
27 changes: 0 additions & 27 deletions
27
l10n_ar_account_tax_settlement_mendoza/models/account_payment.py
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
l10n_ar_account_tax_settlement_mendoza/models/account_tax.py
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
l10n_ar_account_tax_settlement_mendoza/views/account_payment_view.xml
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| from . import account_journal | ||
| from . import res_partner | ||
| from . import l10n_ar_payment_withholding | ||
| from . import account_payment |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.