From a9279454e1d2f773fcba0199684542990dbb5970 Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Fri, 2 Dec 2022 16:21:19 -0300 Subject: [PATCH 1/8] [ADD] l10n_uy_account: Adapt for Retentions * add tax group for retentions * add uy code field in taxes --- l10n_uy_account/__manifest__.py | 3 ++- l10n_uy_account/data/account_tax_group_data.xml | 4 ++++ l10n_uy_account/models/__init__.py | 1 + l10n_uy_account/models/account_tax.py | 7 +++++++ l10n_uy_account/views/account_tax_views.xml | 15 +++++++++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 l10n_uy_account/models/account_tax.py create mode 100644 l10n_uy_account/views/account_tax_views.xml diff --git a/l10n_uy_account/__manifest__.py b/l10n_uy_account/__manifest__.py index a84f028d..5f1f0d4a 100644 --- a/l10n_uy_account/__manifest__.py +++ b/l10n_uy_account/__manifest__.py @@ -7,7 +7,7 @@ 'author': 'ADHOC SA', 'category': 'Localization', 'license': 'LGPL-3', - 'version': "15.0.1.1.0", + 'version': "15.0.1.2.0", 'depends': [ 'l10n_latam_invoice_document', 'l10n_latam_base', @@ -32,6 +32,7 @@ 'views/account_journal_view.xml', 'views/res_company_view.xml', 'views/l10n_uy_adenda_views.xml', + 'views/account_tax_views.xml', 'data/account_chart_template_data2.xml', 'data/res.country.state.csv', 'data/res_currency_data.xml', diff --git a/l10n_uy_account/data/account_tax_group_data.xml b/l10n_uy_account/data/account_tax_group_data.xml index 5a5b2f83..9355dca2 100644 --- a/l10n_uy_account/data/account_tax_group_data.xml +++ b/l10n_uy_account/data/account_tax_group_data.xml @@ -15,4 +15,8 @@ VAT Exempt + + Retenciones UY + + diff --git a/l10n_uy_account/models/__init__.py b/l10n_uy_account/models/__init__.py index 17e299c3..e2008f77 100644 --- a/l10n_uy_account/models/__init__.py +++ b/l10n_uy_account/models/__init__.py @@ -10,3 +10,4 @@ from . import res_partner from . import l10n_uy_adenda from . import l10n_latam_document_type +from . import account_tax diff --git a/l10n_uy_account/models/account_tax.py b/l10n_uy_account/models/account_tax.py new file mode 100644 index 00000000..97fd52f3 --- /dev/null +++ b/l10n_uy_account/models/account_tax.py @@ -0,0 +1,7 @@ +from odoo import fields, models + + +class AccountTax(models.Model): + _inherit = 'account.tax' + + l10n_uy_dgi_code = fields.Char('DGI Code') diff --git a/l10n_uy_account/views/account_tax_views.xml b/l10n_uy_account/views/account_tax_views.xml new file mode 100644 index 00000000..976d751a --- /dev/null +++ b/l10n_uy_account/views/account_tax_views.xml @@ -0,0 +1,15 @@ + + + + + account.tax.form + account.tax + + + + + + + + + From ece52f0144a3c141947a217b78a75c1b275bcb1c Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Fri, 2 Dec 2022 17:52:25 -0300 Subject: [PATCH 2/8] [ADD] l10n_uy_edi: Retenciones / Reguardos - add retenciones menu and resguardo field to aml - nuevo modelo para los resguardos, con su respectivo vistas y menu --- l10n_uy_edi/__manifest__.py | 3 +- l10n_uy_edi/models/__init__.py | 2 + l10n_uy_edi/models/account_move_line.py | 8 ++++ l10n_uy_edi/models/l10n_uy_resguardo.py | 19 +++++++++ l10n_uy_edi/views/account_move_line_views.xml | 41 +++++++++++++++++++ 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 l10n_uy_edi/models/account_move_line.py create mode 100644 l10n_uy_edi/models/l10n_uy_resguardo.py create mode 100644 l10n_uy_edi/views/account_move_line_views.xml diff --git a/l10n_uy_edi/__manifest__.py b/l10n_uy_edi/__manifest__.py index b726c0e9..7a3dde3f 100644 --- a/l10n_uy_edi/__manifest__.py +++ b/l10n_uy_edi/__manifest__.py @@ -7,7 +7,7 @@ 'author': 'ADHOC SA', 'category': 'Localization', 'license': 'LGPL-3', - 'version': '15.0.1.2.0', + 'version': '15.0.1.3.0', 'depends': [ 'l10n_uy_account', 'account_debit_note', @@ -21,6 +21,7 @@ 'views/res_config_settings_view.xml', 'views/account_move_views.xml', 'views/res_company_views.xml', + 'views/account_move_line_views.xml', 'wizards/res_partner_update_from_padron_uy_wizard_view.xml', 'views/res_partner_view.xml', 'data/cfe_template.xml', diff --git a/l10n_uy_edi/models/__init__.py b/l10n_uy_edi/models/__init__.py index 552225c0..e55885da 100644 --- a/l10n_uy_edi/models/__init__.py +++ b/l10n_uy_edi/models/__init__.py @@ -6,3 +6,5 @@ from . import account_journal from . import account_tax from . import res_partner +from . import account_move_line +from . import l10n_uy_resguardo diff --git a/l10n_uy_edi/models/account_move_line.py b/l10n_uy_edi/models/account_move_line.py new file mode 100644 index 00000000..d961e7fd --- /dev/null +++ b/l10n_uy_edi/models/account_move_line.py @@ -0,0 +1,8 @@ +from odoo import fields, models + + +class AccountMoveTax(models.Model): + + _inherit = 'account.move.line' + + resguardo_id = fields.Many2one('l10n.uy.resguardo') diff --git a/l10n_uy_edi/models/l10n_uy_resguardo.py b/l10n_uy_edi/models/l10n_uy_resguardo.py new file mode 100644 index 00000000..dfaee5e1 --- /dev/null +++ b/l10n_uy_edi/models/l10n_uy_resguardo.py @@ -0,0 +1,19 @@ +from odoo import fields, models + + +class L10nUyResguardo(models.AbstractModel): + + _name = 'l10n.uy.resguardo' + _inherit = ['l10n.uy.cfe'] + _description = 'Resguardos (UY)' + + company_id = fields.Many2one("res.company", default=lambda self: self.env.company) + aml_id = fields.One2many('account.move.line', 'resguardo_id') + date = fields.Date() + partner_id = fields.Many2one('res.partner', compute="compute_aml_vals") + currency_id = fields.Many2one('res.currency', compute="compute_aml_vals") + + def compute_aml_vals(self): + for rec in self: + rec.partner_id = False + rec.currency_id = False diff --git a/l10n_uy_edi/views/account_move_line_views.xml b/l10n_uy_edi/views/account_move_line_views.xml new file mode 100644 index 00000000..8b807bd3 --- /dev/null +++ b/l10n_uy_edi/views/account_move_line_views.xml @@ -0,0 +1,41 @@ + + + + + account.move.line.tree + account.move.line + + primary + + + + + + + + + account.move.line.search + account.move.line + + primary + + + + + + + + + + Retenciones UY + account.move.line + form,tree + + + + {'search_default_without_resguardo':1} + + + + + From c9864ec643be89a858738a66fce4b076a779f950 Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Fri, 30 Dec 2022 13:38:49 -0300 Subject: [PATCH 3/8] fixing with abstract --- l10n_uy_account/data/account_tax_group_data.xml | 2 +- l10n_uy_edi/__manifest__.py | 1 + l10n_uy_edi/models/l10n_uy_resguardo.py | 16 +++++++++++++++- l10n_uy_edi/security/ir.model.access.csv | 1 + l10n_uy_edi/views/account_move_line_views.xml | 4 ++-- l10n_uy_edi/views/l10n_uy_resguardo_views.xml | 12 ++++++++++++ 6 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 l10n_uy_edi/views/l10n_uy_resguardo_views.xml diff --git a/l10n_uy_account/data/account_tax_group_data.xml b/l10n_uy_account/data/account_tax_group_data.xml index 9355dca2..36a23f51 100644 --- a/l10n_uy_account/data/account_tax_group_data.xml +++ b/l10n_uy_account/data/account_tax_group_data.xml @@ -16,7 +16,7 @@ - Retenciones UY + Retenciones (UY) diff --git a/l10n_uy_edi/__manifest__.py b/l10n_uy_edi/__manifest__.py index 7a3dde3f..30274350 100644 --- a/l10n_uy_edi/__manifest__.py +++ b/l10n_uy_edi/__manifest__.py @@ -22,6 +22,7 @@ 'views/account_move_views.xml', 'views/res_company_views.xml', 'views/account_move_line_views.xml', + 'views/l10n_uy_resguardo_views.xml', 'wizards/res_partner_update_from_padron_uy_wizard_view.xml', 'views/res_partner_view.xml', 'data/cfe_template.xml', diff --git a/l10n_uy_edi/models/l10n_uy_resguardo.py b/l10n_uy_edi/models/l10n_uy_resguardo.py index dfaee5e1..13231df7 100644 --- a/l10n_uy_edi/models/l10n_uy_resguardo.py +++ b/l10n_uy_edi/models/l10n_uy_resguardo.py @@ -1,12 +1,15 @@ from odoo import fields, models -class L10nUyResguardo(models.AbstractModel): +class L10nUyResguardo(models.Model): _name = 'l10n.uy.resguardo' _inherit = ['l10n.uy.cfe'] _description = 'Resguardos (UY)' + name = fields.Char() + l10n_latam_document_type_id = fields.Many2one('l10n_latam.document.type', string='Document Type', copy=False) + l10n_latam_document_number = fields.Char(string='Document Number', readonly=True, states={'draft': [('readonly', False)]}, copy=False) company_id = fields.Many2one("res.company", default=lambda self: self.env.company) aml_id = fields.One2many('account.move.line', 'resguardo_id') date = fields.Date() @@ -17,3 +20,14 @@ def compute_aml_vals(self): for rec in self: rec.partner_id = False rec.currency_id = False + + def name_get(self): + """ Display: 'Document Type Prefix : Document number' if not / """ + res = [] + for rec in self: + if rec.l10n_latam_document_number: + name = "(%s %s)" % (rec.l10n_latam_document_type_id.doc_code_prefix, rec.l10n_latam_document_number) + else: + name = '/' + res.append((rec.id, name)) + return res diff --git a/l10n_uy_edi/security/ir.model.access.csv b/l10n_uy_edi/security/ir.model.access.csv index 6a42e07a..1153af4e 100644 --- a/l10n_uy_edi/security/ir.model.access.csv +++ b/l10n_uy_edi/security/ir.model.access.csv @@ -1,3 +1,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink l10n_uy_edi.access_res_partner_update_from_padron_uy_field,access_res_partner_update_from_padron_uy_field,l10n_uy_edi.model_res_partner_update_from_padron_uy_field,base.group_user,1,1,1,1 l10n_uy_edi.access_res_partner_update_from_padron_uy_wizard,access_res_partner_update_from_padron_uy_wizard,l10n_uy_edi.model_res_partner_update_from_padron_uy_wizard,base.group_user,1,1,1,1 +l10n_uy_edi.access_l10n_uy_resguardo,access_l10n_uy_resguardo,l10n_uy_edi.model_l10n_uy_resguardo,base.group_user,1,1,1,1 diff --git a/l10n_uy_edi/views/account_move_line_views.xml b/l10n_uy_edi/views/account_move_line_views.xml index 8b807bd3..39c2d89b 100644 --- a/l10n_uy_edi/views/account_move_line_views.xml +++ b/l10n_uy_edi/views/account_move_line_views.xml @@ -27,7 +27,7 @@ - Retenciones UY + Retenciones (UY) account.move.line form,tree @@ -36,6 +36,6 @@ {'search_default_without_resguardo':1} - + diff --git a/l10n_uy_edi/views/l10n_uy_resguardo_views.xml b/l10n_uy_edi/views/l10n_uy_resguardo_views.xml new file mode 100644 index 00000000..13e0b291 --- /dev/null +++ b/l10n_uy_edi/views/l10n_uy_resguardo_views.xml @@ -0,0 +1,12 @@ + + + + + Resguardos (UY) + l10n.uy.resguardo + form,tree + + + + + From b352b6f4c7ca1a054161d2341bad53dc69c2ceee Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Fri, 30 Dec 2022 13:59:24 -0300 Subject: [PATCH 4/8] l10n_uy_account: tax type logic and data --- l10n_uy_account/__manifest__.py | 2 + l10n_uy_account/data/l10n.uy.tax.type.csv | 117 ++++++++++++++++++ l10n_uy_account/models/__init__.py | 1 + l10n_uy_account/models/account_tax.py | 2 +- l10n_uy_account/models/l10n_uy_tax_type.py | 30 +++++ l10n_uy_account/security/ir.model.access.csv | 1 + .../views/l10n_uy_tax_type_views.xml | 38 ++++++ 7 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 l10n_uy_account/data/l10n.uy.tax.type.csv create mode 100644 l10n_uy_account/models/l10n_uy_tax_type.py create mode 100644 l10n_uy_account/views/l10n_uy_tax_type_views.xml diff --git a/l10n_uy_account/__manifest__.py b/l10n_uy_account/__manifest__.py index 5f1f0d4a..6a3a5dae 100644 --- a/l10n_uy_account/__manifest__.py +++ b/l10n_uy_account/__manifest__.py @@ -27,12 +27,14 @@ 'data/res_partner_data.xml', 'data/account_fiscal_position_template_data.xml', 'data/l10n_uy_adenda_data.xml', + 'data/l10n.uy.tax.type.csv', 'views/l10n_latam_document_type_views.xml', 'views/account_move_views.xml', 'views/account_journal_view.xml', 'views/res_company_view.xml', 'views/l10n_uy_adenda_views.xml', 'views/account_tax_views.xml', + 'views/l10n_uy_tax_type_views.xml', 'data/account_chart_template_data2.xml', 'data/res.country.state.csv', 'data/res_currency_data.xml', diff --git a/l10n_uy_account/data/l10n.uy.tax.type.csv b/l10n_uy_account/data/l10n.uy.tax.type.csv new file mode 100644 index 00000000..0a3098d1 --- /dev/null +++ b/l10n_uy_account/data/l10n.uy.tax.type.csv @@ -0,0 +1,117 @@ +id,form,code,name,retention +tax_code_2181_1,2181,1,IVA Compras de Importacion, +tax_code_2181_2,2181,2,IVA Retenido Personas Exterior, +tax_code_2181_3,2181,3,IVA Autoconsumo, +tax_code_2181_10,2181,10,Compras plaza a territorio no franco, +tax_code_2181_11,2181,11,Compras plaza a usuarios Zona Franca, +tax_code_2181_12,2181,12,Compras al exterior, +tax_code_2181_20,2181,20,Ventas plaza a territorio no franco, +tax_code_2181_21,2181,21,Ventas plaza a zona franca (Usuarios y Otros), +tax_code_2181_22,2181,22,Ventas al exterior, +tax_code_2181_30,2181,30,Faena de aves-Pago a cta. IVA/COFIS 1º 10 dias, +tax_code_2181_31,2181,31,Faena de aves-Pago a cta. Percepciones 1º 10 dias, +tax_code_2181_32,2181,32,Faena de aves-Pago a cta. IVA/COFIS 2º 10 dias, +tax_code_2181_33,2181,33,Faena de aves-Pago a cta. percepciones 2º 10 dias, +tax_code_2181_34,2181,34,Faena de aves-Pago a cta. IVA/COFIS 3º 10 dias, +tax_code_2181_35,2181,35,Faena de aves-Pago a cta. percepciones 3º 10 dias, +tax_code_2181_401,2181,401,IVA Compras de Proveedores, +tax_code_2181_402,2181,402,Retenciones y/o Percep. Deducidas IVA-OTT, +tax_code_2181_403,2181,403,Retenciones y/o Percep. Deducidas IRAE- IMP. PAT., +tax_code_2181_404,2181,404,Retenciones y/o Percep. Deducidas IMP. COMISIONES, +tax_code_2181_410,2181,410,Reducción Alícuota Ley 17934(5 puntos)- Reg. Gral., +tax_code_2181_502,2181,502,IVA Ventas Tasa Básica a Contribuyentes, +tax_code_2181_503,2181,503,IVA Ventas Tasa Mínima a Contribuyentes, +tax_code_2181_504,2181,504,Compras Plaza Exentas de IVA, +tax_code_2181_505,2181,505,IVA Compras Plaza Tasa Basica, +tax_code_2181_506,2181,506,IVA Compras Plaza Tasa Minima, +tax_code_2181_507,2181,507,IVA Ventas tasa 10% a Contribuyentes, +tax_code_2181_508,2181,508,IVA Compras Plaza Tasa 10%., +tax_code_2181_510,2181,510,Monotributo - Ventas tarjetas de crédito, +tax_code_2181_601,2181,601,Compras plaza - Proveedores con RUC, +tax_code_2181_602,2181,602,Ventas plaza - Clientes con RUC, +tax_code_2181_405,2181,405,Retenciones y/o Percep. Deducidas IMEBA, +tax_code_2181_406,2181,406,Retenciones y/o Percep. Deducidas IRPF, +tax_code_2181_509,2181,509,IVA Ventas - Bancos, +tax_code_2181_13,2181,13,IVA compras combustible, +tax_code_2181_511,2181,511,Proveedores de servicios de depósito - Dto 331/09, +tax_code_2181_512,2181,512,Proveedores de servicio de frío - Dto. 331/009, +tax_code_2181_513,2181,513,Compras a Cont. Monotributo(Res.549/11-Dec.220/12), +tax_code_2181_450,2181,450,IVA - Importación de Explosivos, +tax_code_2181_451,2181,451,Anticipo IVA - Importación de Explosivos, +tax_code_2181_411,2181,411,Reducción Alícuota Art.5 Dec.288/012, +tax_code_2181_421,2181,421,Reducción Alícuota Art.6 Dec.288/012, +tax_code_2181_412,2181,412,Créd. Arrendamiento Terminales Art.12 Dec.288/012, +tax_code_2181_422,2181,422,Créd. Arrendamiento Terminales Art.13 Dec.288/012, +tax_code_2181_413,2181,413,Reducción total IVA Turistas no Res. - Reg. Gral., +tax_code_2181_414,2181,414,Crédito Arrendamiento a Turistas no Residentes, +tax_code_2181_409,2181,409,Créditos Deducidos, +tax_code_2181_350,2181,350,CFE - Infraestructura - Equipamiento Central, +tax_code_2181_351,2181,351,CFE - Infraestructura - Equipamiento Departamental, +tax_code_2181_352,2181,352,CFE - Infraestructura - Equipos de puntos de venta, +tax_code_2181_353,2181,353,CFE - Infraestructura - Red LAN, +tax_code_2181_354,2181,354,CFE - Infraestructura - Red WAN, +tax_code_2181_355,2181,355,CFE - Infraestructura - Equipos de Seguridad, +tax_code_2181_356,2181,356,CFE - Infraestructura - Equipamiento Auxiliar, +tax_code_2181_357,2181,357,CFE - Infraestructura - Otros elementos necesarios, +tax_code_2181_358,2181,358,CFE - Software - Software de Base, +tax_code_2181_359,2181,359,CFE - Software - Aplicativos de terceros, +tax_code_2181_59,2181,59,CFE - Software - Aplicativos propios, +tax_code_2181_480,2181,480,Créd. productor agrop. - imp. enaj. semovientes, +tax_code_2181_514,2181,514,Gastos Publicidad - Art.42 Bis Decreto 150/007, +tax_code_2181_81,2181,81,IVA Contribuyente - 5 de Oro, +tax_code_2181_82,2181,82,IVA Contribuyente - Tómbola, +tax_code_2181_83,2181,83,IVA Contribuyente - Quiniela, +tax_code_2181_84,2181,84,IVA Contribuyente - Quiniela Instantánea, +tax_code_2181_85,2181,85,IVA Contribuyente - Kini, +tax_code_2181_86,2181,86,IVA Contribuyente - Supermatch, +tax_code_2181_415,2181,415,Reducción del IVA - ART.10 DEC. 203/014, +tax_code_2181_425,2181,425,Reducción del IVA - Art.13 Dec. 203/014, +tax_code_2181_40,2181,40,Reducción del IVA - Decreto Nº 203/014, +tax_code_2181_50,2181,50,CFE - Infraestructura - Equip. Central- Prov. Ext., +tax_code_2181_51,2181,51,CFE - Infraestructura - Equip. Depart.- Prov. Ext., +tax_code_2181_52,2181,52,CFE-Infra.- Equipos de puntos de venta- Prov. Ext., +tax_code_2181_53,2181,53,CFE - Infraestructura - Red LAN - Prov. Ext., +tax_code_2181_54,2181,54,CFE - Infraestructura - Red WAN - Prov. Ext., +tax_code_2181_55,2181,55,CFE - Infraest.- Equipos de Seguridad - Prov. Ext., +tax_code_2181_56,2181,56,CFE - Infraest. - Equip. Auxiliar - Prov. Ext., +tax_code_2181_57,2181,57,CFE - Infraest.- Otros elementos neces.- Prov. Ext, +tax_code_2181_58,2181,58,CFE - Software - Software de Base - Prov. Ext., +tax_code_2181_60,2181,60,CFE - Software - Aplicativos de terc. - Prov. Ext., +tax_code_2181_690,2181,690,Venta por cuenta ajena - Tasa básica, +tax_code_2181_691,2181,691,Venta por cuenta ajena - Tasa mínima, +tax_code_2181_692,2181,692,Venta por cuenta ajena - No gravada, +tax_code_2181_693,2181,693,Venta por cuenta ajena - con IVA en suspenso, +tax_code_2181_694,2181,694,Venta por cuenta ajena - con Impuesto percibido, +tax_code_2181_695,2181,695,Venta por cuenta ajena - Asimilada a exportación, +tax_code_2181_90,2181,90,Venta por cuenta ajena - Tasa básica, +tax_code_2181_91,2181,91,Venta por cuenta ajena - Tasa mínima, +tax_code_2181_92,2181,92,Venta por cuenta ajena - No gravada, +tax_code_2181_93,2181,93,Venta por cuenta ajena - con IVA en suspenso, +tax_code_2181_94,2181,94,Venta por cuenta ajena - con Impuesto percibido, +tax_code_2181_95,2181,95,Venta por cuenta ajena - Asimilada a exportación, +tax_code_2181_552,2181,552,IVA Vtas. Tasa Básica a Contrib.- Vta.Cuenta Ajena, +tax_code_2181_553,2181,553,IVA Vtas. Tasa Mínica a Contrib.- Vta.Cuenta Ajena, +tax_code_2181_460,2181,460,Reduccion IMESI - Decreto 398/007, +tax_code_2181_360,2181,360,CFE - Software - Aplicativos de terceros - SAAS, +tax_code_2181_61,2181,61,CFE - Software - Aplic. terc. - SAAS - Prov. Ext., +tax_code_2181_501,2181,501,Ventas Plaza a No Contribuyentes, +tax_code_2181_45,2181,45,IRAE - Saldo ajuste por inflacion, +tax_code_2181_470,2181,470,Dividendos y Util. Fictos - Inversion Intangibles, +tax_code_2181_520,2181,520,Ventas APPS Transporte (Nº1º Res. 1810/2017), +tax_code_2181_440,2181,440,Imputación de Div./Util. Fictos a Contrib. IRAE, +tax_code_2181_530,2181,530,IVA ventas de GASOIL, +tax_code_2181_14,2181,14,Compras de bienes al exterior, +tax_code_2181_15,2181,15,Compras de servicios al exterior, +tax_code_2181_24,2181,24,Ventas de bienes al exterior, +tax_code_2181_25,2181,25,Ventas de servicios al exterior, +tax_code_2181_603,2181,603,Ventas de servicios plaza a contribuyentes de IRAE, +tax_code_2181_420,2181,420,Reducción Alícuota Ley 17934(5 puntos)- IVA Mínimo, +tax_code_2181_423,2181,423,Reducción total IVA Turistas no Res. - IVA Mínimo, +tax_code_2181_47,2181,47,Software- Monto Neto Tot. Oper. Nº12 Res.10403/018, +tax_code_2181_547,2181,547,Software- Monto Neto Tot. Oper. Nº12 Res.10403/018, +tax_code_2181_416,2181,416,Crédito Proveedor Software Hab.- Art.4 Dec.206/019, +tax_code_2181_426,2181,426,Crédito Proveedor Software Hab. Art.5 Dec.206/019, +tax_code_2181_490,2181,490,"Monto Gravado COVID-19, Entidades Art.14 D.133/020", +tax_code_2181_481,2181,481,Créd. Suspendido prod. agrop.- imp. semov. L.19878, +tax_code_2181_417,2181,417,Reducción Alícuota Ley 17934(9 puntos)- Reg. Gral., +tax_code_2181_427,2181,427,Reducción Alícuota Ley 17934(9 puntos)- IVA Mínimo, diff --git a/l10n_uy_account/models/__init__.py b/l10n_uy_account/models/__init__.py index e2008f77..7039a179 100644 --- a/l10n_uy_account/models/__init__.py +++ b/l10n_uy_account/models/__init__.py @@ -11,3 +11,4 @@ from . import l10n_uy_adenda from . import l10n_latam_document_type from . import account_tax +from . import l10n_uy_tax_type diff --git a/l10n_uy_account/models/account_tax.py b/l10n_uy_account/models/account_tax.py index 97fd52f3..cb73b632 100644 --- a/l10n_uy_account/models/account_tax.py +++ b/l10n_uy_account/models/account_tax.py @@ -4,4 +4,4 @@ class AccountTax(models.Model): _inherit = 'account.tax' - l10n_uy_dgi_code = fields.Char('DGI Code') + l10n_uy_dgi_code = fields.Many2one('l10n.uy.tax.type', "DGI Tax Type") diff --git a/l10n_uy_account/models/l10n_uy_tax_type.py b/l10n_uy_account/models/l10n_uy_tax_type.py new file mode 100644 index 00000000..00bc98fd --- /dev/null +++ b/l10n_uy_account/models/l10n_uy_tax_type.py @@ -0,0 +1,30 @@ +from odoo import api, fields, models + + +class L10nUyTaxType(models.Model): + + _name = 'l10n.uy.tax.type' + _description = "Uruguay EDI Tax Type" + + form = fields.Char() + code = fields.Char() + name = fields.Char() + description = fields.Char() + retention = fields.Boolean() + + def name_get(self): + """ Display: 'Form-Code Name """ + res = [] + for rec in self: + name = "%s-%s %s" % (rec.form, rec.code, rec.name) + res.append((rec.id, name)) + return res + + @api.model + def name_search(self, name, args=None, operator='ilike', limit=100): + args = args or [] + domain = [ + '|', '|', ('code', operator, name), + ('form', operator, name), ('name', operator, name)] + rec = self.search(domain + args, limit=limit) + return rec.name_get() diff --git a/l10n_uy_account/security/ir.model.access.csv b/l10n_uy_account/security/ir.model.access.csv index 74697a1b..648a7a25 100644 --- a/l10n_uy_account/security/ir.model.access.csv +++ b/l10n_uy_account/security/ir.model.access.csv @@ -1,2 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_l10n_uy_adenda,access.l10n.uy.adenda,model_l10n_uy_adenda,base.group_user,1,1,1,1 +access_l10n_uy_tax_type,access.l10n.uy.adenda,model_l10n_uy_tax_type,base.group_user,1,1,1,1 diff --git a/l10n_uy_account/views/l10n_uy_tax_type_views.xml b/l10n_uy_account/views/l10n_uy_tax_type_views.xml new file mode 100644 index 00000000..40e3e961 --- /dev/null +++ b/l10n_uy_account/views/l10n_uy_tax_type_views.xml @@ -0,0 +1,38 @@ + + + + + l10n.uy.tax.type.view.tree + l10n.uy.tax.type + + + + + + + + + + + + l10n.uy.tax.type.view.search + l10n.uy.tax.type + + + + + + + + + + + + Tipos de Impuesto (UY) + l10n.uy.tax.type + tree + + + + + From b1ecc565600bbd1a78d4133ff44009b731a21726 Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Fri, 30 Dec 2022 16:56:02 -0300 Subject: [PATCH 5/8] fixup! [ADD] l10n_uy_edi: Retenciones / Reguardos --- l10n_uy_edi/views/account_move_line_views.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_uy_edi/views/account_move_line_views.xml b/l10n_uy_edi/views/account_move_line_views.xml index 39c2d89b..de4e2c12 100644 --- a/l10n_uy_edi/views/account_move_line_views.xml +++ b/l10n_uy_edi/views/account_move_line_views.xml @@ -7,9 +7,9 @@ primary - + - + @@ -29,7 +29,7 @@ Retenciones (UY) account.move.line - form,tree + tree,form From 93daa999ee7352f3ea1e4651a255be1559f921c8 Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Fri, 30 Dec 2022 17:01:23 -0300 Subject: [PATCH 6/8] [ADD] l10n_uy_reports: simpifly using tax types --- l10n_uy_reports/wizards/form_report_wiz.py | 25 ++++++---------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/l10n_uy_reports/wizards/form_report_wiz.py b/l10n_uy_reports/wizards/form_report_wiz.py index 0ad4fc48..8780a0d4 100644 --- a/l10n_uy_reports/wizards/form_report_wiz.py +++ b/l10n_uy_reports/wizards/form_report_wiz.py @@ -79,32 +79,21 @@ def _get_form_2181_data(self): return the string with the lines of the file to write """ lines = [] - # TODO KZ Importante. por lo que vimos en el archivo generado esta mezclando iva compras e iva ventas. - line_code = { - self._search_tax('vat_22', 'sale'): '502', # 502 IVA Ventas Tasa Básica a Contribuyentes - self._search_tax('vat_10', 'sale'): '503', # 503 IVA Ventas Tasa Mínima a Contribuyentes - self._search_tax('vat_exempt', 'purchase'): '504', # Compras Plaza Exentas de IVA - self._search_tax('vat_22', 'purchase'): '505', # 505 IVA Compras Plaza Tasa Básica - self._search_tax('vat_10', 'purchase'): '506', # 506 IVA Compras Plaza Tasa Mínima - } - # Estos dos parece que tambien van pero no tenemos un impuestos para colocarlo - # ("507", "507 - IVA Ventas tasa 10% a Contribuyentes"), - # ("508", "508 - IVA Compras Plaza Tasa 10%"), - taxes_raw = list(line_code.keys()) - taxes = self.env['account.tax'] - for item in taxes_raw: - taxes |= item + invoices = self._get_invoices() + UYU_currency = self.env.ref('base.UYU') + + line_code = {} + taxes = invoices.mapped('line_ids.tax_ids').filtered(lambda x: x.l10n_uy_dgi_code.form == "2181") + for tax in taxes: + line_code.update({tax: tax.l10n_uy_dgi_code.code}) tax_code = {} taxes_group_ids = taxes.mapped('tax_group_id').ids for tax in taxes: tax_code[(tax.tax_group_id.id, tax.type_tax_use)] = line_code.get(tax) - invoices = self._get_invoices() - UYU_currency = self.env.ref('base.UYU') - # Revisando que todos los impuestos esten bien configurados error = "" for line in invoices.line_ids: From 27d6fa35f7615352f220ddcefe028bdd242e0de6 Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Tue, 17 Jan 2023 09:14:29 -0300 Subject: [PATCH 7/8] fixup e-resguardo and add view --- l10n_uy_edi/models/l10n_uy_resguardo.py | 7 +- l10n_uy_edi/views/l10n_uy_resguardo_views.xml | 65 +++++++++++++++++++ 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/l10n_uy_edi/models/l10n_uy_resguardo.py b/l10n_uy_edi/models/l10n_uy_resguardo.py index 13231df7..14ff629a 100644 --- a/l10n_uy_edi/models/l10n_uy_resguardo.py +++ b/l10n_uy_edi/models/l10n_uy_resguardo.py @@ -4,14 +4,15 @@ class L10nUyResguardo(models.Model): _name = 'l10n.uy.resguardo' - _inherit = ['l10n.uy.cfe'] + _inherit = ['mail.thread', 'mail.activity.mixin', 'l10n.uy.cfe'] _description = 'Resguardos (UY)' name = fields.Char() + state = fields.Selection([('draft', 'Draft'), ('posted', 'Posted'), ('cancel', 'Cancel')]) l10n_latam_document_type_id = fields.Many2one('l10n_latam.document.type', string='Document Type', copy=False) l10n_latam_document_number = fields.Char(string='Document Number', readonly=True, states={'draft': [('readonly', False)]}, copy=False) company_id = fields.Many2one("res.company", default=lambda self: self.env.company) - aml_id = fields.One2many('account.move.line', 'resguardo_id') + aml_ids = fields.One2many('account.move.line', 'resguardo_id') date = fields.Date() partner_id = fields.Many2one('res.partner', compute="compute_aml_vals") currency_id = fields.Many2one('res.currency', compute="compute_aml_vals") @@ -26,7 +27,7 @@ def name_get(self): res = [] for rec in self: if rec.l10n_latam_document_number: - name = "(%s %s)" % (rec.l10n_latam_document_type_id.doc_code_prefix, rec.l10n_latam_document_number) + name = "%s %s" % (rec.l10n_latam_document_type_id.doc_code_prefix, rec.l10n_latam_document_number) else: name = '/' res.append((rec.id, name)) diff --git a/l10n_uy_edi/views/l10n_uy_resguardo_views.xml b/l10n_uy_edi/views/l10n_uy_resguardo_views.xml index 13e0b291..0899ae9f 100644 --- a/l10n_uy_edi/views/l10n_uy_resguardo_views.xml +++ b/l10n_uy_edi/views/l10n_uy_resguardo_views.xml @@ -7,6 +7,71 @@ form,tree + + l10n.uy.resguardo.view.form + l10n.uy.resguardo + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +