Skip to content

Commit

Permalink
[IMP] vat_representative by default
Browse files Browse the repository at this point in the history
@moduon MT-4799
  • Loading branch information
EmilioPascual committed Feb 5, 2024
1 parent 10c2ef9 commit aa85e2d
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 80 deletions.
3 changes: 2 additions & 1 deletion l10n_es_aeat/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AEAT Base
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5ca3ae78198f171da3a0d88ea1cb1e609deeae1bda62c58bf34d153b394e89ac
!! source digest: sha256:3eb122d2b5cc43ff9b532f353624cbbf7feef6ed284cec3b71ebda106ccbfd42
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
Expand Down Expand Up @@ -160,6 +160,7 @@ Contributors
* Valentin Vinagre <[email protected]>
* Manuel Regidor <[email protected]>
* Jairo Llopis (https://www.moduon.team)
* Loida Vilaplana (https://www.moduon.team)

Maintainers
~~~~~~~~~~~
Expand Down
88 changes: 11 additions & 77 deletions l10n_es_aeat/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
"X-Generator: Poedit 3.4.2\n"

#. module: l10n_es_aeat
#. odoo-python
Expand Down Expand Up @@ -981,6 +981,7 @@ msgstr "Apuntes contables"
#. module: l10n_es_aeat
#: model:ir.model.fields,field_description:l10n_es_aeat.field_l10n_es_aeat_report__representative_vat
#: model:ir.model.fields,field_description:l10n_es_aeat.field_l10n_es_aeat_report_tax_mapping__representative_vat
#: model:ir.model.fields,field_description:l10n_es_aeat.field_res_company__representative_vat
msgid "L.R. VAT number"
msgstr "NIF del representante legal"

Expand Down Expand Up @@ -1037,6 +1038,14 @@ msgstr "Última actualización el"
msgid "Left"
msgstr "Izquierda"

#. module: l10n_es_aeat
#: model:ir.model.fields,help:l10n_es_aeat.field_res_company__representative_vat
msgid ""
"Legal Representative VAT number for all the AEAT reports of this company."
msgstr ""
"NIF del representante legal para todos los informes de la AEAT de esta "
"compañía."

#. module: l10n_es_aeat
#: model:ir.model.fields,help:l10n_es_aeat.field_l10n_es_aeat_report__representative_vat
#: model:ir.model.fields,help:l10n_es_aeat.field_l10n_es_aeat_report_tax_mapping__representative_vat
Expand Down Expand Up @@ -1826,79 +1835,4 @@ msgid "or"
msgstr "o"

#~ msgid "SMS Delivery error"
#~ msgstr "SMS de error en la entrega"

#~ msgid "Number of messages which requires an action"
#~ msgstr "Número de mensajes que requieren una acción"

#~ msgid "Model"
#~ msgstr "Modelo"

#~ msgid "Number of unread messages"
#~ msgstr "Número de mensajes no leídos"

#~ msgid "Unread Messages"
#~ msgstr "Mensajes no leídos"

#~ msgid "Unread Messages Counter"
#~ msgstr "Contador de mensajes no leídos"

#~ msgid "Cryptography version is not supported. Upgrade to 3.0.0 or greater."
#~ msgstr "Versión de criptografía no soportada. Actualice a 3.0.0 o superior."

#~ msgid "%s_report_%s.txt"
#~ msgstr "%s_report_%s.txt"

#~ msgid "AEAT export configurationline"
#~ msgstr "Línea de configuración de exportación de la AEAT"

#~ msgid "Apply sign"
#~ msgstr "Aplicar signo"

#~ msgid "BOE export configurations"
#~ msgstr "Configuraciones de exportación a BOE"

#~ msgid "Calculation date"
#~ msgstr "Fecha de cálculo"

#~ msgid "Conditional expression"
#~ msgstr "Expresión condicional"

#~ msgid "Contact email"
#~ msgstr "Correo electrónico de contacto"

#~ msgid "Field type"
#~ msgstr "Tipo de campo"

#~ msgid "Fixed value"
#~ msgstr "Valor fijo"

#~ msgid "Followers (Channels)"
#~ msgstr "Seguidores (Canales)"

#~ msgid "Period type"
#~ msgstr "Tipo de periodo"

#~ msgid "Repeat expression"
#~ msgstr "Expresión de repetición"

#~ msgid "Tax code mapping lines"
#~ msgstr "Líneas de mapeo de impuestos"

#~ msgid "To regularize"
#~ msgstr "Para regularizar"

#~ msgid "OpenSSL version is not supported. Upgrade to 0.15 or greater."
#~ msgstr "Versión de OpenSSL no soportada. Actualice a 0.15 o superior."

#~ msgid "If checked new messages require your attention."
#~ msgstr "Si está marcado, hay nuevos mensajes que requieren su atención."

#~ msgid "Overdue"
#~ msgstr "Retraso"

#~ msgid "Planned"
#~ msgstr "Planificado"

#~ msgid "Today"
#~ msgstr "Hoy"
#~ msgstr "Error de envío del mensaje"
11 changes: 10 additions & 1 deletion l10n_es_aeat/i18n/l10n_es_aeat.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-30 08:51+0000\n"
"PO-Revision-Date: 2024-01-30 08:51+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -962,6 +964,7 @@ msgstr ""
#. module: l10n_es_aeat
#: model:ir.model.fields,field_description:l10n_es_aeat.field_l10n_es_aeat_report__representative_vat
#: model:ir.model.fields,field_description:l10n_es_aeat.field_l10n_es_aeat_report_tax_mapping__representative_vat
#: model:ir.model.fields,field_description:l10n_es_aeat.field_res_company__representative_vat
msgid "L.R. VAT number"
msgstr ""

Expand Down Expand Up @@ -1018,6 +1021,12 @@ msgstr ""
msgid "Left"
msgstr ""

#. module: l10n_es_aeat
#: model:ir.model.fields,help:l10n_es_aeat.field_res_company__representative_vat
msgid ""
"Legal Representative VAT number for all the AEAT reports of this company."
msgstr ""

#. module: l10n_es_aeat
#: model:ir.model.fields,help:l10n_es_aeat.field_l10n_es_aeat_report__representative_vat
#: model:ir.model.fields,help:l10n_es_aeat.field_l10n_es_aeat_report_tax_mapping__representative_vat
Expand Down
7 changes: 7 additions & 0 deletions l10n_es_aeat/models/l10n_es_aeat_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def _get_export_config(self, date):
readonly=True,
help="Legal Representative VAT number.",
states={"draft": [("readonly", False)]},
compute="_compute_representative_vat",
store=True,
)
year = fields.Integer(
default=_default_year,
Expand Down Expand Up @@ -353,6 +355,11 @@ def _compute_dates(self):
% (report.year, month, monthrange(report.year, month)[1])
)

@api.depends("company_id")
def _compute_representative_vat(self):
for report in self:
report.representative_vat = report.company_id.representative_vat

@api.depends("date_start")
def _compute_export_config_id(self):
for report in self:
Expand Down
5 changes: 5 additions & 0 deletions l10n_es_aeat/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class ResCompany(models.Model):
_inherit = "res.company"

tax_agency_id = fields.Many2one("aeat.tax.agency", string="Tax Agency")
representative_vat = fields.Char(
string="L.R. VAT number",
size=9,
help="Legal Representative VAT number for all the AEAT reports of this company.",
)

@api.model_create_multi
def create(self, vals_list):
Expand Down
1 change: 1 addition & 0 deletions l10n_es_aeat/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
* Valentin Vinagre <[email protected]>
* Manuel Regidor <[email protected]>
* Jairo Llopis (https://www.moduon.team)
* Loida Vilaplana (https://www.moduon.team)
4 changes: 3 additions & 1 deletion l10n_es_aeat/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">AEAT Base</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5ca3ae78198f171da3a0d88ea1cb1e609deeae1bda62c58bf34d153b394e89ac
!! source digest: sha256:3eb122d2b5cc43ff9b532f353624cbbf7feef6ed284cec3b71ebda106ccbfd42
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-spain/tree/16.0/l10n_es_aeat"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-16-0/l10n-spain-16-0-l10n_es_aeat"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Módulo base para declaraciones de la AEAT, que incluye:</p>
Expand Down Expand Up @@ -505,6 +506,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Contributors</a></h2>
<li>Valentin Vinagre &lt;<a class="reference external" href="mailto:valentin.vinagre&#64;sygel.es">valentin.vinagre&#64;sygel.es</a>&gt;</li>
<li>Manuel Regidor &lt;<a class="reference external" href="mailto:manuel.regidor&#64;sygel.es">manuel.regidor&#64;sygel.es</a>&gt;</li>
<li>Jairo Llopis (<a class="reference external" href="https://www.moduon.team">https://www.moduon.team</a>)</li>
<li>Loida Vilaplana (<a class="reference external" href="https://www.moduon.team">https://www.moduon.team</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
6 changes: 6 additions & 0 deletions l10n_es_aeat/tests/test_l10n_es_aeat_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from odoo import exceptions, fields
from odoo.tests import common
from odoo.tests.common import Form

TEST_MODEL_NAME = "l10n.es.aeat.mod999.report"

Expand Down Expand Up @@ -83,3 +84,8 @@ def test_new_company(self):
[("name", "=", "aeat999-sequence"), ("company_id", "=", company.id)]
)
)

def test_default_representative_vat(self):
self.env.company.representative_vat = "36477262K"
report_form = Form(self.AeatReport)
self.assertEqual(report_form.representative_vat, "36477262K")
1 change: 1 addition & 0 deletions l10n_es_aeat/views/res_company_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<group>
<group name="aeat_config">
<field name="tax_agency_id" />
<field name="representative_vat" />
</group>
</group>
</page>
Expand Down

0 comments on commit aa85e2d

Please sign in to comment.