Skip to content

Commit

Permalink
Merge oca/16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
blaskurain committed Sep 20, 2024
2 parents 5954146 + 971a2f0 commit a8b48e9
Show file tree
Hide file tree
Showing 19 changed files with 167 additions and 37 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ addon | version | maintainers | summary
[l10n_es_aeat_mod303_vat_prorate](l10n_es_aeat_mod303_vat_prorate/) | 16.0.1.0.1 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Prorrata de IVA [303]
[l10n_es_aeat_mod347](l10n_es_aeat_mod347/) | 16.0.1.7.3 | | AEAT modelo 347
[l10n_es_aeat_mod347_igic](l10n_es_aeat_mod347_igic/) | 16.0.1.0.0 | [![nicolasramos](https://github.com/nicolasramos.png?size=30px)](https://github.com/nicolasramos) | AEAT modelo 347 IGIC
[l10n_es_aeat_mod349](l10n_es_aeat_mod349/) | 16.0.1.3.1 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | AEAT modelo 349
[l10n_es_aeat_mod349](l10n_es_aeat_mod349/) | 16.0.1.3.2 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | AEAT modelo 349
[l10n_es_aeat_mod369](l10n_es_aeat_mod369/) | 16.0.1.1.0 | | AEAT modelo 369
[l10n_es_aeat_mod390](l10n_es_aeat_mod390/) | 16.0.2.6.0 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | AEAT modelo 390
[l10n_es_aeat_partner_check](l10n_es_aeat_partner_check/) | 16.0.1.0.1 | | AEAT - Comprobación de Calidad de datos identificativos
Expand Down Expand Up @@ -67,7 +67,7 @@ addon | version | maintainers | summary
[l10n_es_payment_order_confirming_sabadell](l10n_es_payment_order_confirming_sabadell/) | 16.0.1.0.1 | | Exportación de fichero bancario Confirming para Banco Sabadell
[l10n_es_pos](l10n_es_pos/) | 16.0.1.0.2 | | Punto de venta adaptado a la legislación española
[l10n_es_pos_by_device](l10n_es_pos_by_device/) | 16.0.1.0.1 | [![ao-landoo](https://github.com/ao-landoo.png?size=30px)](https://github.com/ao-landoo) | Múltiples dispositivos por sesión en el punto de venta
[l10n_es_pos_sii](l10n_es_pos_sii/) | 16.0.2.0.0 | | Envío de pedidos del TPV al SII
[l10n_es_pos_sii](l10n_es_pos_sii/) | 16.0.2.1.0 | | Envío de pedidos del TPV al SII
[l10n_es_sigaus_account](l10n_es_sigaus_account/) | 16.0.1.0.0 | | Sistema de gestión de aceites industriales usados en España - Facturación
[l10n_es_sigaus_purchase](l10n_es_sigaus_purchase/) | 16.0.1.0.1 | | Sistema de gestión de aceites industriales usados en España - Compras
[l10n_es_sigaus_sale](l10n_es_sigaus_sale/) | 16.0.1.0.1 | | Sist. gestión aceites industriales usados en España - Ventas
Expand All @@ -81,7 +81,7 @@ addon | version | maintainers | summary
[l10n_es_vat_book_igic](l10n_es_vat_book_igic/) | 16.0.1.0.0 | [![nicolasramos](https://github.com/nicolasramos.png?size=30px)](https://github.com/nicolasramos) | Libro de IGIC
[l10n_es_vat_book_invoice_summary](l10n_es_vat_book_invoice_summary/) | 16.0.1.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Facturas resumen en libro de IVA
[l10n_es_vat_book_oss](l10n_es_vat_book_oss/) | 16.0.1.0.0 | | Libro de IVA OSS
[l10n_es_vat_prorate](l10n_es_vat_prorate/) | 16.0.1.0.1 | | Prorrata de IVA para la localización española
[l10n_es_vat_prorate](l10n_es_vat_prorate/) | 16.0.1.1.0 | | Prorrata de IVA para la localización española
[payment_redsys](payment_redsys/) | 16.0.1.0.1 | | Payment Acquirer: Redsys Implementation

[//]: # (end addons)
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_aeat_mod349/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AEAT modelo 349
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:afcf0458fa11cc81bd00037f9ee9a8d9552b79f53d977a6348aadb0bd6aa6563
!! source digest: sha256:b2bb38b300e3376bea4b1999a10bb6e47b946cfbff1b5a9c64ee245ab037336d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_aeat_mod349/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{
"name": "AEAT modelo 349",
"version": "16.0.1.3.1",
"version": "16.0.1.3.2",
"author": "Tecnativa, ForgeFlow, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Localisation/Accounting",
Expand Down
14 changes: 0 additions & 14 deletions l10n_es_aeat_mod349/models/mod349.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,25 +224,12 @@ def _create_349_refund_records(self):
if original_details:
# There's at least one previous 349 declaration report
report = original_details.mapped("report_id")[:1]
partner_id = original_details.mapped("partner_id")[:1]
original_details = original_details.filtered(
lambda d: d.report_id == report
)
origin_amount = sum(original_details.mapped("amount_untaxed"))
period_type = report.period_type
year = str(report.year)

# Sum all details period origin
all_details_period = detail_obj.search(
[
("partner_id", "=", partner_id.id),
("partner_record_id.operation_key", "=", op_key),
("report_id", "=", report.id),
],
order="report_id desc",
)
origin_amount = sum(all_details_period.mapped("amount_untaxed"))

# If there are intermediate periods between the original
# period and the period where the rectification is taking
# place, it's necessary to check if there is any rectification
Expand All @@ -261,7 +248,6 @@ def _create_349_refund_records(self):
)
if last_refund_detail:
origin_amount = last_refund_detail.refund_id.total_operation_amount

else:
# There's no previous 349 declaration report in Odoo
original_amls = move_line_obj.search(
Expand Down
13 changes: 8 additions & 5 deletions l10n_es_aeat_mod349/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">AEAT modelo 349</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:afcf0458fa11cc81bd00037f9ee9a8d9552b79f53d977a6348aadb0bd6aa6563
!! source digest: sha256:b2bb38b300e3376bea4b1999a10bb6e47b946cfbff1b5a9c64ee245ab037336d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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_mod349"><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_mod349"><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 para la presentación del Modelo AEAT 349 (Declaración Recapitulativa de
Expand Down Expand Up @@ -538,7 +539,9 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_pos_sii/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Envío de pedidos del TPV al SII
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:87cf1bd889797cdb7318b3784ef6923204bbf29432748ef9b8245324e2fca76c
!! source digest: sha256:d336aa126fe4478ed702b2375e2f16399293ed03bc06b1459204cfaf5e2e9b01
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
3 changes: 2 additions & 1 deletion l10n_es_pos_sii/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
"author": "Aures Tic, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-spain",
"license": "AGPL-3",
"version": "16.0.2.0.0",
"version": "16.0.2.1.0",
"depends": [
"point_of_sale",
"l10n_es_pos",
"l10n_es_aeat_sii_oca",
"pos_default_partner",
],
"data": [
"data/aeat_sii_queue_job.xml",
"views/pos_order.xml",
"views/res_company.xml",
],
Expand Down
17 changes: 17 additions & 0 deletions l10n_es_pos_sii/data/aeat_sii_queue_job.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="pos_order_validate_sii" model="queue.job.channel">
<field name="name">pos_order_validate_sii</field>
<field name="parent_id" ref="queue_job.channel_root" />
</record>
<record id="job_function_confirm_one_document" model="queue.job.function">
<field name="model_id" ref="point_of_sale.model_pos_order" />
<field name="method">confirm_one_document</field>
<field name="channel_id" ref="pos_order_validate_sii" />
</record>
<record id="job_function_cancel_one_invoice" model="queue.job.function">
<field name="model_id" ref="point_of_sale.model_pos_order" />
<field name="method">cancel_one_invoice</field>
<field name="channel_id" ref="pos_order_validate_sii" />
</record>
</odoo>
2 changes: 1 addition & 1 deletion l10n_es_pos_sii/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Envío de pedidos del TPV al SII</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:87cf1bd889797cdb7318b3784ef6923204bbf29432748ef9b8245324e2fca76c
!! source digest: sha256:d336aa126fe4478ed702b2375e2f16399293ed03bc06b1459204cfaf5e2e9b01
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.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_pos_sii"><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_pos_sii"><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>Envío al SII de pedidos del TPV de forma individual.</p>
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_vat_prorate/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Prorrata de IVA
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:59f1ace90d09cc30ce3bf2a8cdb9d9c5670648913348b64eb9980c4ffb977bff
!! source digest: sha256:32ee5897933f771dc81edfa6475c7190b53b1a5b2724d94f89f7caef95aff379
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_vat_prorate/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Prorrata de IVA",
"summary": "Prorrata de IVA para la localización española",
"version": "16.0.1.0.1",
"version": "16.0.1.1.0",
"license": "AGPL-3",
"author": "Creu Blanca, Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-spain",
Expand Down
10 changes: 10 additions & 0 deletions l10n_es_vat_prorate/i18n/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ msgstr "Compte prorratejat"
msgid "Prorate Account Template"
msgstr "Plantilla del compte prorratejat"

#. module: l10n_es_vat_prorate
#: model:ir.model.fields,field_description:l10n_es_vat_prorate.field_res_company__prorrate_asset_account_id
msgid "Prorrate Asset Account"
msgstr ""

#. module: l10n_es_vat_prorate
#: model:ir.model.fields,field_description:l10n_es_vat_prorate.field_res_company__prorrate_investment_account_id
msgid "Prorrate Investment Account"
msgstr ""

#. module: l10n_es_vat_prorate
#: model:ir.model,name:l10n_es_vat_prorate.model_account_tax
msgid "Tax"
Expand Down
10 changes: 10 additions & 0 deletions l10n_es_vat_prorate/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ msgstr "Cuenta prorrateada"
msgid "Prorate Account Template"
msgstr "Plantilla de cuenta prorrateada"

#. module: l10n_es_vat_prorate
#: model:ir.model.fields,field_description:l10n_es_vat_prorate.field_res_company__prorrate_asset_account_id
msgid "Prorrate Asset Account"
msgstr ""

#. module: l10n_es_vat_prorate
#: model:ir.model.fields,field_description:l10n_es_vat_prorate.field_res_company__prorrate_investment_account_id
msgid "Prorrate Investment Account"
msgstr ""

#. module: l10n_es_vat_prorate
#: model:ir.model,name:l10n_es_vat_prorate.model_account_tax
msgid "Tax"
Expand Down
10 changes: 10 additions & 0 deletions l10n_es_vat_prorate/i18n/l10n_es_vat_prorate.pot
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ msgstr ""
msgid "Prorate Account Template"
msgstr ""

#. module: l10n_es_vat_prorate
#: model:ir.model.fields,field_description:l10n_es_vat_prorate.field_res_company__prorrate_asset_account_id
msgid "Prorrate Asset Account"
msgstr ""

#. module: l10n_es_vat_prorate
#: model:ir.model.fields,field_description:l10n_es_vat_prorate.field_res_company__prorrate_investment_account_id
msgid "Prorrate Investment Account"
msgstr ""

#. module: l10n_es_vat_prorate
#: model:ir.model,name:l10n_es_vat_prorate.model_account_tax
msgid "Tax"
Expand Down
5 changes: 4 additions & 1 deletion l10n_es_vat_prorate/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ def _compute_all_tax(self):
new_key.update(
{
"vat_prorate": True,
"account_id": line.account_id.id,
"account_id": line.company_id._get_tax_prorrate_account_map().get(
line.account_id.account_type
)
or line.account_id.id,
"analytic_distribution": line.analytic_distribution,
}
)
Expand Down
49 changes: 47 additions & 2 deletions l10n_es_vat_prorate/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2023 Tecnativa Carolina Fernandez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
from odoo import _, api, fields, models, tools
from odoo.exceptions import ValidationError


Expand All @@ -13,6 +13,36 @@ class ResCompany(models.Model):
vat_prorate_ids = fields.One2many(
"res.company.vat.prorate", inverse_name="company_id"
)
prorrate_asset_account_id = fields.Many2one(
"account.account",
domain="[('company_id', '=', id)]",
compute="_compute_prorrate_accounts",
store=True,
readonly=False,
)
prorrate_investment_account_id = fields.Many2one(
"account.account",
domain="[('company_id', '=', id)]",
compute="_compute_prorrate_accounts",
store=True,
readonly=False,
)

@api.depends("chart_template_id", "with_vat_prorate")
def _compute_prorrate_accounts(self):
for record in self:
if record.with_vat_prorate and record.chart_template_id:
record.prorrate_asset_account_id = self.env.ref(
"l10n_es.%s_account_common_6341" % record.id,
raise_if_not_found=False,
)
record.prorrate_investment_account_id = self.env.ref(
"l10n_es.%s_account_common_6342" % record.id,
raise_if_not_found=False,
)
else:
record.prorrate_asset_account_id = False
record.prorrate_investment_account_id = False

def get_prorate(self, date):
self.ensure_one()
Expand All @@ -29,14 +59,29 @@ def _check_vat_prorate_ids(self):
if rec.with_vat_prorate and not rec.vat_prorate_ids:
raise ValidationError(_("You must complete VAT prorate information"))

@tools.ormcache(
"self.id",
"self.prorrate_asset_account_id.id",
"self.prorrate_investment_account_id.id",
)
def _get_tax_prorrate_account_map(self):
"""Get the account mapping according user type"""
return {
"asset_current": self.prorrate_asset_account_id.id,
"asset_non_current": self.prorrate_asset_account_id.id,
"asset_fixed": self.prorrate_asset_account_id.id,
"liability_current": self.prorrate_investment_account_id.id,
"liability_non_current": self.prorrate_investment_account_id.id,
}


class ResCompanyVatProrate(models.Model):
_name = "res.company.vat.prorate"
_description = "VAT Prorate table"
_rec_name = "date"
_order = "date DESC"

company_id = fields.Many2one("res.company", required=True)
company_id = fields.Many2one("res.company", required=True, ondelete="cascade")
date = fields.Date(required=True, default=fields.Date.today())
vat_prorate = fields.Float()

Expand Down
Loading

0 comments on commit a8b48e9

Please sign in to comment.