Initial commit: L10N_Europe packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:52 +02:00
commit 9803722600
2377 changed files with 380711 additions and 0 deletions

View file

@ -0,0 +1,65 @@
# LATAM Document
Functional
----------
In some Latinamerica countries, including Argentina and Chile, some accounting transactions like invoices and vendor bills are classified by a document types defined by the government fiscal authorities (In Argentina case AFIP, Chile case SII).
This module is intended to be extended by localizations in order to manage these document types and is an essential information that needs to be displayed in the printed reports and that needs to be easily identified, within the set of invoices as well of account moves.
Each document type have their own rules and sequence number, this last one is integrated with the invoice number and journal sequence in order to be easy for the localization user. In order to support or not this document types a Journal has a new option that lets to use document or not.
Technical
---------
If your localization needs this logic will then need to add this module as dependency and in your localization module extend:
* extend company's _localization_use_documents() method.
* create the data of the document types that exists for the specific country. The document type has a country field
## Installation
```bash
pip install odoo-bringout-oca-ocb-l10n_latam_invoice_document
```
## Dependencies
This addon depends on:
- account
- account_debit_note
## Manifest Information
- **Name**: LATAM Document
- **Version**: 1.0
- **Category**: Accounting/Localizations
- **License**: LGPL-3
- **Installable**: True
## Source
Based on [OCA/OCB](https://github.com/OCA/OCB) branch 16.0, addon `l10n_latam_invoice_document`.
## License
This package maintains the original LGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph L10n_latam_invoice_document Module - l10n_latam_invoice_document
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for l10n_latam_invoice_document. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,6 @@
# Dependencies
This addon depends on:
- [account](../../odoo-bringout-oca-ocb-account)
- [account_debit_note](../../odoo-bringout-oca-ocb-account_debit_note)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon l10n_latam_invoice_document or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-ocb-l10n_latam_invoice_document"
# or
uv pip install odoo-bringout-oca-ocb-l10n_latam_invoice_document"
```

View file

@ -0,0 +1,17 @@
# Models
Detected core models and extensions in l10n_latam_invoice_document.
```mermaid
classDiagram
class l10n_latam_document_type
class account_chart_template
class account_journal
class account_move
class account_move_line
class res_company
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: l10n_latam_invoice_document. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon l10n_latam_invoice_document
- License: LGPL-3

View file

@ -0,0 +1,26 @@
# Reports
Report definitions and templates in l10n_latam_invoice_document.
```mermaid
classDiagram
class AccountInvoiceReport
Model <|-- AccountInvoiceReport
```
## Available Reports
No named reports found in XML files.
## Report Files
- **__init__.py** (Python logic)
- **invoice_report.py** (Python logic)
- **invoice_report_view.xml** (XML template/definition)
## Notes
- Named reports above are accessible through Odoo's reporting menu
- Python files define report logic and data processing
- XML files contain report templates, definitions, and formatting
- Reports are integrated with Odoo's printing and email systems

View file

@ -0,0 +1,34 @@
# Security
Access control and security definitions in l10n_latam_invoice_document.
## Access Control Lists (ACLs)
Model access permissions defined in:
- **[ir.model.access.csv](../l10n_latam_invoice_document/security/ir.model.access.csv)**
- 2 model access rules
## Record Rules
Row-level security rules defined in:
```mermaid
graph TB
subgraph "Security Layers"
A[Users] --> B[Groups]
B --> C[Access Control Lists]
C --> D[Models]
B --> E[Record Rules]
E --> F[Individual Records]
end
```
Security files overview:
- **[ir.model.access.csv](../l10n_latam_invoice_document/security/ir.model.access.csv)**
- Model access permissions (CRUD rights)
Notes
- Access Control Lists define which groups can access which models
- Record Rules provide row-level security (filter records by user/group)
- Security groups organize users and define permission sets
- All security is enforced at the ORM level by Odoo

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon l10n_latam_invoice_document
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,4 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
from . import wizards
from . import report

View file

@ -0,0 +1,43 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
"name": "LATAM Document",
"version": "1.0",
"author": "ADHOC SA",
'category': 'Accounting/Localizations',
"summary": "LATAM Document Types",
'description': """
Functional
----------
In some Latinamerica countries, including Argentina and Chile, some accounting transactions like invoices and vendor bills are classified by a document types defined by the government fiscal authorities (In Argentina case AFIP, Chile case SII).
This module is intended to be extended by localizations in order to manage these document types and is an essential information that needs to be displayed in the printed reports and that needs to be easily identified, within the set of invoices as well of account moves.
Each document type have their own rules and sequence number, this last one is integrated with the invoice number and journal sequence in order to be easy for the localization user. In order to support or not this document types a Journal has a new option that lets to use document or not.
Technical
---------
If your localization needs this logic will then need to add this module as dependency and in your localization module extend:
* extend company's _localization_use_documents() method.
* create the data of the document types that exists for the specific country. The document type has a country field
""",
"depends": [
"account",
"account_debit_note",
],
"data": [
'views/account_journal_view.xml',
'views/account_move_line_view.xml',
'views/account_move_view.xml',
'views/l10n_latam_document_type_view.xml',
'views/report_templates.xml',
'report/invoice_report_view.xml',
'wizards/account_move_reversal_view.xml',
'security/ir.model.access.csv',
],
'installable': True,
'license': 'LGPL-3',
}

View file

@ -0,0 +1,399 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_latam_invoice_document
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-30 18:44+0000\n"
"PO-Revision-Date: 2020-03-30 18:44+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_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_chart_template
msgid "Account Chart Template"
msgstr "Plantilla de Plan de Cuentas"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_move_reversal
msgid "Account Move Reversal"
msgstr "Revocación de movimiento en cuenta"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__active
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Active"
msgstr "Activo"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__internal_type
msgid ""
"Analog to odoo account.move.move_type but with more options allowing to "
"identify the kind of document we are working with. (not only related to "
"account.move, could be for documents of other models like stock.picking)"
msgstr ""
"Análogo a account.move.type de Odoo pero con más opciones, permitiendo "
"identificar el tipo de documento sobre el que estamos trabajando. (no "
"solamente relativo a account.move, podría ser relativo a otros modelos, como"
" por ejemplo stock.picking)"
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Archived"
msgstr "Archivado"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__code
msgid "Code"
msgstr "Código"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__code
msgid "Code used by different localizations"
msgstr "Código usando por diferentes localizaciones"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_res_company
msgid "Companies"
msgstr "Compañías"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__country_id
msgid "Country"
msgstr "País"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_country_code
msgid "Country Code"
msgstr "Código País"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Country Code (LATAM)"
msgstr "Código País (LATAM)"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__country_id
msgid "Country in which this type of document is valid"
msgstr "País donde el tipo de documento es valido"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__create_uid
msgid "Created by"
msgstr "Creado por"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__create_date
msgid "Created on"
msgstr "Creado el"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields.selection,name:l10n_latam_invoice_document.selection__l10n_latam_document_type__internal_type__credit_note
msgid "Credit Notes"
msgstr "Notas de Crédito"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields.selection,name:l10n_latam_invoice_document.selection__l10n_latam_document_type__internal_type__debit_note
msgid "Debit Notes"
msgstr "Notas de Débito"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__display_name
msgid "Display Name"
msgstr "Nombre a mostrar"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__doc_code_prefix
msgid "Document Code Prefix"
msgstr "Prefijo del código de documento"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_document_number
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_document_number
msgid "Document Number"
msgstr "Número de Documento"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_invoice_report__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_document_type_id
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_invoice_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_invoice_report_search
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_move_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_move_line_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_form
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_tree
msgid "Document Type"
msgstr "Tipo de Documento"
#. module: l10n_latam_invoice_document
#: model:ir.actions.act_window,name:l10n_latam_invoice_document.action_document_type
#: model:ir.ui.menu,name:l10n_latam_invoice_document.menu_document_type
msgid "Document Types"
msgstr "Tipos de Documentos"
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Group By..."
msgstr "Agrupar por..."
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__id
msgid "ID"
msgstr "ID (identificación)"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_journal__l10n_latam_use_documents
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_move__l10n_latam_use_documents
msgid ""
"If active: will be using for legal invoicing (invoices, debit/credit notes)."
" If not set means that will be used to register accounting entries not "
"related to invoicing legal documents. For Example: Receipts, Tax Payments, "
"Register journal entries"
msgstr ""
"Si esta activo: será utilizado para facturación (facturas, notas de débito y"
" crédito). SI esta desactivado significa que que será usado para registrar "
"movimientos contables que no están relacionas con facturación como tal. Por "
"ejemplo: Recibos, Pagos de Impuestos, Registrar asientos contables"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__internal_type
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Internal Type"
msgstr "Tipo interno"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields.selection,name:l10n_latam_invoice_document.selection__l10n_latam_document_type__internal_type__invoice
msgid "Invoices"
msgstr "Facturas"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_invoice_report
msgid "Invoices Statistics"
msgstr "Estadísticas de facturas"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_journal
msgid "Journal"
msgstr "Diario"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_move
msgid "Journal Entries"
msgstr "Asientos contables"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_move_line
msgid "Journal Item"
msgstr "Apunte contable"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_amount_untaxed
msgid "L10N Latam Amount Untaxed"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_available_document_type_ids
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_available_document_type_ids
msgid "L10N Latam Available Document Type"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_company_use_documents
msgid "L10N Latam Company Use Documents"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_net
msgid "L10N Latam Price Net"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_subtotal
msgid "L10N Latam Price Subtotal"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_unit
msgid "L10N Latam Price Unit"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_tax_ids
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_tax_ids
msgid "L10N Latam Tax"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_use_documents
msgid "L10N Latam Use Documents"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type____last_update
msgid "Last Modified on"
msgstr "Última modificación en"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__write_uid
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__write_date
msgid "Last Updated on"
msgstr "Última actualización el"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_l10n_latam_document_type
msgid "Latam Document Type"
msgstr "Tipo de Documento Latam"
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Localization"
msgstr "Localización"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_manual_document_number
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_manual_document_number
msgid "Manual Number"
msgstr "Número Manual"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__name
msgid "Name"
msgstr "Nombre"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__report_name
msgid "Name on Reports"
msgstr "Nombre en Reportes"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__report_name
msgid "Name that will be printed in reports, for example \"CREDIT NOTE\""
msgstr "Nombre que será impreso en los reportes, por ejemplo \"NOTA DE CREDITO\""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "Please set the document number on the following invoices %s."
msgstr ""
"Por favor asigne el número de documento en las siguientes facturas %s."
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__doc_code_prefix
msgid ""
"Prefix for Documents Codes on Invoices and Account Moves. For eg. 'FA ' will"
" build 'FA 0001-0000001' Document Number"
msgstr ""
"Prefijo para Códigos de Documentos en Facturas y Asientos. Por eje: 'FA ' "
"será construirá 'FA 0001-0000001' como el numero de documento"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__sequence
msgid "Sequence"
msgstr "Secuencia"
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Show active document types"
msgstr "Mostrar tipos de documento activos"
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Show archived document types"
msgstr "Mostrar tipos de documento archivados"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_journal__l10n_latam_country_code
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Technical field used to hide/show fields regarding the localization"
msgstr ""
"Campo técnico usado para esconder/mostrar dependiendo de la liocalización"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__name
msgid "The document name"
msgstr "El nombre del documento"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid ""
"The journal require a document type but not document type has been selected "
"on invoices %s."
msgstr ""
"El diario requiere un tipo de documento pero no hay tipo de documento "
"seleccionado en las facturas %s."
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__sequence
msgid ""
"To set in which order show the documents type taking into account the most "
"commonly used first"
msgstr ""
"Para seleccionar en que orden deben mostrar los tipos de documento teniendo "
"en cuenta los más usados comunmente"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_use_documents
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_use_documents
msgid "Use Documents?"
msgstr "Usa Documentos?"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "Vendor bill number must be unique per vendor and company."
msgstr ""
"El número de la Factura de Proveedor debe ser único por proveedor y por "
"compañía."
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "We do not accept the usage of document types on receipts yet. "
msgstr "Todavía no aceptamos el uso de tipos de documentos en los recibos."
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_journal.py:0
#, python-format
msgid ""
"You can not modify the field \"Use Documents?\" if there are validated "
"invoices in this journal!"
msgstr ""
"No puedes modificar el campo \"Usa Documentos?\" si ya existen facturas "
"validades en este diario!"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "You can not use a %s document type with a invoice"
msgstr "No puedes utilizar el tipo de documento %s en una factura"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "You can not use a %s document type with a refund invoice"
msgstr ""
"No puedes utilizar el tipo de documento %s en una factura de reembolso"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/wizards/account_move_reversal.py:0
#, python-format
msgid ""
"You can only reverse documents with legal invoicing documents from Latin America one at a time.\n"
"Problematic documents: %s"
msgstr ""
"Solo puede revertir documentos con documentos de facturación legales de Latino américa de uno en uno.\n"
"Documentos problemáticos:%s"

View file

@ -0,0 +1,200 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_latam_invoice_document
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-08 16:49+0000\n"
"PO-Revision-Date: 2020-09-08 16:49+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_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_document_number
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_document_number
msgid "Document Number"
msgstr "Número de Comprobante"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_invoice_report__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_ir_sequence__l10n_latam_document_type_id
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_invoice_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_invoice_report_search
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_move_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_move_line_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_form
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_tree
msgid "Document Type"
msgstr "Tipo de Comprobante"
#. module: l10n_latam_invoice_document
#: model:ir.actions.act_window,name:l10n_latam_invoice_document.action_document_type
#: model:ir.ui.menu,name:l10n_latam_invoice_document.menu_document_type
msgid "Document Types"
msgstr "Tipos de Comprobantes"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_amount_untaxed
msgid "L10N Latam Amount Untaxed"
msgstr "Base imponible"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_available_document_type_ids
msgid "L10N Latam Available Document Type"
msgstr "Tipo de Comprobante Disponible"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_bank_statement_import_journal_creation__l10n_latam_company_use_documents
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_company_use_documents
msgid "L10N Latam Company Use Documents"
msgstr "Es Fiscal"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_net
msgid "L10N Latam Price Net"
msgstr "Precio Neto"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_subtotal
msgid "L10N Latam Price Subtotal"
msgstr "Subtotal"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_unit
msgid "L10N Latam Price Unit"
msgstr "Precio"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_sequence_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_sequence_id
msgid "L10N Latam Sequence"
msgstr "Secuencia"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_tax_ids
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_tax_ids
msgid "L10N Latam Tax"
msgstr "Impuestos"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_l10n_latam_document_type
msgid "Latam Document Type"
msgstr "Tipo de Comprobante"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__report_name
msgid "Name that will be printed in reports, for example \"CREDIT NOTE\""
msgstr "Nombre que será impreso en los reportes, por ejemplo \"NOTA DE CREDITO\""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "No sequence or document number linked to invoice id %s"
msgstr "No hay secuencia o número de comprobante vinculado a la factura %s"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "Please set the document number on the following invoices %s."
msgstr ""
"Por favor asigne el número de comprobante en las siguientes facturas %s."
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__doc_code_prefix
msgid ""
"Prefix for Documents Codes on Invoices and Account Moves. For eg. 'FA ' will"
" build 'FA 0001-0000001' Document Number"
msgstr ""
"Prefijo para Códigos de Comprobante en Facturas y Asientos. Por eje: 'FA ' "
"será construirá 'FA 0001-0000001' como el numero de comprobante"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_ir_sequence
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__sequence
msgid "Sequence"
msgstr "Secuencia"
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Show active document types"
msgstr "Mostrar tipos de comprobante activos"
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Show archived document types"
msgstr "Mostrar tipos de comprobante archivados"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__name
msgid "The document name"
msgstr "El nombre del comprobante"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid ""
"The journal require a document type but not document type has been selected "
"on invoices %s."
msgstr ""
"El diario requiere un tipo de comprobante pero no hay tipo de documento "
"seleccionado en las facturas %s."
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__sequence
msgid ""
"To set in which order show the documents type taking into account the most "
"commonly used first"
msgstr ""
"Para seleccionar en que orden deben mostrar los tipos de comprobante teniendo "
"en cuenta los más usados comunmente"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_bank_statement_import_journal_creation__l10n_latam_use_documents
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_use_documents
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_use_documents
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_use_documents
msgid "Use Documents?"
msgstr "Es fiscal?"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_journal.py:0
#, python-format
msgid ""
"You can not modify the field \"Use Documents?\" if there are validated "
"invoices in this journal!"
msgstr ""
"No puedes modificar el campo \"Es Fiscal?\" si ya existen facturas "
"validades en este diario!"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "You can not use a %s document type with a invoice"
msgstr "No puedes utilizar el tipo de comprobante %s en una factura"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "You can not use a %s document type with a refund invoice"
msgstr ""
"No puedes utilizar el tipo de comprobante %s en una nota de crédito"
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/wizards/account_move_reversal.py:0
#, python-format
msgid ""
"You can only reverse documents with legal invoicing documents from Latin America one at a time.\n"
"Problematic documents: %s"
msgstr ""
"Solo puede aplicar Notas de Crédito a un documento a la vez.\n"
"Documento con problemas: %s"

View file

@ -0,0 +1,362 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_latam_invoice_document
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.3alpha1+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-30 18:43+0000\n"
"PO-Revision-Date: 2020-03-30 18:43+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_chart_template
msgid "Account Chart Template"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_move_reversal
msgid "Account Move Reversal"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__active
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Active"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__internal_type
msgid "Analog to odoo account.move.move_type but with more options allowing to identify the kind of document we are working with. (not only related to account.move, could be for documents of other models like stock.picking)"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Archived"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__code
msgid "Code"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__code
msgid "Code used by different localizations"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_res_company
msgid "Companies"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__country_id
msgid "Country"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_country_code
msgid "Country Code"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Country Code (LATAM)"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__country_id
msgid "Country in which this type of document is valid"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__create_uid
msgid "Created by"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__create_date
msgid "Created on"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields.selection,name:l10n_latam_invoice_document.selection__l10n_latam_document_type__internal_type__credit_note
msgid "Credit Notes"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields.selection,name:l10n_latam_invoice_document.selection__l10n_latam_document_type__internal_type__debit_note
msgid "Debit Notes"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__display_name
msgid "Display Name"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__doc_code_prefix
msgid "Document Code Prefix"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_document_number
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_document_number
msgid "Document Number"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_invoice_report__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_document_type_id
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_invoice_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_invoice_report_search
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_move_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_move_line_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_form
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_tree
msgid "Document Type"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.actions.act_window,name:l10n_latam_invoice_document.action_document_type
#: model:ir.ui.menu,name:l10n_latam_invoice_document.menu_document_type
msgid "Document Types"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Group By..."
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__id
msgid "ID"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_journal__l10n_latam_use_documents
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_move__l10n_latam_use_documents
msgid "If active: will be using for legal invoicing (invoices, debit/credit notes). If not set means that will be used to register accounting entries not related to invoicing legal documents. For Example: Receipts, Tax Payments, Register journal entries"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__internal_type
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Internal Type"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields.selection,name:l10n_latam_invoice_document.selection__l10n_latam_document_type__internal_type__invoice
msgid "Invoices"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_invoice_report
msgid "Invoices Statistics"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_journal
msgid "Journal"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_move
msgid "Journal Entries"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_amount_untaxed
msgid "L10N Latam Amount Untaxed"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_available_document_type_ids
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_available_document_type_ids
msgid "L10N Latam Available Document Type"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_company_use_documents
msgid "L10N Latam Company Use Documents"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_net
msgid "L10N Latam Price Net"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_subtotal
msgid "L10N Latam Price Subtotal"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_unit
msgid "L10N Latam Price Unit"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_tax_ids
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_tax_ids
msgid "L10N Latam Tax"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_use_documents
msgid "L10N Latam Use Documents"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type____last_update
msgid "Last Modified on"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__write_uid
msgid "Last Updated by"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__write_date
msgid "Last Updated on"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_l10n_latam_document_type
msgid "Latam Document Type"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Localization"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_manual_document_number
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_manual_document_number
msgid "Manual Number"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__name
msgid "Name"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__report_name
msgid "Name on Reports"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__report_name
msgid "Name that will be printed in reports, for example \"CREDIT NOTE\""
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "Please set the document number on the following invoices %s."
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__doc_code_prefix
msgid "Prefix for Documents Codes on Invoices and Account Moves. For eg. 'FA ' will build 'FA 0001-0000001' Document Number"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__sequence
msgid "Sequence"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Show active document types"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Show archived document types"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_journal__l10n_latam_country_code
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Technical field used to hide/show fields regarding the localization"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__name
msgid "The document name"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "The journal require a document type but not document type has been selected on invoices %s."
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__sequence
msgid "To set in which order show the documents type taking into account the most commonly used first"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_use_documents
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_use_documents
msgid "Use Documents?"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "Vendor bill number must be unique per vendor and company."
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "We do not accept the usage of document types on receipts yet. "
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_journal.py:0
#, python-format
msgid "You can not modify the field \"Use Documents?\" if there are validated invoices in this journal!"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "You can not use a %s document type with a invoice"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "You can not use a %s document type with a refund invoice"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/wizards/account_move_reversal.py:0
#, python-format
msgid ""
"You can only reverse documents with legal invoicing documents from Latin America one at a time.\n"
"Problematic documents: %s"
msgstr ""

View file

@ -0,0 +1,376 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_latam_invoice_document
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.3alpha1+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-30 18:43+0000\n"
"PO-Revision-Date: 2020-03-30 18:43+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_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_chart_template
msgid "Account Chart Template"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_move_reversal
msgid "Account Move Reversal"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__active
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Active"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__internal_type
msgid ""
"Analog to odoo account.move.move_type but with more options allowing to "
"identify the kind of document we are working with. (not only related to "
"account.move, could be for documents of other models like stock.picking)"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Archived"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__code
msgid "Code"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__code
msgid "Code used by different localizations"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_res_company
msgid "Companies"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__country_id
msgid "Country"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_country_code
msgid "Country Code"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Country Code (LATAM)"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__country_id
msgid "Country in which this type of document is valid"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__create_uid
msgid "Created by"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__create_date
msgid "Created on"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields.selection,name:l10n_latam_invoice_document.selection__l10n_latam_document_type__internal_type__credit_note
msgid "Credit Notes"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields.selection,name:l10n_latam_invoice_document.selection__l10n_latam_document_type__internal_type__debit_note
msgid "Debit Notes"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__display_name
msgid "Display Name"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__doc_code_prefix
msgid "Document Code Prefix"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_document_number
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_document_number
msgid "Document Number"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_invoice_report__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_document_type_id
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_document_type_id
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_invoice_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_invoice_report_search
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_move_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_account_move_line_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_form
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_tree
msgid "Document Type"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.actions.act_window,name:l10n_latam_invoice_document.action_document_type
#: model:ir.ui.menu,name:l10n_latam_invoice_document.menu_document_type
msgid "Document Types"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Group By..."
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__id
msgid "ID"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_journal__l10n_latam_use_documents
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_move__l10n_latam_use_documents
msgid ""
"If active: will be using for legal invoicing (invoices, debit/credit notes)."
" If not set means that will be used to register accounting entries not "
"related to invoicing legal documents. For Example: Receipts, Tax Payments, "
"Register journal entries"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__internal_type
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Internal Type"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields.selection,name:l10n_latam_invoice_document.selection__l10n_latam_document_type__internal_type__invoice
msgid "Invoices"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_invoice_report
msgid "Invoices Statistics"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_journal
msgid "Journal"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_move
msgid "Journal Entries"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_amount_untaxed
msgid "L10N Latam Amount Untaxed"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_available_document_type_ids
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_available_document_type_ids
msgid "L10N Latam Available Document Type"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_company_use_documents
msgid "L10N Latam Company Use Documents"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_net
msgid "L10N Latam Price Net"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_subtotal
msgid "L10N Latam Price Subtotal"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_price_unit
msgid "L10N Latam Price Unit"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_tax_ids
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_line__l10n_latam_tax_ids
msgid "L10N Latam Tax"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_use_documents
msgid "L10N Latam Use Documents"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type____last_update
msgid "Last Modified on"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__write_uid
msgid "Last Updated by"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__write_date
msgid "Last Updated on"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model,name:l10n_latam_invoice_document.model_l10n_latam_document_type
msgid "Latam Document Type"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Localization"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_manual_document_number
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move_reversal__l10n_latam_manual_document_number
msgid "Manual Number"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__name
msgid "Name"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__report_name
msgid "Name on Reports"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__report_name
msgid "Name that will be printed in reports, for example \"CREDIT NOTE\""
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "Please set the document number on the following invoices %s."
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__doc_code_prefix
msgid ""
"Prefix for Documents Codes on Invoices and Account Moves. For eg. 'FA ' will"
" build 'FA 0001-0000001' Document Number"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_l10n_latam_document_type__sequence
msgid "Sequence"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Show active document types"
msgstr ""
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
msgid "Show archived document types"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_journal__l10n_latam_country_code
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Technical field used to hide/show fields regarding the localization"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__name
msgid "The document name"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid ""
"The journal require a document type but not document type has been selected "
"on invoices %s."
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__sequence
msgid ""
"To set in which order show the documents type taking into account the most "
"commonly used first"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_use_documents
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_use_documents
msgid "Use Documents?"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "Vendor bill number must be unique per vendor and company."
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "We do not accept the usage of document types on receipts yet. "
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_journal.py:0
#, python-format
msgid ""
"You can not modify the field \"Use Documents?\" if there are validated "
"invoices in this journal!"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "You can not use a %s document type with a invoice"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "You can not use a %s document type with a refund invoice"
msgstr ""
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/wizards/account_move_reversal.py:0
#, python-format
msgid ""
"You can only reverse documents with legal invoicing documents from Latin America one at a time.\n"
"Problematic documents: %s"
msgstr ""

View file

@ -0,0 +1,8 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import res_company
from . import l10n_latam_document_type
from . import account_journal
from . import account_move
from . import account_move_line
from . import account_chart_template

View file

@ -0,0 +1,19 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, api, fields, _
class AccountChartTemplate(models.Model):
_inherit = 'account.chart.template'
@api.model
def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None):
""" We add use_documents or not depending on the context"""
journal_data = super()._prepare_all_journals(acc_template_ref, company, journals_dict)
# if chart has localization, then we use documents by default
if company._localization_use_documents():
for vals_journal in journal_data:
if vals_journal['type'] in ['sale', 'purchase']:
vals_journal['l10n_latam_use_documents'] = True
return journal_data

View file

@ -0,0 +1,43 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api, _
from odoo.exceptions import ValidationError
class AccountJournal(models.Model):
_inherit = "account.journal"
l10n_latam_use_documents = fields.Boolean(
'Use Documents?', help="If active: will be using for legal invoicing (invoices, debit/credit notes)."
" If not set means that will be used to register accounting entries not related to invoicing legal documents."
" For Example: Receipts, Tax Payments, Register journal entries")
l10n_latam_company_use_documents = fields.Boolean(compute='_compute_l10n_latam_company_use_documents')
@api.depends('company_id')
def _compute_l10n_latam_company_use_documents(self):
for rec in self:
rec.l10n_latam_company_use_documents = rec.company_id._localization_use_documents()
@api.onchange('company_id', 'type')
def _onchange_company(self):
self.l10n_latam_use_documents = self.type in ['sale', 'purchase'] and \
self.l10n_latam_company_use_documents
@api.constrains('l10n_latam_use_documents')
def check_use_document(self):
for rec in self:
if rec.env['account.move'].search([('journal_id', '=', rec.id), ('posted_before', '=', True)], limit=1):
raise ValidationError(_(
'You can not modify the field "Use Documents?" if there are validated invoices in this journal!'))
@api.onchange('type', 'l10n_latam_use_documents')
def _onchange_type(self):
res = super()._onchange_type()
if self.l10n_latam_use_documents:
self.refund_sequence = False
return res
def _compute_has_sequence_holes(self):
journals_use_documents = self.filtered(lambda x: x.l10n_latam_use_documents)
journals_use_documents.has_sequence_holes = False
super(AccountJournal, self - journals_use_documents)._compute_has_sequence_holes()

View file

@ -0,0 +1,242 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools.sql import column_exists, create_column
class AccountMove(models.Model):
_inherit = "account.move"
def _auto_init(self):
# Skip the computation of the field `l10n_latam_document_type_id` at the module installation
# Without this, at the module installation,
# it would call `_compute_l10n_latam_document_type` on all existing records
# which can take quite a while if you already have a lot of moves. It can even fail with a MemoryError.
# In addition, it sets `_compute_l10n_latam_document_type = False` on all records
# because this field depends on the many2many `l10n_latam_available_document_type_ids`,
# which relies on having records for the model `l10n_latam.document.type`
# which only happens once the according localization module is loaded.
# The localization module is loaded afterwards, because the localization module depends on this module,
# (e.g. `l10n_cl` depends on `l10n_latam_invoice_document`, and therefore `l10n_cl` is loaded after)
# and therefore there are no records for the model `l10n_latam.document.type` at the time this fields
# gets computed on installation. Hence, all records' `_compute_l10n_latam_document_type` are set to `False`.
# In addition, multiple localization module depends on this module (e.g. `l10n_cl`, `l10n_ar`)
# So, imagine `l10n_cl` gets installed first, and then `l10n_ar` is installed next,
# if `l10n_latam_document_type_id` needed to be computed on install,
# the install of `l10n_cl` would call the compute method,
# because `l10n_latam_invoice_document` would be installed at the same time,
# but then `l10n_ar` would miss it, because `l10n_latam_invoice_document` would already be installed.
# Besides, this field is computed only for drafts invoices, as stated in the compute method:
# `for rec in self.filtered(lambda x: x.state == 'draft'):`
# So, if we want this field to be computed on install, it must be done only on draft invoices, and only once
# the localization modules are loaded.
# It should be done in a dedicated post init hook,
# filtering correctly the invoices for which it must be computed.
# Though I don't think this is needed.
# In practical, it's very rare to already have invoices (draft, in addition)
# for a Chilian or Argentian company (`res.company`) before installing `l10n_cl` or `l10n_ar`.
if not column_exists(self.env.cr, "account_move", "l10n_latam_document_type_id"):
create_column(self.env.cr, "account_move", "l10n_latam_document_type_id", "int4")
return super()._auto_init()
l10n_latam_available_document_type_ids = fields.Many2many('l10n_latam.document.type', compute='_compute_l10n_latam_available_document_types')
l10n_latam_document_type_id = fields.Many2one(
'l10n_latam.document.type', string='Document Type', readonly=False, auto_join=True, index='btree_not_null',
states={'posted': [('readonly', True)]}, compute='_compute_l10n_latam_document_type', store=True)
l10n_latam_document_number = fields.Char(
compute='_compute_l10n_latam_document_number', inverse='_inverse_l10n_latam_document_number',
string='Document Number', readonly=True, states={'draft': [('readonly', False)]})
l10n_latam_use_documents = fields.Boolean(related='journal_id.l10n_latam_use_documents')
l10n_latam_manual_document_number = fields.Boolean(compute='_compute_l10n_latam_manual_document_number', string='Manual Number')
l10n_latam_document_type_id_code = fields.Char(related='l10n_latam_document_type_id.code', string='Doc Type')
@api.depends('l10n_latam_document_type_id')
def _compute_name(self):
""" Change the way that the use_document moves name is computed:
* If move use document but does not have document type selected then name = '/' to do not show the name.
* If move use document and are numbered manually do not compute name at all (will be set manually)
* If move use document and is in draft state and has not been posted before we restart name to '/' (this is
when we change the document type) """
without_doc_type = self.filtered(lambda x: x.journal_id.l10n_latam_use_documents and not x.l10n_latam_document_type_id)
manual_documents = self.filtered(lambda x: x.journal_id.l10n_latam_use_documents and x.l10n_latam_manual_document_number)
(without_doc_type + manual_documents.filtered(lambda x: not x.name)).name = '/'
# we need to group moves by document type as _compute_name will apply the same name prefix of the first record to the others
group_by_document_type = defaultdict(self.env['account.move'].browse)
for move in (self - without_doc_type - manual_documents):
group_by_document_type[move.l10n_latam_document_type_id.id] += move
for group in group_by_document_type.values():
super(AccountMove, group)._compute_name()
@api.depends('l10n_latam_document_type_id', 'journal_id')
def _compute_l10n_latam_manual_document_number(self):
""" Indicates if this document type uses a sequence or if the numbering is made manually """
recs_with_journal_id = self.filtered(lambda x: x.journal_id and x.journal_id.l10n_latam_use_documents)
for rec in recs_with_journal_id:
rec.l10n_latam_manual_document_number = rec._is_manual_document_number()
remaining = self - recs_with_journal_id
remaining.l10n_latam_manual_document_number = False
def _is_manual_document_number(self):
return self.journal_id.type == 'purchase'
@api.depends('name')
def _compute_l10n_latam_document_number(self):
recs_with_name = self.filtered(lambda x: x.name != '/')
for rec in recs_with_name:
name = rec.name
doc_code_prefix = rec.l10n_latam_document_type_id.doc_code_prefix
if doc_code_prefix and name:
name = name.split(" ", 1)[-1]
rec.l10n_latam_document_number = name
remaining = self - recs_with_name
remaining.l10n_latam_document_number = False
@api.onchange('l10n_latam_document_type_id', 'l10n_latam_document_number', 'partner_id')
def _inverse_l10n_latam_document_number(self):
for rec in self.filtered(lambda x: x.l10n_latam_document_type_id):
if not rec.l10n_latam_document_number:
rec.name = '/'
else:
l10n_latam_document_number = rec.l10n_latam_document_number
if not rec._skip_format_document_number():
l10n_latam_document_number = rec.l10n_latam_document_type_id._format_document_number(rec.l10n_latam_document_number)
if rec.l10n_latam_document_number != l10n_latam_document_number:
rec.l10n_latam_document_number = l10n_latam_document_number
rec.name = "%s %s" % (rec.l10n_latam_document_type_id.doc_code_prefix, l10n_latam_document_number)
@api.onchange('l10n_latam_document_type_id')
def _onchange_l10n_latam_document_type_id(self):
# if we change document or journal and we are in draft and not posted, we clean number so that is recomputed
if (self.journal_id.l10n_latam_use_documents and self.l10n_latam_document_type_id
and not self.l10n_latam_manual_document_number and self.state == 'draft' and not self.posted_before):
self.name = '/'
self._compute_name()
@api.depends('journal_id', 'l10n_latam_document_type_id')
def _compute_highest_name(self):
manual_records = self.filtered('l10n_latam_manual_document_number')
manual_records.highest_name = ''
super(AccountMove, self - manual_records)._compute_highest_name()
@api.model
def _deduce_sequence_number_reset(self, name):
if self.l10n_latam_use_documents:
return 'never'
return super(AccountMove, self)._deduce_sequence_number_reset(name)
def _skip_format_document_number(self):
"""Hook to be overridden in localisation"""
self.ensure_one()
return False
def _get_starting_sequence(self):
if self.journal_id.l10n_latam_use_documents:
if self.l10n_latam_document_type_id:
return "%s 00000000" % (self.l10n_latam_document_type_id.doc_code_prefix)
# There was no pattern found, propose one
return ""
return super(AccountMove, self)._get_starting_sequence()
def _post(self, soft=True):
for rec in self.filtered(lambda x: x.l10n_latam_use_documents and (not x.name or x.name == '/')):
if rec.move_type in ('in_receipt', 'out_receipt'):
raise UserError(_('We do not accept the usage of document types on receipts yet. '))
return super()._post(soft)
@api.constrains('name', 'journal_id', 'state')
def _check_unique_sequence_number(self):
""" This uniqueness verification is only valid for customer invoices, and vendor bills that does not use
documents. A new constraint method _check_unique_vendor_number has been created just for validate for this purpose """
vendor = self.filtered(lambda x: x.is_purchase_document() and x.l10n_latam_use_documents)
return super(AccountMove, self - vendor)._check_unique_sequence_number()
@api.constrains('state', 'l10n_latam_document_type_id')
def _check_l10n_latam_documents(self):
""" This constraint checks that if a invoice is posted and does not have a document type configured will raise
an error. This only applies to invoices related to journals that has the "Use Documents" set as True.
And if the document type is set then check if the invoice number has been set, because a posted invoice
without a document number is not valid in the case that the related journals has "Use Docuemnts" set as True """
validated_invoices = self.filtered(lambda x: x.l10n_latam_use_documents and x.state == 'posted')
without_doc_type = validated_invoices.filtered(lambda x: not x.l10n_latam_document_type_id)
if without_doc_type:
raise ValidationError(_(
'The journal require a document type but not document type has been selected on invoices %s.',
without_doc_type.ids
))
without_number = validated_invoices.filtered(
lambda x: not x.l10n_latam_document_number and x.l10n_latam_manual_document_number)
if without_number:
raise ValidationError(_(
'Please set the document number on the following invoices %s.',
without_number.ids
))
@api.constrains('move_type', 'l10n_latam_document_type_id')
def _check_invoice_type_document_type(self):
for rec in self.filtered('l10n_latam_document_type_id.internal_type'):
internal_type = rec.l10n_latam_document_type_id.internal_type
invoice_type = rec.move_type
if internal_type in ['debit_note', 'invoice'] and invoice_type in ['out_refund', 'in_refund']:
raise ValidationError(_('You can not use a %s document type with a refund invoice', internal_type))
elif internal_type == 'credit_note' and invoice_type in ['out_invoice', 'in_invoice']:
raise ValidationError(_('You can not use a %s document type with a invoice', internal_type))
def _get_l10n_latam_documents_domain(self):
self.ensure_one()
if self.move_type in ['out_refund', 'in_refund']:
internal_types = ['credit_note']
else:
internal_types = ['invoice', 'debit_note']
return [('internal_type', 'in', internal_types), ('country_id', '=', self.company_id.account_fiscal_country_id.id)]
@api.depends('journal_id', 'partner_id', 'company_id', 'move_type')
def _compute_l10n_latam_available_document_types(self):
self.l10n_latam_available_document_type_ids = False
for rec in self.filtered(lambda x: x.journal_id and x.l10n_latam_use_documents and x.partner_id):
rec.l10n_latam_available_document_type_ids = self.env['l10n_latam.document.type'].search(rec._get_l10n_latam_documents_domain())
@api.depends('l10n_latam_available_document_type_ids', 'debit_origin_id')
def _compute_l10n_latam_document_type(self):
for rec in self.filtered(lambda x: x.state == 'draft' and (not x.posted_before if x.move_type in ['out_invoice', 'out_refund'] else True)):
document_types = rec.l10n_latam_available_document_type_ids._origin
invoice_type = rec.move_type
if invoice_type in ['out_refund', 'in_refund']:
document_types = document_types.filtered(lambda x: x.internal_type not in ['debit_note', 'invoice'])
elif invoice_type in ['out_invoice', 'in_invoice']:
document_types = document_types.filtered(lambda x: x.internal_type not in ['credit_note'])
if rec.debit_origin_id:
document_types = document_types.filtered(lambda x: x.internal_type == 'debit_note')
if rec.l10n_latam_document_type_id not in document_types:
rec.l10n_latam_document_type_id = document_types and document_types[0].id
@api.constrains('name', 'partner_id', 'company_id', 'posted_before')
def _check_unique_vendor_number(self):
""" The constraint _check_unique_sequence_number is valid for customer bills but not valid for us on vendor
bills because the uniqueness must be per partner """
for rec in self.filtered(
lambda x: x.name and x.name != '/' and x.is_purchase_document() and x.l10n_latam_use_documents
and x.commercial_partner_id):
domain = [
('move_type', '=', rec.move_type),
# by validating name we validate l10n_latam_document_type_id
('name', '=', rec.name),
('company_id', '=', rec.company_id.id),
('id', '!=', rec.id),
('commercial_partner_id', '=', rec.commercial_partner_id.id),
# allow to have to equal if they are cancelled
('state', '!=', 'cancel'),
]
if rec.search(domain):
raise ValidationError(_('Vendor bill number must be unique per vendor and company.'))
def _compute_made_sequence_hole(self):
manual_documents = self.filtered(lambda x: x.journal_id.l10n_latam_use_documents and x.l10n_latam_manual_document_number)
manual_documents.made_sequence_hole = False
super(AccountMove, self - manual_documents)._compute_made_sequence_hole()

View file

@ -0,0 +1,19 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
from odoo.tools.sql import column_exists, create_column
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
def _auto_init(self):
# Skip the computation of the field `l10n_latam_document_type_id` at the module installation
# See `_auto_init` in `l10n_latam_invoice_document/models/account_move.py` for more information
if not column_exists(self.env.cr, "account_move_line", "l10n_latam_document_type_id"):
create_column(self.env.cr, "account_move_line", "l10n_latam_document_type_id", "int4")
return super()._auto_init()
l10n_latam_document_type_id = fields.Many2one(
related='move_id.l10n_latam_document_type_id', auto_join=True, store=True, index='btree_not_null')

View file

@ -0,0 +1,45 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
from odoo.osv import expression
class L10nLatamDocumentType(models.Model):
_name = 'l10n_latam.document.type'
_description = 'Latam Document Type'
_order = 'sequence, id'
_rec_names_search = ['name', 'code']
active = fields.Boolean(default=True)
sequence = fields.Integer(
default=10, required=True, help='To set in which order show the documents type taking into account the most'
' commonly used first')
country_id = fields.Many2one(
'res.country', required=True, index=True, help='Country in which this type of document is valid')
name = fields.Char(required=True, help='The document name')
doc_code_prefix = fields.Char(
'Document Code Prefix', help="Prefix for Documents Codes on Invoices and Account Moves. For eg. 'FA ' will"
" build 'FA 0001-0000001' Document Number")
code = fields.Char(help='Code used by different localizations')
report_name = fields.Char('Name on Reports', help='Name that will be printed in reports, for example "CREDIT NOTE"')
internal_type = fields.Selection(
[('invoice', 'Invoices'), ('debit_note', 'Debit Notes'), ('credit_note', 'Credit Notes')],
help='Analog to odoo account.move.move_type but with more options allowing to identify the kind of document we are'
' working with. (not only related to account.move, could be for documents of other models like stock.picking)')
def _format_document_number(self, document_number):
""" Method to be inherited by different localizations. The purpose of this method is to allow:
* making validations on the document_number. If it is wrong it should raise an exception
* format the document_number against a pattern and return it
"""
self.ensure_one()
return document_number
def name_get(self):
result = []
for rec in self:
name = rec.name
if rec.code:
name = '(%s) %s' % (rec.code, name)
result.append((rec.id, name))
return result

View file

@ -0,0 +1,12 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
def _localization_use_documents(self):
""" This method is to be inherited by localizations and return True if localization use documents """
self.ensure_one()
return False

View file

@ -0,0 +1,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import invoice_report

View file

@ -0,0 +1,13 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class AccountInvoiceReport(models.Model):
_inherit = 'account.invoice.report'
l10n_latam_document_type_id = fields.Many2one('l10n_latam.document.type', 'Document Type', index=True)
_depends = {'account.move': ['l10n_latam_document_type_id'],}
def _select(self):
return super()._select() + ", move.l10n_latam_document_type_id as l10n_latam_document_type_id"

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record model="ir.ui.view" id="view_account_invoice_report_search">
<field name="name">account.invoice.report.search</field>
<field name="model">account.invoice.report</field>
<field name="inherit_id" ref="account.view_account_invoice_report_search"/>
<field name="arch" type="xml">
<search>
<field name="l10n_latam_document_type_id"/>
</search>
<filter name="user" position="after">
<filter domain="[]" string="Document Type" name="l10n_latam_document_type" context="{'group_by':'l10n_latam_document_type_id'}"/>
</filter>
</field>
</record>
</odoo>

View file

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_l10n_latam_document_type_all,l10n_latam.document.type.all,model_l10n_latam_document_type,,1,0,0,0
access_l10n_latam_document_type_account_manager,l10n_latam.document.type.all,model_l10n_latam_document_type,account.group_account_manager,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_l10n_latam_document_type_all l10n_latam.document.type.all model_l10n_latam_document_type 1 0 0 0
3 access_l10n_latam_document_type_account_manager l10n_latam.document.type.all model_l10n_latam_document_type account.group_account_manager 1 1 1 0

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_journal_form" model="ir.ui.view">
<field name="model">account.journal</field>
<field name="name">account.journal.form</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<form>
<field name="country_code" invisible="1"/>
<field name="l10n_latam_company_use_documents" invisible="1"/>
</form>
<field name="type" position="after">
<field name="l10n_latam_use_documents" attrs="{'invisible': ['|', ('l10n_latam_company_use_documents', '=', False), ('type', 'not in', ['purchase','sale'])]}"/>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_move_line_filter" model="ir.ui.view">
<field name="name">account.move.line.filter</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
<field name="arch" type="xml">
<separator position="before">
<field name="l10n_latam_document_type_id"/>
</separator>
<group>
<filter string="Document Type" name="l10n_latam_document_type" domain="" context="{'group_by':'l10n_latam_document_type_id'}"/>
</group>
</field>
</record>
</odoo>

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_invoice_filter" model="ir.ui.view">
<field name="name">account.move.select</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="l10n_latam_document_type_id"/>
</field>
<group>
<filter string="Document Type" name="l10n_latam_document_type" domain="" context="{'group_by':'l10n_latam_document_type_id'}"/>
</group>
</field>
</record>
<record id="view_account_move_filter" model="ir.ui.view">
<field name="name">account.move.filter</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_account_move_filter"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="l10n_latam_document_type_id"/>
</field>
<group>
<filter string="Document Type" name="l10n_latam_document_type" domain="" context="{'group_by':'l10n_latam_document_type_id'}"/>
</group>
</field>
</record>
<record id="view_move_form" model="ir.ui.view">
<field name="name">account.move.form</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<form>
<field name="l10n_latam_available_document_type_ids" invisible="1"/>
<field name="l10n_latam_use_documents" invisible="1"/>
<field name="l10n_latam_manual_document_number" invisible="1"/>
</form>
<xpath expr="//div[@name='journal_div']" position="after">
<field name="l10n_latam_document_type_id"
attrs="{'invisible': [('l10n_latam_use_documents', '=', False)], 'required': [('partner_id', '!=', False), ('l10n_latam_use_documents', '=', True)], 'readonly': [('posted_before', '=', True)]}"
domain="[('id', 'in', l10n_latam_available_document_type_ids)]" options="{'no_open': True, 'no_create': True}"/>
<field name="l10n_latam_document_number"
attrs="{'invisible': ['|', ('l10n_latam_use_documents', '=', False), ('l10n_latam_manual_document_number', '=', False), '|', '|', ('l10n_latam_use_documents', '=', False), ('highest_name', '!=', False), ('state', '!=', 'draft')],
'required': [('partner_id', '!=', False), ('l10n_latam_use_documents', '=', True), '|', ('l10n_latam_manual_document_number', '=', True), ('highest_name', '=', False)],
'readonly': [('posted_before', '=', True), ('state', '!=', 'draft')]}"/>
</xpath>
<!-- on latam_documents we use document_number to set name -->
<field name="name" position="attributes">
<attribute name="attrs">{'invisible':[('name', '=', '/'), ('posted_before', '=', False), ('quick_edit_mode', '=', False)],
'readonly': ['|', ('state', '!=', 'draft'), ('l10n_latam_use_documents', '=', True)]}</attribute>
<attribute name="force_save">1</attribute>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_document_type_form" model="ir.ui.view">
<field name="name">l10n_latam.document.type.form</field>
<field name="model">l10n_latam.document.type</field>
<field name="arch" type="xml">
<form string="Document Type" create="0" edit="0">
<group>
<field name='code'/>
<field name="name"/>
<field name='doc_code_prefix'/>
<field name='report_name'/>
<field name='internal_type'/>
<field name='country_id'/>
</group>
</form>
</field>
</record>
<record id="view_document_type_tree" model="ir.ui.view">
<field name="name">l10n_latam.document.type.tree</field>
<field name="model">l10n_latam.document.type</field>
<field name="arch" type="xml">
<tree string="Document Type" decoration-muted="(not active)" create="0" edit="0">
<field name="code"/>
<field name="name"/>
<field name="doc_code_prefix"/>
<field name='report_name'/>
<field name='internal_type'/>
<field name='country_id'/>
<field name="active" widget="boolean_toggle"/>
</tree>
</field>
</record>
<record id="view_document_type_filter" model="ir.ui.view">
<field name="name">l10n_latam.document.type.filter</field>
<field name="model">l10n_latam.document.type</field>
<field name="arch" type="xml">
<search string="Document Type">
<field name="name"/>
<field name="code"/>
<field name='internal_type'/>
<field name='country_id'/>
<filter name="active" string="Active" domain="[('active','=',True)]" help="Show active document types"/>
<filter name="inactive" string="Archived" domain="[('active','=',False)]" help="Show archived document types"/>
<group expand="1" string="Group By...">
<filter string="Internal Type" name="group_by_internal_type" context="{'group_by':'internal_type'}"/>
<filter string="Localization" name="group_by_localization" context="{'group_by':'country_id'}"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_document_type">
<field name="name">Document Types</field>
<field name="res_model">l10n_latam.document.type</field>
<field name="domain">['|', ('active', '=', True), ('active', '=', False)]</field>
<field name="context">{"search_default_active":1}</field>
</record>
<menuitem action="action_document_type" id="menu_document_type" sequence="20" parent="account.account_account_menu"/>
</odoo>

View file

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="external_layout_standard" inherit_id="web.external_layout_standard" >
<!-- support for custom header -->
<div t-attf-class="header o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="header o_company_#{company.id}_layout" position="after">
<div t-attf-class="header o_company_#{company.id}_layout" t-if="custom_header">
<t t-call="#{custom_header}"/>
</div>
</div>
<!-- support for custom footer -->
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout" position="after">
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout" t-if="custom_footer">
<t t-out="custom_footer"/>
</div>
</div>
</template>
<template id="external_layout_bold" inherit_id="web.external_layout_bold" >
<!-- support for custom header -->
<div t-attf-class="header o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="header o_company_#{company.id}_layout" position="after">
<div t-attf-class="header o_company_#{company.id}_layout" t-if="custom_header">
<div class="o_clean_header">
<t t-call="#{custom_header}"/>
</div>
</div>
</div>
<!-- support for custom footer -->
<div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout" position="after">
<div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout" t-if="custom_footer">
<t t-out="custom_footer"/>
</div>
</div>
</template>
<template id="external_layout_boxed" inherit_id="web.external_layout_boxed" >
<!-- support for custom header -->
<div t-attf-class="header o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="header o_company_#{company.id}_layout" position="after">
<div t-attf-class="header o_company_#{company.id}_layout" t-if="custom_header">
<div class="o_boxed_header">
<t t-call="#{custom_header}"/>
</div>
</div>
</div>
<!-- support for custom footer -->
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout" position="after">
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout" t-if="custom_footer">
<t t-out="custom_footer"/>
</div>
</div>
</template>
<template id="external_layout_striped" inherit_id="web.external_layout_striped" >
<!-- support for custom header -->
<div t-attf-class="o_company_#{company.id}_layout header" position="attributes">
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="o_company_#{company.id}_layout header" position="after">
<div t-attf-class="o_company_#{company.id}_layout header" t-if="custom_header">
<div class="o_background_header">
<t t-call="#{custom_header}"/>
</div>
</div>
</div>
<!-- support for custom footer -->
<div t-attf-class="o_company_#{company.id}_layout footer o_background_footer" position="attributes">
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="o_company_#{company.id}_layout footer o_background_footer" position="after">
<div t-attf-class="o_company_#{company.id}_layout footer o_background_footer" t-if="custom_footer">
<t t-out="custom_footer"/>
</div>
</div>
</template>
</odoo>

View file

@ -0,0 +1,4 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import account_move_reversal
from . import account_debit_note

View file

@ -0,0 +1,16 @@
from odoo import models
class AccountDebitNote(models.TransientModel):
_inherit = 'account.debit.note'
def create_debit(self):
""" Properly compute the latam document type of type debit note. """
res = super().create_debit()
new_move_id = res.get('res_id')
if new_move_id:
new_move = self.env['account.move'].browse(new_move_id)
new_move._compute_l10n_latam_document_type()
new_move._onchange_l10n_latam_document_type_id()
return res

View file

@ -0,0 +1,80 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class AccountMoveReversal(models.TransientModel):
_inherit = "account.move.reversal"
l10n_latam_use_documents = fields.Boolean(compute='_compute_documents_info')
l10n_latam_document_type_id = fields.Many2one('l10n_latam.document.type', 'Document Type', ondelete='cascade', domain="[('id', 'in', l10n_latam_available_document_type_ids)]", compute='_compute_document_type', readonly=False, store=True)
l10n_latam_available_document_type_ids = fields.Many2many('l10n_latam.document.type', compute='_compute_documents_info')
l10n_latam_document_number = fields.Char(string='Document Number')
l10n_latam_manual_document_number = fields.Boolean(compute='_compute_l10n_latam_manual_document_number', string='Manual Number')
@api.depends('l10n_latam_document_type_id')
def _compute_l10n_latam_manual_document_number(self):
self.l10n_latam_manual_document_number = False
for rec in self.filtered('move_ids'):
move = rec.move_ids[0]
if move.journal_id and move.journal_id.l10n_latam_use_documents:
rec.l10n_latam_manual_document_number = move._is_manual_document_number()
@api.model
def _reverse_type_map(self, move_type):
match = {
'entry': 'entry',
'out_invoice': 'out_refund',
'in_invoice': 'in_refund',
'in_refund': 'in_invoice',
'out_receipt': 'in_receipt',
'in_receipt': 'out_receipt'}
return match.get(move_type)
@api.depends('l10n_latam_available_document_type_ids')
def _compute_document_type(self):
for record in self.filtered(
lambda x: not x.l10n_latam_document_type_id or
x.l10n_latam_document_type_id not in x.l10n_latam_available_document_type_ids):
document_types = record.l10n_latam_available_document_type_ids._origin
record.l10n_latam_document_type_id = document_types[0] if document_types else False
@api.depends('move_ids', 'journal_id')
def _compute_documents_info(self):
self.l10n_latam_available_document_type_ids = False
self.l10n_latam_use_documents = False
for record in self:
if len(record.move_ids) > 1:
move_ids_use_document = record.move_ids._origin.filtered(lambda move: move.l10n_latam_use_documents)
if move_ids_use_document:
raise UserError(_('You can only reverse documents with legal invoicing documents from Latin America one at a time.\nProblematic documents: %s') % ", ".join(move_ids_use_document.mapped('name')))
else:
record.l10n_latam_use_documents = record.move_ids.journal_id.l10n_latam_use_documents
if record.l10n_latam_use_documents:
refund = record.env['account.move'].new({
'move_type': record._reverse_type_map(record.move_ids.move_type),
'journal_id': record.journal_id.id,
'partner_id': record.move_ids.partner_id.id,
'company_id': record.move_ids.company_id.id,
})
record.l10n_latam_available_document_type_ids = refund.l10n_latam_available_document_type_ids
def _prepare_default_reversal(self, move):
""" Set the default document type and number in the new revsersal move taking into account the ones selected in
the wizard """
res = super()._prepare_default_reversal(move)
res.update({
'l10n_latam_document_type_id': self.l10n_latam_document_type_id.id,
'l10n_latam_document_number': self.l10n_latam_document_number,
})
return res
@api.onchange('l10n_latam_document_number', 'l10n_latam_document_type_id')
def _onchange_l10n_latam_document_number(self):
if self.l10n_latam_document_type_id:
l10n_latam_document_number = self.l10n_latam_document_type_id._format_document_number(
self.l10n_latam_document_number)
if self.l10n_latam_document_number != l10n_latam_document_number:
self.l10n_latam_document_number = l10n_latam_document_number

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_move_reversal" model="ir.ui.view">
<field name="name">account.move.reversal.form</field>
<field name="model">account.move.reversal</field>
<field name="inherit_id" ref="account.view_account_move_reversal"/>
<field name="arch" type="xml">
<form>
<field name="l10n_latam_use_documents" invisible="1"/>
<field name="l10n_latam_manual_document_number" invisible="1"/>
</form>
<field name="date" position="before">
<field name="l10n_latam_available_document_type_ids" invisible="1"/>
<field name="l10n_latam_document_type_id" attrs="{'invisible': ['|', ('l10n_latam_use_documents', '=', False), ('refund_method', '=', 'refund')], 'required': [('l10n_latam_use_documents', '=', True), ('refund_method', '!=', 'refund')]}" options="{'no_open': True, 'no_create': True}"/>
<field name="l10n_latam_document_number" attrs="{'invisible': ['|', '|', ('l10n_latam_use_documents', '=', False), ('l10n_latam_manual_document_number', '=', False), ('refund_method', '=', 'refund')], 'required': [('l10n_latam_manual_document_number', '=', True), ('l10n_latam_use_documents', '=', True), ('refund_method', '!=', 'refund')]}"/>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,43 @@
[project]
name = "odoo-bringout-oca-ocb-l10n_latam_invoice_document"
version = "16.0.0"
description = "LATAM Document - LATAM Document Types"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-account>=16.0.0",
"odoo-bringout-oca-ocb-account_debit_note>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["l10n_latam_invoice_document"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]