-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] l10n_mx_res_partner_csf_regime (#561)
[ADD] l10n_mx_res_partner_csf_regime
- Loading branch information
1 parent
ba4fadf
commit 3745dfc
Showing
9 changed files
with
101 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
**This file is going to be generated by oca-gen-addon-readme.** | ||
|
||
*Manual changes will be overwritten.* | ||
|
||
Please provide content in the ``readme`` directory: | ||
|
||
* **DESCRIPTION.rst** (required) | ||
* INSTALL.rst (optional) | ||
* CONFIGURE.rst (optional) | ||
* **USAGE.rst** (optional, highly recommended) | ||
* DEVELOP.rst (optional) | ||
* ROADMAP.rst (optional) | ||
* HISTORY.rst (optional, recommended) | ||
* **CONTRIBUTORS.rst** (optional, highly recommended) | ||
* CREDITS.rst (optional) | ||
|
||
Content of this README will also be drawn from the addon manifest, | ||
from keys such as name, authors, maintainers, development_status, | ||
and license. | ||
|
||
A good, one sentence summary in the manifest is also highly recommended. | ||
|
||
|
||
Automatic changelog generation | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
`HISTORY.rst` can be auto generated using `towncrier <https://pypi.org/project/towncrier>`_. | ||
|
||
Just put towncrier compatible changelog fragments into `readme/newsfragments` | ||
and the changelog file will be automatically generated and updated when a new fragment is added. | ||
|
||
Please refer to `towncrier` documentation to know more. | ||
|
||
NOTE: the changelog will be automatically generated when using `/ocabot merge $option`. | ||
If you need to run it manually, refer to `OCA/maintainer-tools README <https://github.com/OCA/maintainer-tools>`_. |
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import wizard |
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (C) 2023 Open Source Integrators (https://www.opensourceintegrators.com) | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
{ | ||
"name": "Mexican Localization Fiscal Regime Scan From CSF", | ||
"version": "16.0.1.0.0", | ||
"license": "LGPL-3", | ||
"summary": "Mexican Localization Fiscal Regime Scan From CSF", | ||
"author": "Open Source Integrators", | ||
"maintainer": "Open Source Integrators", | ||
"website": "https://github.com/ursais/osi-addons", | ||
"depends": [ | ||
"contacts", | ||
"l10n_mx_edi_40", | ||
"l10n_mx_res_partner_csf", | ||
], | ||
"external_dependencies": { | ||
"python": ["pdfminer.six==20220319"], | ||
}, | ||
"application": False, | ||
"maintainers": ["ursais"], | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import import_csf |
This file contains 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from odoo import models | ||
|
||
FISCAL_REGIMES_MAPPING = { | ||
"Régimen General de Ley Personas Morales": "601", | ||
"Régimen de Sueldos y Salarios e Ingresos Asimilados a Salarios": "605", | ||
"Régimen de los demás ingresos": "608", | ||
"Régimen de Ingresos por Dividendos (socios y accionistas)": "611", | ||
"Régimen de las Personas Físicas con Actividades Empresariales y Profesionales": "612", | ||
"Régimen de los ingresos por intereses": "614", | ||
"Régimen de Incorporación Fiscal": "621", | ||
"Régimen de las Actividades Empresariales " | ||
"con ingresos a través de Plataformas Tecnológicas": "625", | ||
"Régimen de las Actividades Empresariales " | ||
"con ingresos a través de Plataformas Tecnológicas.": "625", | ||
"Régimen Simplificado de Confianza": "626", | ||
} | ||
|
||
|
||
class ImportCSF(models.TransientModel): | ||
_inherit = "import.csf" | ||
|
||
def prepare_res_partner_values(self, text): | ||
vals = super().prepare_res_partner_values(text) | ||
split_data = text.split("\n") | ||
fiscal_regime = "" | ||
for index, _line in enumerate(split_data): | ||
if split_data[index].strip() in FISCAL_REGIMES_MAPPING.keys(): | ||
fiscal_regime = split_data[index].strip() | ||
fiscal_regime = FISCAL_REGIMES_MAPPING[fiscal_regime] | ||
vals.update( | ||
{ | ||
"l10n_mx_edi_fiscal_regime": fiscal_regime, | ||
} | ||
) | ||
return vals |
This file contains 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 +1,2 @@ | ||
# generated from manifests external_dependencies | ||
pdfminer.six==20220319 |
1 change: 1 addition & 0 deletions
1
setup/l10n_mx_res_partner_csf_regime/odoo/addons/l10n_mx_res_partner_csf_regime
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../l10n_mx_res_partner_csf_regime |
This file contains 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |