summaryrefslogtreecommitdiff
path: root/addons/l10n_latam_base
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/l10n_latam_base
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/l10n_latam_base')
-rw-r--r--addons/l10n_latam_base/__init__.py14
-rw-r--r--addons/l10n_latam_base/__manifest__.py63
-rw-r--r--addons/l10n_latam_base/data/l10n_latam.identification.type.csv4
-rw-r--r--addons/l10n_latam_base/i18n/es.po164
-rw-r--r--addons/l10n_latam_base/i18n/l10n_latam_base.pot164
-rw-r--r--addons/l10n_latam_base/models/__init__.py4
-rw-r--r--addons/l10n_latam_base/models/l10n_latam_identification_type.py22
-rw-r--r--addons/l10n_latam_base/models/res_company.py18
-rw-r--r--addons/l10n_latam_base/models/res_partner.py31
-rw-r--r--addons/l10n_latam_base/security/ir.model.access.csv3
-rw-r--r--addons/l10n_latam_base/views/l10n_latam_identification_type_view.xml46
-rw-r--r--addons/l10n_latam_base/views/res_partner_view.xml24
12 files changed, 557 insertions, 0 deletions
diff --git a/addons/l10n_latam_base/__init__.py b/addons/l10n_latam_base/__init__.py
new file mode 100644
index 00000000..c6bc869b
--- /dev/null
+++ b/addons/l10n_latam_base/__init__.py
@@ -0,0 +1,14 @@
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+from . import models
+from odoo import api, SUPERUSER_ID
+
+
+def _set_default_identification_type(cr, registry):
+ env = api.Environment(cr, SUPERUSER_ID, {})
+ env.cr.execute(
+ """
+ UPDATE res_partner
+ SET l10n_latam_identification_type_id = %s
+ """,
+ [env.ref('l10n_latam_base.it_vat').id]
+ )
diff --git a/addons/l10n_latam_base/__manifest__.py b/addons/l10n_latam_base/__manifest__.py
new file mode 100644
index 00000000..cc7ce929
--- /dev/null
+++ b/addons/l10n_latam_base/__manifest__.py
@@ -0,0 +1,63 @@
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+{
+ 'name': 'LATAM Localization Base',
+ 'version': '1.0',
+ 'category': 'Accounting/Localizations',
+ 'sequence': 14,
+ 'author': 'Odoo, ADHOC SA',
+ 'summary': 'LATAM Identification Types',
+ 'description': """
+Add a new model named "Identification Type" that extend the vat field functionality in the partner and let the user to identify (an eventually invoice) to contacts not only with their fiscal tax ID (VAT) but with other types of identifications like national document, passport, foreign ID, etc. With this module installed you will see now in the partner form view two fields:
+
+* Identification Type
+* Identification Number
+
+This behavior is a common requirement for some latam countries like Argentina and Chile. If your localization has this requirements then you need to depend on this module and define in your localization module the identifications types that are used in your country. Generally these types of identifications are defined by the government authorities that regulate the fiscal operations. For example:
+
+* AFIP in Argentina defines DNI, CUIT (vat for legal entities), CUIL (vat for natural person), and another 80 valid identification types.
+
+Each identification holds this information:
+
+* name: short name of the identification
+* description: could be the same short name or a long name
+* country_id: the country where this identification belongs
+* is_vat: identify this record as the corresponding VAT for the specific country.
+* sequence: let us to sort the identification types depending on the ones that are most used.
+* active: we can activate/inactivate identifications to make it easier to our customers
+
+In order to make this module compatible for multi-company environments where we have companies that does not need/support this requirement, we have added generic identification types and generic rules to manage the contact information and make it transparent for the user when only use the VAT as we formerly know.
+
+Generic Identifications:
+
+* VAT: The Fiscal Tax Identification or VAT number, by default will be selected as identification type so the user will only need to add the related vat number.
+* Passport
+* Foreign ID (Foreign National Document)
+
+Rules when creating a new partner: We will only see the identification types that are meaningful, taking into account these rules:
+
+* If the partner have not country address set: Will show the generic identification types plus the ones defined in the partner's related company country (If the partner has not specific company then will show the identification types related to the current user company)
+
+* If the partner has country address : will show the generic identification types plus the ones defined for the country of the partner.
+
+When creating a new company, will set to the related partner always the related country is_vat identification type.
+
+All the defined identification types can be reviewed and activate/deactivate in "Contacts / Configuration / Identification Type" menu.
+
+This module is compatible with base_vat module in order to be able to validate VAT numbers for each country that have or not have the possibility to manage multiple identification types.
+""",
+ 'depends': [
+ 'contacts',
+ 'base_vat',
+ ],
+ 'data': [
+ 'data/l10n_latam.identification.type.csv',
+ 'views/res_partner_view.xml',
+ 'views/l10n_latam_identification_type_view.xml',
+ 'security/ir.model.access.csv',
+ ],
+ 'installable': True,
+ 'auto_install': False,
+ 'application': False,
+ 'post_init_hook': '_set_default_identification_type',
+ 'license': 'LGPL-3',
+}
diff --git a/addons/l10n_latam_base/data/l10n_latam.identification.type.csv b/addons/l10n_latam_base/data/l10n_latam.identification.type.csv
new file mode 100644
index 00000000..88c95118
--- /dev/null
+++ b/addons/l10n_latam_base/data/l10n_latam.identification.type.csv
@@ -0,0 +1,4 @@
+id,name,sequence,is_vat
+l10n_latam_base.it_vat,VAT,80,TRUE
+l10n_latam_base.it_pass,Passport,90,
+l10n_latam_base.it_fid,Foreign ID,100,
diff --git a/addons/l10n_latam_base/i18n/es.po b/addons/l10n_latam_base/i18n/es.po
new file mode 100644
index 00000000..3960d010
--- /dev/null
+++ b/addons/l10n_latam_base/i18n/es.po
@@ -0,0 +1,164 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * l10n_latam_base
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 13.0alpha1+e\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-08-22 13:00+0000\n"
+"PO-Revision-Date: 2019-08-22 13:00+0000\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__active
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_l10n_latam_identification_type_search
+msgid "Active"
+msgstr "Activo"
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_l10n_latam_identification_type_search
+msgid "Archived"
+msgstr "Archivado"
+
+#. module: l10n_latam_base
+#: model:ir.model,name:l10n_latam_base.model_res_company
+msgid "Companies"
+msgstr "Compañías"
+
+#. module: l10n_latam_base
+#: model:ir.model,name:l10n_latam_base.model_res_partner
+msgid "Contact"
+msgstr "Contacto"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__country_id
+msgid "Country"
+msgstr "País"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__create_uid
+msgid "Created by"
+msgstr "Creado por"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__create_date
+msgid "Created on"
+msgstr "Creado el"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__description
+msgid "Description"
+msgstr "Descripción"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__display_name
+msgid "Display Name"
+msgstr "Nombre a mostrar"
+
+#. module: l10n_latam_base
+#: model:l10n_latam.identification.type,name:l10n_latam_base.it_fid
+msgid "Foreign ID"
+msgstr "Cédula Extranjera"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__id
+msgid "ID"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_res_partner__vat
+#: model:ir.model.fields,field_description:l10n_latam_base.field_res_users__vat
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_partner_latam_form
+msgid "Identification Number"
+msgstr "Número de Identificación"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,help:l10n_latam_base.field_res_partner__vat
+#: model:ir.model.fields,help:l10n_latam_base.field_res_users__vat
+msgid "Identification Number for selected type"
+msgstr "Número de identificación para el tipo seleccionado"
+
+#. module: l10n_latam_base
+#: model:ir.actions.act_window,name:l10n_latam_base.action_l10n_latam_identification_type
+#: model:ir.model.fields,field_description:l10n_latam_base.field_res_partner__l10n_latam_identification_type_id
+#: model:ir.model.fields,field_description:l10n_latam_base.field_res_users__l10n_latam_identification_type_id
+#: model:ir.ui.menu,name:l10n_latam_base.menu_l10n_latam_identification_type
+msgid "Identification Type"
+msgstr "Tipo de Identificación"
+
+#. module: l10n_latam_base
+#: model:ir.model,name:l10n_latam_base.model_l10n_latam_identification_type
+msgid "Identification Types"
+msgstr "Tipos de Identificación"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__is_vat
+msgid "Is Vat"
+msgstr "Es Identificación Fiscal?"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type____last_update
+msgid "Last Modified on"
+msgstr "Última modificación en"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__write_uid
+msgid "Last Updated by"
+msgstr "Última actualización por"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__write_date
+msgid "Last Updated on"
+msgstr "Última actualización el"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__name
+msgid "Name"
+msgstr "Nombre"
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_partner_latam_form
+msgid "Number"
+msgstr "Número"
+
+#. module: l10n_latam_base
+#: model:l10n_latam.identification.type,name:l10n_latam_base.it_pass
+msgid "Passport"
+msgstr "Pasaporte"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__sequence
+msgid "Sequence"
+msgstr "Secuencia"
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_l10n_latam_identification_type_search
+msgid "Show active identification types"
+msgstr "Mostrar los tipos de identificación activos"
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_l10n_latam_identification_type_search
+msgid "Show archived identification types"
+msgstr "Mostrar los tipos de identificación archivados"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,help:l10n_latam_base.field_res_partner__l10n_latam_identification_type_id
+#: model:ir.model.fields,help:l10n_latam_base.field_res_users__l10n_latam_identification_type_id
+msgid "The type of identification"
+msgstr "Tipo de identificación"
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_partner_latam_form
+msgid "Type"
+msgstr "Tipo"
+
+#. module: l10n_latam_base
+#: model:l10n_latam.identification.type,name:l10n_latam_base.it_vat
+msgid "VAT"
+msgstr ""
diff --git a/addons/l10n_latam_base/i18n/l10n_latam_base.pot b/addons/l10n_latam_base/i18n/l10n_latam_base.pot
new file mode 100644
index 00000000..513b3fb8
--- /dev/null
+++ b/addons/l10n_latam_base/i18n/l10n_latam_base.pot
@@ -0,0 +1,164 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * l10n_latam_base
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 13.0alpha1+e\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-08-22 13:00+0000\n"
+"PO-Revision-Date: 2019-08-22 13:00+0000\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__active
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_l10n_latam_identification_type_search
+msgid "Active"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_l10n_latam_identification_type_search
+msgid "Archived"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model,name:l10n_latam_base.model_res_company
+msgid "Companies"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model,name:l10n_latam_base.model_res_partner
+msgid "Contact"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__country_id
+msgid "Country"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__create_uid
+msgid "Created by"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__create_date
+msgid "Created on"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__description
+msgid "Description"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:l10n_latam.identification.type,name:l10n_latam_base.it_fid
+msgid "Foreign ID"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__id
+msgid "ID"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_res_partner__vat
+#: model:ir.model.fields,field_description:l10n_latam_base.field_res_users__vat
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_partner_latam_form
+msgid "Identification Number"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,help:l10n_latam_base.field_res_partner__vat
+#: model:ir.model.fields,help:l10n_latam_base.field_res_users__vat
+msgid "Identification Number for selected type"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.actions.act_window,name:l10n_latam_base.action_l10n_latam_identification_type
+#: model:ir.model.fields,field_description:l10n_latam_base.field_res_partner__l10n_latam_identification_type_id
+#: model:ir.model.fields,field_description:l10n_latam_base.field_res_users__l10n_latam_identification_type_id
+#: model:ir.ui.menu,name:l10n_latam_base.menu_l10n_latam_identification_type
+msgid "Identification Type"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model,name:l10n_latam_base.model_l10n_latam_identification_type
+msgid "Identification Types"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__is_vat
+msgid "Is Vat"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type____last_update
+msgid "Last Modified on"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__write_uid
+msgid "Last Updated by"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__write_date
+msgid "Last Updated on"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__name
+msgid "Name"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_partner_latam_form
+msgid "Number"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:l10n_latam.identification.type,name:l10n_latam_base.it_pass
+msgid "Passport"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,field_description:l10n_latam_base.field_l10n_latam_identification_type__sequence
+msgid "Sequence"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_l10n_latam_identification_type_search
+msgid "Show active identification types"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_l10n_latam_identification_type_search
+msgid "Show archived identification types"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:ir.model.fields,help:l10n_latam_base.field_res_partner__l10n_latam_identification_type_id
+#: model:ir.model.fields,help:l10n_latam_base.field_res_users__l10n_latam_identification_type_id
+msgid "The type of identification"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model_terms:ir.ui.view,arch_db:l10n_latam_base.view_partner_latam_form
+msgid "Type"
+msgstr ""
+
+#. module: l10n_latam_base
+#: model:l10n_latam.identification.type,name:l10n_latam_base.it_vat
+msgid "VAT"
+msgstr ""
diff --git a/addons/l10n_latam_base/models/__init__.py b/addons/l10n_latam_base/models/__init__.py
new file mode 100644
index 00000000..3111eda0
--- /dev/null
+++ b/addons/l10n_latam_base/models/__init__.py
@@ -0,0 +1,4 @@
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+from . import l10n_latam_identification_type
+from . import res_partner
+from . import res_company
diff --git a/addons/l10n_latam_base/models/l10n_latam_identification_type.py b/addons/l10n_latam_base/models/l10n_latam_identification_type.py
new file mode 100644
index 00000000..68af4f24
--- /dev/null
+++ b/addons/l10n_latam_base/models/l10n_latam_identification_type.py
@@ -0,0 +1,22 @@
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api
+from odoo.osv import expression
+
+
+class L10nLatamIdentificationType(models.Model):
+ _name = 'l10n_latam.identification.type'
+ _description = "Identification Types"
+ _order = 'sequence'
+
+ sequence = fields.Integer(default=10)
+ name = fields.Char(translate=True, required=True,)
+ description = fields.Char()
+ active = fields.Boolean(default=True)
+ is_vat = fields.Boolean()
+ country_id = fields.Many2one('res.country')
+
+ def name_get(self):
+ multi_localization = len(self.search([]).mapped('country_id')) > 1
+ return [(rec.id, '%s%s' % (
+ rec.name, multi_localization and rec.country_id and ' (%s)' % rec.country_id.code or '')) for rec in self]
diff --git a/addons/l10n_latam_base/models/res_company.py b/addons/l10n_latam_base/models/res_company.py
new file mode 100644
index 00000000..165d0afb
--- /dev/null
+++ b/addons/l10n_latam_base/models/res_company.py
@@ -0,0 +1,18 @@
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api
+
+
+class ResCompany(models.Model):
+ _inherit = 'res.company'
+
+ @api.model
+ def create(self, vals):
+ """ If exists, use specific vat identification.type for the country of the company """
+ country_id = vals.get('country_id')
+ if country_id:
+ country_vat_type = self.env['l10n_latam.identification.type'].search(
+ [('is_vat', '=', True), ('country_id', '=', country_id)], limit=1)
+ if country_vat_type:
+ self = self.with_context(default_l10n_latam_identification_type_id=country_vat_type.id)
+ return super().create(vals)
diff --git a/addons/l10n_latam_base/models/res_partner.py b/addons/l10n_latam_base/models/res_partner.py
new file mode 100644
index 00000000..10396dbb
--- /dev/null
+++ b/addons/l10n_latam_base/models/res_partner.py
@@ -0,0 +1,31 @@
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api
+
+
+class ResPartner(models.Model):
+ _inherit = 'res.partner'
+
+ l10n_latam_identification_type_id = fields.Many2one('l10n_latam.identification.type',
+ string="Identification Type", index=True, auto_join=True,
+ default=lambda self: self.env.ref('l10n_latam_base.it_vat', raise_if_not_found=False),
+ help="The type of identification")
+ vat = fields.Char(string='Identification Number', help="Identification Number for selected type")
+
+ @api.model
+ def _commercial_fields(self):
+ return super()._commercial_fields() + ['l10n_latam_identification_type_id']
+
+ @api.constrains('vat', 'l10n_latam_identification_type_id')
+ def check_vat(self):
+ with_vat = self.filtered(lambda x: x.l10n_latam_identification_type_id.is_vat)
+ return super(ResPartner, with_vat).check_vat()
+
+ @api.onchange('country_id')
+ def _onchange_country(self):
+ country = self.country_id or self.company_id.country_id or self.env.company.country_id
+ identification_type = self.l10n_latam_identification_type_id
+ if not identification_type or (identification_type.country_id != country):
+ self.l10n_latam_identification_type_id = self.env['l10n_latam.identification.type'].search(
+ [('country_id', '=', country.id), ('is_vat', '=', True)], limit=1) or self.env.ref(
+ 'l10n_latam_base.it_vat', raise_if_not_found=False)
diff --git a/addons/l10n_latam_base/security/ir.model.access.csv b/addons/l10n_latam_base/security/ir.model.access.csv
new file mode 100644
index 00000000..9e4bed68
--- /dev/null
+++ b/addons/l10n_latam_base/security/ir.model.access.csv
@@ -0,0 +1,3 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_latam_identification_type_all","latam id type all","model_l10n_latam_identification_type",,1,0,0,0
+"access_latam_identification_type_manager","latam id type manager","model_l10n_latam_identification_type","base.group_partner_manager",1,1,0,0
diff --git a/addons/l10n_latam_base/views/l10n_latam_identification_type_view.xml b/addons/l10n_latam_base/views/l10n_latam_identification_type_view.xml
new file mode 100644
index 00000000..dba31944
--- /dev/null
+++ b/addons/l10n_latam_base/views/l10n_latam_identification_type_view.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<odoo>
+
+ <record id="view_l10n_latam_identification_type_tree" model="ir.ui.view">
+ <field name="name">l10n_latam.identification.type.tree</field>
+ <field name="model">l10n_latam.identification.type</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree decoration-muted="(not active)" create="0" edit="0">
+ <field name="name"/>
+ <field name="description"/>
+ <field name="country_id"/>
+ <field name="active" widget="boolean_toggle"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="view_l10n_latam_identification_type_search" model="ir.ui.view">
+ <field name="name">l10n_latam.identification.type.search</field>
+ <field name="model">l10n_latam.identification.type</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search>
+ <field name="name"/>
+ <field name="description"/>
+ <field name="country_id"/>
+ <filter name="active" string="Active" domain="[('active','=',True)]" help="Show active identification types"/>
+ <filter name="inactive" string="Archived" domain="[('active','=',False)]" help="Show archived identification types"/>
+ </search>
+ </field>
+ </record>
+
+ <record id="action_l10n_latam_identification_type" model="ir.actions.act_window">
+ <field name="name">Identification Type</field>
+ <field name="res_model">l10n_latam.identification.type</field>
+ <field name="view_mode">tree</field>
+ <field name="search_view_id" ref="view_l10n_latam_identification_type_search"/>
+ <field name="domain">['|', ('active', '=', True), ('active', '=', False)]</field>
+ <field name="context">{"search_default_active":1}</field>
+ </record>
+
+ <menuitem action="action_l10n_latam_identification_type"
+ id="menu_l10n_latam_identification_type"
+ parent="contacts.res_partner_menu_config"/>
+
+</odoo>
diff --git a/addons/l10n_latam_base/views/res_partner_view.xml b/addons/l10n_latam_base/views/res_partner_view.xml
new file mode 100644
index 00000000..e925faf9
--- /dev/null
+++ b/addons/l10n_latam_base/views/res_partner_view.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<odoo>
+
+ <record id="view_partner_latam_form" model="ir.ui.view">
+ <field name="name">view_partner_latam_form</field>
+ <field name="inherit_id" ref="base.view_partner_form"/>
+ <field name="model">res.partner</field>
+ <field name="priority">100</field>
+ <field type="xml" name="arch">
+ <field name="vat" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </field>
+ <field name="vat" position="after">
+ <label for="l10n_latam_identification_type_id" string="Identification Number"/>
+ <div>
+ <field name="l10n_latam_identification_type_id" options="{'no_open': True, 'no_create': True}" placeholder="Type" attrs="{'readonly': [('parent_id','!=',False)]}" class="oe_inline" domain="country_id and ['|', ('country_id', '=', False), ('country_id', '=', country_id)] or []" required="True"/>
+ <span class="oe_read_only"> - </span>
+ <field name="vat" placeholder="Number" class="oe_inline" attrs="{'readonly': [('parent_id','!=',False)]}"/>
+ </div>
+ </field>
+ </field>
+ </record>
+
+</odoo>