Skip to content
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

[ADD] l10n_uy_account, l10n_uy_edi: Retenciones / Resguardos #69

Open
wants to merge 8 commits into
base: 15.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion l10n_uy_account/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -27,11 +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',
Expand Down
4 changes: 4 additions & 0 deletions l10n_uy_account/data/account_tax_group_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
<field name="name">VAT Exempt</field>
</record>

<record id="tax_group_vat_withholdings" model="account.tax.group">
<field name="name">Retenciones (UY)</field>
</record>

</odoo>
117 changes: 117 additions & 0 deletions l10n_uy_account/data/l10n.uy.tax.type.csv
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 2 additions & 0 deletions l10n_uy_account/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
from . import res_partner
from . import l10n_uy_adenda
from . import l10n_latam_document_type
from . import account_tax
from . import l10n_uy_tax_type
7 changes: 7 additions & 0 deletions l10n_uy_account/models/account_tax.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import fields, models


class AccountTax(models.Model):
_inherit = 'account.tax'

l10n_uy_dgi_code = fields.Many2one('l10n.uy.tax.type', "DGI Tax Type")
30 changes: 30 additions & 0 deletions l10n_uy_account/models/l10n_uy_tax_type.py
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions l10n_uy_account/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions l10n_uy_account/views/account_tax_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>

<record id="view_tax_form" model="ir.ui.view">
<field name="name">account.tax.form</field>
<field name="model">account.tax</field>
<field name="inherit_id" ref="account.view_tax_form"/>
<field name="arch" type="xml">
<field name="tax_group_id" position="after">
<field name="l10n_uy_dgi_code"/>
</field>
</field>
</record>

</odoo>
38 changes: 38 additions & 0 deletions l10n_uy_account/views/l10n_uy_tax_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>

<record id="l10n_uy_tax_type_view_tree" model="ir.ui.view">
<field name="name">l10n.uy.tax.type.view.tree</field>
<field name="model">l10n.uy.tax.type</field>
<field name="arch" type="xml">
<tree>
<field name="form"/>
<field name="code"/>
<field name="name"/>
<field name="retention"/>
</tree>
</field>
</record>

<record id="l10n_uy_tax_type_view_search" model="ir.ui.view">
<field name="name">l10n.uy.tax.type.view.search</field>
<field name="model">l10n.uy.tax.type</field>
<field name="arch" type="xml">
<search string="Search Description">
<field name="name"/>
<field name="code"/>
<field name="form"/>
<filter name="group_form" string="Form" context="{'group_by': 'form'}"/>
</search>
</field>
</record>

<record id="action_tax_type_uy" model="ir.actions.act_window">
<field name="name">Tipos de Impuesto (UY)</field>
<field name="res_model">l10n.uy.tax.type</field>
<field name="view_mode">tree</field>
</record>

<menuitem id="menu_uy_tax_type" name="Tipos de Impuestos (UY)" parent="account.menu_finance_configuration" action="action_tax_type_uy" sequence="25"/>

</odoo>
4 changes: 3 additions & 1 deletion l10n_uy_edi/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -21,6 +21,8 @@
'views/res_config_settings_view.xml',
'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',
Expand Down
2 changes: 2 additions & 0 deletions l10n_uy_edi/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions l10n_uy_edi/models/account_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import fields, models


class AccountMoveTax(models.Model):

_inherit = 'account.move.line'

resguardo_id = fields.Many2one('l10n.uy.resguardo')
34 changes: 34 additions & 0 deletions l10n_uy_edi/models/l10n_uy_resguardo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from odoo import fields, models


class L10nUyResguardo(models.Model):

_name = 'l10n.uy.resguardo'
_inherit = ['mail.thread', 'mail.activity.mixin', 'l10n.uy.cfe']
_description = 'Resguardos (UY)'

name = fields.Char()
state = fields.Selection([('draft', 'Draft'), ('posted', 'Posted'), ('cancel', 'Cancel')], default='draft')
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_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")

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
1 change: 1 addition & 0 deletions l10n_uy_edi/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions l10n_uy_edi/views/account_move_line_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>

<record id="view_move_line_tree" model="ir.ui.view">
<field name="name">account.move.line.tree</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_tree"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<field name="credit" position="after">
<field name="resguardo_id"/>
</field>
</field>
</record>

<record id="view_account_move_line_filter" model="ir.ui.view">
<field name="name">account.move.line.search</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<search position="inside">
<field name="resguardo_id"/>
<filter string="Sin Resguardo" name="without_resguardo" domain="[('resguardo_id', '=', False)]"/>
</search>
</field>
</record>

<record id="action_retenciones_uy" model="ir.actions.act_window">
<field name="name">Retenciones (UY)</field>
<field name="res_model">account.move.line</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_move_line_tree"/>
<field name="search_view_id" ref="view_account_move_line_filter"/>
<field name="domain" eval="[('tax_ids.tax_group_id', 'in', [ref('l10n_uy_account.tax_group_vat_withholdings')])]"/>
<field name="context">{'search_default_without_resguardo':1}</field>
</record>

<menuitem id="menu_uy_retenciones" name="Retenciones (UY)" parent="account.menu_finance_configuration" action="action_retenciones_uy" sequence="25"/>

</odoo>
Loading