Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
================================================= | ||
AEAT modelo 303 - Extensión para criterio de caja | ||
================================================= | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github | ||
:target: https://github.com/OCA/l10n-spain/tree/12.0/l10n_es_aeat_mod303_cash_basis | ||
:alt: OCA/l10n-spain | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/l10n-spain-12-0/l10n-spain-12-0-l10n_es_aeat_mod303_cash_basis | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/189/12.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Módulo que extiende el modelo 303 para las empresas que requieran criterio de | ||
caja. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
Para su correcto uso, se deben configurar manualmente los impuestos estándar | ||
que correspondan, activando la opción de criterio de caja. | ||
|
||
Usage | ||
===== | ||
|
||
#. Ir a *Contabilidad > Declaraciones AEAT > Modelo 303*. | ||
#. Crear una nueva declaración. Si se detecta algún impuesto de venta o de | ||
compra con criterio de caja, se marcará la correspondiente casilla en el | ||
modelo, aunque dichos valores se pueden cambiar a mano. | ||
#. Pulsar en "Calcular". | ||
#. Los importes correspondientes a los impuestos no cobrados/pagados aparecerán | ||
en sus correspondientes casillas 62, 63, 74 y 75. | ||
#. Los cobros y pagos se declaran sobre la conciliación del asiento de la | ||
factura independientemente de si es un cobro o pago real o si es | ||
una contabilización por algún movimiento intermedio | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-spain/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_aeat_mod303_cash_basis%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Tecnativa | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Tecnativa <https://www.tecnativa.com>`_ | ||
|
||
* Pedro M. Baeza. | ||
|
||
* Vicent Cubells <info@obertix.net> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/12.0/l10n_es_aeat_mod303_cash_basis>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2018 Tecnativa - Pedro M. Baeza | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 | ||
{ | ||
"name": "AEAT modelo 303 - Extensión para criterio de caja", | ||
"version": "12.0.1.0.0", | ||
'category': "Accounting & Finance", | ||
'author': "Tecnativa," | ||
"Odoo Community Association (OCA)", | ||
'website': "https://github.com/OCA/l10n-spain", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"l10n_es_aeat_mod303", | ||
], | ||
"data": [ | ||
"data/aeat_export_mod303_2018_data.xml", | ||
"data/tax_code_map_mod303_data.xml", | ||
"views/mod303_view.xml", | ||
], | ||
'installable': True, | ||
} |
38 changes: 38 additions & 0 deletions
38
l10n_es_aeat_mod303_cash_basis/data/aeat_export_mod303_2018_data.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Copyright 2018 Tecnativa - Pedro M. Baeza | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
|
||
<record id="l10n_es_aeat_mod303.aeat_mod303_2018_sub01_export_line_18" model="aeat.model.export.config.line"> | ||
<field name="name">Identificación: Opción por el régimen especial de criterio de Caja</field> | ||
<!-- Made this way for avoiding error in case of uninstalling the module --> | ||
<field name="expression">${'cash_basis_receivable' in object._fields.keys() and object.cash_basis_receivable and '1' or '2'}</field> | ||
</record> | ||
|
||
<record id="l10n_es_aeat_mod303.aeat_mod303_2018_sub01_export_line_19" model="aeat.model.export.config.line"> | ||
<field name="name">Identificación: Destinatario de las operaciones a las que se aplique el régimen especial del criterio de Caja</field> | ||
<!-- Made this way for avoiding error in case of uninstalling the module --> | ||
<field name="expression">${'cash_basis_payable' in object._fields.keys() and object.cash_basis_payable and '1' or '2'}</field> | ||
</record> | ||
|
||
<record id="l10n_es_aeat_mod303.aeat_mod303_2018_sub03_export_line_08" model="aeat.model.export.config.line"> | ||
<field name="expression">${object.tax_line_ids.filtered(lambda r: r.field_number==62).amount}</field> | ||
<field name="fixed_value"/> | ||
</record> | ||
|
||
<record id="l10n_es_aeat_mod303.aeat_mod303_2018_sub03_export_line_09" model="aeat.model.export.config.line"> | ||
<field name="expression">${object.tax_line_ids.filtered(lambda r: r.field_number==63).amount}</field> | ||
<field name="fixed_value"/> | ||
</record> | ||
|
||
<record id="l10n_es_aeat_mod303.aeat_mod303_2018_sub03_export_line_10" model="aeat.model.export.config.line"> | ||
<field name="expression">${object.tax_line_ids.filtered(lambda r: r.field_number==74).amount}</field> | ||
<field name="fixed_value"/> | ||
</record> | ||
|
||
<record id="l10n_es_aeat_mod303.aeat_mod303_2018_sub03_export_line_11" model="aeat.model.export.config.line"> | ||
<field name="expression">${object.tax_line_ids.filtered(lambda r: r.field_number==75).amount}</field> | ||
<field name="fixed_value"/> | ||
</record> | ||
|
||
</odoo> |
54 changes: 54 additions & 0 deletions
54
l10n_es_aeat_mod303_cash_basis/data/tax_code_map_mod303_data.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2018 Tecnativa - Pedro M. Baeza | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
<record id="l10n_es_aeat_mod303.aeat_mod303_map_line_62" model="l10n.es.aeat.map.tax.line"> | ||
<field name="map_parent_id" ref="l10n_es_aeat_mod303.aeat_mod303_map"/> | ||
<field name="field_number">62</field> | ||
<field name="name">Importes de las entregas de bienes y prestaciones de servicios a las que habiéndoles sido aplicado el régimen especial del criterio de caja hubieran resultado devengadas conforme a la regla general de devengo contenida en el art. 75 LIVA - Base imponible</field> | ||
<field name="to_regularize" eval="False"/> | ||
<field name="move_type">all</field> | ||
<field name="field_type">base</field> | ||
<field name="sum_type">both</field> | ||
<field name="exigible_type">no</field> | ||
<field name="tax_ids" eval="[(6, False, [ref('l10n_es.account_tax_template_s_iva4b'), ref('l10n_es.account_tax_template_s_iva4s'), ref('l10n_es.account_tax_template_s_iva10b'), ref('l10n_es.account_tax_template_s_iva10s'), ref('l10n_es.account_tax_template_s_iva21b'), ref('l10n_es.account_tax_template_s_iva21s'), ref('l10n_es.account_tax_template_s_iva21isp')])]"/> | ||
<field name="inverse" eval="False"/> | ||
</record> | ||
<record id="l10n_es_aeat_mod303.aeat_mod303_map_line_63" model="l10n.es.aeat.map.tax.line"> | ||
<field name="map_parent_id" ref="l10n_es_aeat_mod303.aeat_mod303_map"/> | ||
<field name="field_number">63</field> | ||
<field name="name">Importes de las entregas de bienes y prestaciones de servicios a las que habiéndoles sido aplicado el régimen especial del criterio de caja hubieran resultado devengadas conforme a la regla general de devengo contenida en el art. 75 LIVA - Cuota</field> | ||
<field name="to_regularize" eval="False"/> | ||
<field name="move_type">all</field> | ||
<field name="field_type">amount</field> | ||
<field name="sum_type">both</field> | ||
<field name="exigible_type">no</field> | ||
<field name="inverse" eval="False"/> | ||
<field name="tax_ids" eval="[(6, False, [ref('l10n_es.account_tax_template_s_iva4b'), ref('l10n_es.account_tax_template_s_iva4s'), ref('l10n_es.account_tax_template_s_iva10b'), ref('l10n_es.account_tax_template_s_iva10s'), ref('l10n_es.account_tax_template_s_iva21b'), ref('l10n_es.account_tax_template_s_iva21s'), ref('l10n_es.account_tax_template_s_iva21isp')])]"/> | ||
|
||
</record> | ||
<record id="l10n_es_aeat_mod303.aeat_mod303_map_line_74" model="l10n.es.aeat.map.tax.line"> | ||
<field name="map_parent_id" ref="l10n_es_aeat_mod303.aeat_mod303_map"/> | ||
<field name="field_number">74</field> | ||
<field name="name">Importe de las adquisiciones de bienes y servicios a las que sea de aplicación o afecte el régimen especial del criterio de caja conforme a la ley general de devengo contenida en el artículo 75 de LIVA - Base imponible</field> | ||
<field name="to_regularize" eval="False"/> | ||
<field name="move_type">all</field> | ||
<field name="field_type">base</field> | ||
<field name="sum_type">both</field> | ||
<field name="exigible_type">no</field> | ||
<field name="inverse" eval="True"/> | ||
<field name="tax_ids" eval="[(6, False, [ref('l10n_es.account_tax_template_p_iva4_sc'), ref('l10n_es.account_tax_template_p_iva4_bc'), ref('l10n_es.account_tax_template_p_iva10_sc'), ref('l10n_es.account_tax_template_p_iva10_bc'), ref('l10n_es.account_tax_template_p_iva21_sc'), ref('l10n_es.account_tax_template_p_iva21_bc'), ref('l10n_es.account_tax_template_p_iva12_agr')])]"/> | ||
</record> | ||
<record id="l10n_es_aeat_mod303.aeat_mod303_map_line_75" model="l10n.es.aeat.map.tax.line"> | ||
<field name="map_parent_id" ref="l10n_es_aeat_mod303.aeat_mod303_map"/> | ||
<field name="field_number">75</field> | ||
<field name="name">Importe de las adquisiciones de bienes y servicios a las que sea de aplicación o afecte el régimen especial del criterio de caja conforme a la ley general de devengo contenida en el artículo 75 de LIVA - Cuota</field> | ||
<field name="to_regularize" eval="False"/> | ||
<field name="move_type">all</field> | ||
<field name="field_type">amount</field> | ||
<field name="sum_type">both</field> | ||
<field name="exigible_type">no</field> | ||
<field name="inverse" eval="True"/> | ||
<field name="tax_ids" eval="[(6, False, [ref('l10n_es.account_tax_template_p_iva4_sc'), ref('l10n_es.account_tax_template_p_iva4_bc'), ref('l10n_es.account_tax_template_p_iva10_sc'), ref('l10n_es.account_tax_template_p_iva10_bc'), ref('l10n_es.account_tax_template_p_iva21_sc'), ref('l10n_es.account_tax_template_p_iva21_bc'), ref('l10n_es.account_tax_template_p_iva12_agr')])]"/> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * l10n_es_aeat_mod303_cash_basis | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 10.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2018-04-24 16:09+0000\n" | ||
"PO-Revision-Date: 2018-04-24 16:09+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_es_aeat_mod303_cash_basis | ||
#: model:ir.model,name:l10n_es_aeat_mod303_cash_basis.model_l10n_es_aeat_mod303_report | ||
msgid "AEAT 303 Report" | ||
msgstr "Declaración AEAT 303" | ||
|
||
#. module: l10n_es_aeat_mod303_cash_basis | ||
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303_cash_basis.field_l10n_es_aeat_mod303_report_cash_basis_payable | ||
msgid "Cash basis for purchases" | ||
msgstr "Criterio de caja para compras" | ||
|
||
#. module: l10n_es_aeat_mod303_cash_basis | ||
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303_cash_basis.field_l10n_es_aeat_mod303_report_cash_basis_receivable | ||
msgid "Cash basis for sales" | ||
msgstr "Criterio de caja para ventas" | ||
|
||
#. module: l10n_es_aeat_mod303_cash_basis | ||
#: model:ir.model,name:l10n_es_aeat_mod303_cash_basis.model_account_partial_reconcile | ||
msgid "Partial Reconcile" | ||
msgstr "" |
35 changes: 35 additions & 0 deletions
35
l10n_es_aeat_mod303_cash_basis/i18n/l10n_es_aeat_mod303_cash_basis.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * l10n_es_aeat_mod303_cash_basis | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 10.0\n" | ||
"Report-Msgid-Bugs-To: \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_es_aeat_mod303_cash_basis | ||
#: model:ir.model,name:l10n_es_aeat_mod303_cash_basis.model_l10n_es_aeat_mod303_report | ||
msgid "AEAT 303 Report" | ||
msgstr "" | ||
|
||
#. module: l10n_es_aeat_mod303_cash_basis | ||
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303_cash_basis.field_l10n_es_aeat_mod303_report_cash_basis_payable | ||
msgid "Cash basis for purchases" | ||
msgstr "" | ||
|
||
#. module: l10n_es_aeat_mod303_cash_basis | ||
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303_cash_basis.field_l10n_es_aeat_mod303_report_cash_basis_receivable | ||
msgid "Cash basis for sales" | ||
msgstr "" | ||
|
||
#. module: l10n_es_aeat_mod303_cash_basis | ||
#: model:ir.model,name:l10n_es_aeat_mod303_cash_basis.model_account_partial_reconcile | ||
msgid "Partial Reconcile" | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import account_move | ||
from . import account_partial_reconcile | ||
from . import mod303 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2018 Comunitea - Santi Argüeso | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class AccountMove(models.Model): | ||
_inherit = 'account.move' | ||
|
||
move_type_cash_basis = fields.Selection( | ||
string="Move type RECC", selection=[ | ||
('other', 'Other'), | ||
('receivable', 'Receivable'), | ||
('receivable_refund', 'Receivable refund'), | ||
('payable', 'Payable'), | ||
('payable_refund', 'Payable refund'), | ||
], readonly=True) | ||
|
||
def _store_move_type_cash_basis(self): | ||
for move in self: | ||
rec = move.tax_cash_basis_rec_id | ||
move_type = 'other' | ||
if rec: | ||
invoice = rec.debit_move_id.invoice_id or \ | ||
rec.credit_move_id.invoice_id | ||
if invoice: | ||
move_type = invoice.move_id.move_type | ||
move.move_type_cash_basis = move_type | ||
|
||
@api.multi | ||
def reverse_moves(self, date=None, journal_id=None): | ||
reversed_move_ids = super(AccountMove, self).reverse_moves(date, | ||
journal_id) | ||
reversed_moves = self.browse(reversed_move_ids) | ||
reverse_types = { | ||
'receivable': 'receivable_refund', | ||
'receivable_refund': 'receivable', | ||
'payable': 'payable_refund', | ||
'payable_refund': 'payable', | ||
} | ||
for move in reversed_moves: | ||
if move.move_type_cash_basis in reverse_types.keys(): | ||
move.move_type_cash_basis = reverse_types[ | ||
move.move_type_cash_basis] | ||
return reversed_moves.mapped('id') |
45 changes: 45 additions & 0 deletions
45
l10n_es_aeat_mod303_cash_basis/models/account_partial_reconcile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2018 Tecnativa - Pedro M. Baeza | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import models | ||
|
||
|
||
class AccountPartialReconcileCashBasis(models.Model): | ||
_inherit = 'account.partial.reconcile' | ||
|
||
def create_tax_cash_basis_entry(self, value_before_reconciliation): | ||
"""Modify tax_exigible and tax values before reconciliation for | ||
the special case of 12% VAT for farming, as its value is included in | ||
IRPF 2%. | ||
This way, we trick standard cash basis system for generating proper | ||
payment accounting moves. | ||
""" | ||
moves = self.debit_move_id.move_id + self.credit_move_id.move_id | ||
tax_lines = self.env['account.move.line'] | ||
base_lines = {} | ||
for line in moves.mapped('line_ids'): | ||
if 'P_IRPF2' in line.tax_ids.mapped('description'): | ||
base_lines[line.tax_ids] = line | ||
if (line.tax_line_id.description == 'P_IVA12_AGR' and | ||
line.tax_exigible): | ||
tax_lines += line | ||
if tax_lines: | ||
tax_lines.write({'tax_exigible': False}) | ||
for line in base_lines.values(): | ||
line.tax_ids = [ | ||
(3, x.id) for x in | ||
line.tax_ids.filtered(lambda l: l.description == 'P_IRPF2') | ||
] | ||
super( | ||
AccountPartialReconcileCashBasis, self, | ||
).create_tax_cash_basis_entry(value_before_reconciliation) | ||
if tax_lines: | ||
tax_lines.write({'tax_exigible': True}) | ||
for taxes, line in list(base_lines.items()): | ||
line.tax_ids = [(6, 0, taxes.ids)] | ||
res = self.env['account.move'].search([('tax_cash_basis_rec_id', '=', | ||
self.id)]) | ||
if res: | ||
res._store_move_type_cash_basis() | ||
return res |
Oops, something went wrong.