Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] l10n_es_aeat: NIF del representante legal por defecto #3389

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:a1c65d94005333dff94ad237fc563bc394096dae408ad442adb1478d0282b99a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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 @@ -987,6 +987,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 @@ -1043,6 +1044,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 @@ -1837,79 +1846,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 @@ -968,6 +970,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 @@ -1024,6 +1027,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
10 changes: 8 additions & 2 deletions l10n_es_aeat/models/l10n_es_aeat_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ def _get_export_config(self, date):
representative_vat = fields.Char(
string="L.R. VAT number",
size=9,
readonly=True,
readonly=False,
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 +354,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:a1c65d94005333dff94ad237fc563bc394096dae408ad442adb1478d0282b99a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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")
5 changes: 4 additions & 1 deletion l10n_es_aeat/views/aeat_report_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@
name="counterpart_account_id"
attrs="{'invisible': [('allow_posting', '=', False)]}"
/>
<field name="representative_vat" />
<field
name="representative_vat"
attrs="{'readonly': [('state', '!=', 'draft')]}"
/>
<field name="support_type" />
<field name="calculation_date" readonly="1" />
<field name="partner_id" invisible="1" />
Expand Down
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
Loading