Skip to content

Commit

Permalink
[FIX] l10n_es_aeat_mod190: Visible computo de los 3 primeros hijos
Browse files Browse the repository at this point in the history
El computo de los 3 primeros hijos sólo debe ser visible para percepciones correspondientes a las claves A, B01, B03 y C

@moduon MT-8874

Co-authored-by: Loida Vilaplana <[email protected]>
  • Loading branch information
EmilioPascual and loida-vm committed Feb 28, 2025
1 parent aaab375 commit b315aeb
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 25 deletions.
33 changes: 9 additions & 24 deletions l10n_es_aeat_mod190/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-22 13:36+0000\n"
"Last-Translator: loida-vm <[email protected]>\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2025-02-28 09:45+0100\n"
"Last-Translator: Emilio Pascual <[email protected]>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -871,6 +872,12 @@ msgstr "Ingresos a cuenta repercutidos"
msgid "Is Aeat Perception Subkey Visible"
msgstr "Es visible la subclave Aeat de Percepción"

#. module: l10n_es_aeat_mod190
#: model:ir.model.fields,field_description:l10n_es_aeat_mod190.field_res_partner__is_first_child_computation_visible
#: model:ir.model.fields,field_description:l10n_es_aeat_mod190.field_res_users__is_first_child_computation_visible
msgid "Is First Child Computation Visible"
msgstr "Computo de los primeros hijos visible"

#. module: l10n_es_aeat_mod190
#: model:ir.model.fields,field_description:l10n_es_aeat_mod190.field_l10n_es_aeat_mod190_report__message_is_follower
msgid "Is Follower"
Expand Down Expand Up @@ -1719,25 +1726,3 @@ msgstr "[03] Importe de las retenciones"
#: model:ir.model.fields,field_description:l10n_es_aeat_mod190.field_l10n_es_aeat_mod190_report_line__ejercicio_devengo
msgid "year"
msgstr "año"

#~ msgid "Calculated"
#~ msgstr "Calculado"

#, python-format
#~ msgid "You have to recalculate the report before confirm it."
#~ msgstr "Debe volver a calcular el informe antes de confirmarlo."

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

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

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

#~ msgid "Unread Messages"
#~ msgstr "Mensajes No Leídos"

#~ msgid "Unread Messages Counter"
#~ msgstr "Contador de Mensajes no leídos"
6 changes: 6 additions & 0 deletions l10n_es_aeat_mod190/i18n/l10n_es_aeat_mod190.pot
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,12 @@ msgstr ""
msgid "Is Aeat Perception Subkey Visible"
msgstr ""

#. module: l10n_es_aeat_mod190
#: model:ir.model.fields,field_description:l10n_es_aeat_mod190.field_res_partner__is_first_child_computation_visible
#: model:ir.model.fields,field_description:l10n_es_aeat_mod190.field_res_users__is_first_child_computation_visible
msgid "Is First Child Computation Visible"
msgstr ""

#. module: l10n_es_aeat_mod190
#: model:ir.model.fields,field_description:l10n_es_aeat_mod190.field_l10n_es_aeat_mod190_report__message_is_follower
msgid "Is Follower"
Expand Down
21 changes: 21 additions & 0 deletions l10n_es_aeat_mod190/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ class ResPartner(models.Model):
is_aeat_perception_subkey_visible = fields.Boolean(
compute="_compute_is_aeat_perception_subkey_visible"
)
is_first_child_computation_visible = fields.Boolean(
compute="_compute_is_first_child_computation_visible"
)

@api.depends("aeat_perception_key_id", "aeat_perception_subkey_id")
def _compute_ad_required(self):
Expand All @@ -264,6 +267,24 @@ def _compute_is_aeat_perception_subkey_visible(self):
)
)

@api.depends("aeat_perception_key_id", "aeat_perception_subkey_id")
def _compute_is_first_child_computation_visible(self):
aeat_perception_key_id = [ # A, C

Check warning on line 272 in l10n_es_aeat_mod190/models/res_partner.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_aeat_mod190/models/res_partner.py#L272

Added line #L272 was not covered by tests
"l10n_es_aeat_mod190.aeat_m190_perception_key_01",
"l10n_es_aeat_mod190.aeat_m190_perception_key_03",
]
aeat_perception_subkey_id = [ # B01, B03

Check warning on line 276 in l10n_es_aeat_mod190/models/res_partner.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_aeat_mod190/models/res_partner.py#L276

Added line #L276 was not covered by tests
"l10n_es_aeat_mod190.aeat_m190_perception_subkey_02_01",
"l10n_es_aeat_mod190.aeat_m190_perception_subkey_02_03",
]
for record in self:
record.is_first_child_computation_visible = (

Check warning on line 281 in l10n_es_aeat_mod190/models/res_partner.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_aeat_mod190/models/res_partner.py#L281

Added line #L281 was not covered by tests
record.aeat_perception_key_id
in {self.env.ref(item) for item in aeat_perception_key_id}
or record.aeat_perception_subkey_id
in {self.env.ref(item) for item in aeat_perception_subkey_id}
)

@api.onchange("aeat_perception_key_id")
def onchange_aeat_perception_key_id(self):
if self.aeat_perception_key_id:
Expand Down
6 changes: 5 additions & 1 deletion l10n_es_aeat_mod190/views/partner_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
/>
<field name="ad_required" invisible="1" />
<field name="is_aeat_perception_subkey_visible" invisible="1" />
<field
name="is_first_child_computation_visible"
invisible="1"
/>
</group>
<group
string="Perception data"
Expand Down Expand Up @@ -62,7 +66,7 @@
<group
groups="account.group_account_invoice,l10n_es_aeat.group_account_aeat"
string="First 3 compute"
attrs="{'invisible': [('is_aeat_perception_subkey_visible', '=', False)]}"
attrs="{'invisible': [('is_first_child_computation_visible', '=', False)]}"
>
<field name="computo_primeros_hijos_1" string="1" />
<field name="computo_primeros_hijos_2" string="2" />
Expand Down

0 comments on commit b315aeb

Please sign in to comment.