Skip to content

Commit bb71194

Browse files
SirPyTechaleuffre
authored andcommitted
[ADD] l10n_it_partner_statement_riba
1 parent 63eee8c commit bb71194

File tree

18 files changed

+920
-0
lines changed

18 files changed

+920
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
==================================================
2+
ITA - Estratti conto cliente con ricevute bancarie
3+
==================================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:8e2dc803302c8e438b0e43a1304284ca6d997884765c970deebb9e09d96e4040
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
20+
:target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_partner_statement_riba
21+
:alt: OCA/l10n-italy
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_partner_statement_riba
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=14.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
**Italiano**
32+
33+
Nell'estratto conto in sospeso del partner, permette di mostrare se la fattura è ancora in sospeso perché collegata a una RiBa da pagare o insoluta.
34+
35+
**English**
36+
37+
In the partner's oustanding statement, allow to show if the Invoice is still due because the linked RiBa is to be paid or unsolved.
38+
39+
**Table of contents**
40+
41+
.. contents::
42+
:local:
43+
44+
Bug Tracker
45+
===========
46+
47+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
48+
In case of trouble, please check there if your issue has already been reported.
49+
If you spotted it first, help us to smash it by providing a detailed and welcomed
50+
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_partner_statement_riba%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
51+
52+
Do not contact contributors directly about support or help with technical issues.
53+
54+
Credits
55+
=======
56+
57+
Authors
58+
~~~~~~~
59+
60+
* PyTech
61+
62+
Contributors
63+
~~~~~~~~~~~~
64+
65+
* `PyTech <https://www.pytech.it>`_:
66+
67+
* Simone Rubino <simone.rubino@pytech.it>
68+
69+
Maintainers
70+
~~~~~~~~~~~
71+
72+
This module is maintained by the OCA.
73+
74+
.. image:: https://odoo-community.org/logo.png
75+
:alt: Odoo Community Association
76+
:target: https://odoo-community.org
77+
78+
OCA, or the Odoo Community Association, is a nonprofit organization whose
79+
mission is to support the collaborative development of Odoo features and
80+
promote its widespread use.
81+
82+
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_partner_statement_riba>`_ project on GitHub.
83+
84+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import reports
4+
from . import wizards
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2025 Simone Rubino - PyTech
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "ITA - Estratti conto cliente con ricevute bancarie",
6+
"version": "14.0.1.0.0",
7+
"author": "PyTech, Odoo Community Association (OCA)",
8+
"category": "Localization/Italy",
9+
"summary": "Visualizzare le RiBa negli estratti conto cliente.",
10+
"website": "https://github.com/OCA/l10n-italy",
11+
"license": "AGPL-3",
12+
"depends": [
13+
"l10n_it_ricevute_bancarie",
14+
"partner_statement",
15+
],
16+
"data": [
17+
"reports/outstanding_statement.xml",
18+
"wizards/outstanding_statement_views.xml",
19+
],
20+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * l10n_it_partner_statement_riba
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 14.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-05-22 15:52+0000\n"
10+
"PO-Revision-Date: 2025-05-22 15:52+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: l10n_it_partner_statement_riba
19+
#: model:ir.model.fields,help:l10n_it_partner_statement_riba.field_outstanding_statement_wizard__l10n_it_show_riba
20+
msgid ""
21+
"Add a column in the statements to identify the lines that come from RiBa."
22+
msgstr ""
23+
"Aggiunge una colonna nei resoconti per identificare le righe causate dalle RiBa."
24+
25+
#. module: l10n_it_partner_statement_riba
26+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_outstanding_statement_wizard__display_name
27+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_report_p_s_report_outstanding_statement_xlsx__display_name
28+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_report_partner_statement_outstanding_statement__display_name
29+
msgid "Display Name"
30+
msgstr "Nome visualizzato"
31+
32+
#. module: l10n_it_partner_statement_riba
33+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_outstanding_statement_wizard__id
34+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_report_p_s_report_outstanding_statement_xlsx__id
35+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_report_partner_statement_outstanding_statement__id
36+
msgid "ID"
37+
msgstr ""
38+
39+
#. module: l10n_it_partner_statement_riba
40+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_outstanding_statement_wizard____last_update
41+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_report_p_s_report_outstanding_statement_xlsx____last_update
42+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_report_partner_statement_outstanding_statement____last_update
43+
msgid "Last Modified on"
44+
msgstr "Ultima modifica il"
45+
46+
#. module: l10n_it_partner_statement_riba
47+
#: model:ir.model,name:l10n_it_partner_statement_riba.model_outstanding_statement_wizard
48+
msgid "Outstanding Statement Wizard"
49+
msgstr "Procedura guidata estratto conto in sospeso"
50+
51+
#. module: l10n_it_partner_statement_riba
52+
#: model:ir.model,name:l10n_it_partner_statement_riba.model_report_p_s_report_outstanding_statement_xlsx
53+
msgid "Outstanding Statement XLSL Report"
54+
msgstr "Rendiconto XLSX estratti conto in sospeso"
55+
56+
#. module: l10n_it_partner_statement_riba
57+
#: model:ir.model,name:l10n_it_partner_statement_riba.model_report_partner_statement_outstanding_statement
58+
msgid "Partner Outstanding Statement"
59+
msgstr "Estratto conto in sospeso partner"
60+
61+
#. module: l10n_it_partner_statement_riba
62+
#: code:addons/l10n_it_partner_statement_riba/reports/outstanding_statement_xlsx.py:0
63+
#: code:addons/l10n_it_partner_statement_riba/tests/test_outstanding_statement.py:0
64+
#: model_terms:ir.ui.view,arch_db:l10n_it_partner_statement_riba.outstanding_balance
65+
#, python-format
66+
msgid "RiBa"
67+
msgstr ""
68+
69+
#. module: l10n_it_partner_statement_riba
70+
#: model:ir.model.fields,field_description:l10n_it_partner_statement_riba.field_outstanding_statement_wizard__l10n_it_show_riba
71+
msgid "Show RiBa"
72+
msgstr "Mostrare RiBa"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* `PyTech <https://www.pytech.it>`_:
2+
3+
* Simone Rubino <simone.rubino@pytech.it>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**Italiano**
2+
3+
Nell'estratto conto in sospeso del partner, permette di mostrare se la fattura è ancora in sospeso perché collegata a una RiBa da pagare o insoluta.
4+
5+
**English**
6+
7+
In the partner's oustanding statement, allow to show if the Invoice is still due because the linked RiBa is to be paid or unsolved.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import outstanding_statement_xlsx
4+
from . import outstanding_statement
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2025 Simone Rubino - PyTech
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, models
5+
6+
7+
class OutstandingStatementReport(models.AbstractModel):
8+
_inherit = "report.partner_statement.outstanding_statement"
9+
10+
@api.model
11+
def _l10n_it_riba_inject_report_values(self, report_values):
12+
"""Include in `report_values` values for RiBa."""
13+
for _partner_id, partner_data in report_values["data"].items():
14+
currencies = partner_data.get("currencies", {})
15+
for _currency_id, currency_data in currencies.items():
16+
for line in currency_data.get("lines", []):
17+
move_line = self.env["account.move.line"].browse(line["id"])
18+
move = move_line.move_id
19+
# account.move.open_amount cannot be included
20+
# in the report queries
21+
# because is computed and not stored
22+
line["l10n_it_riba_open"] = move.is_unsolved or move.open_amount
23+
return report_values
24+
25+
@api.model
26+
def _get_report_values(self, docids, data=None):
27+
report_values = super()._get_report_values(docids, data=data)
28+
report_values["l10n_it_show_riba"] = data["l10n_it_show_riba"]
29+
if report_values["l10n_it_show_riba"]:
30+
report_values = self._l10n_it_riba_inject_report_values(
31+
report_values,
32+
)
33+
return report_values
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!--
3+
~ Copyright 2025 Simone Rubino - PyTech
4+
~ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
5+
-->
6+
<odoo>
7+
<template
8+
id="outstanding_balance"
9+
inherit_id="partner_statement.outstanding_balance"
10+
>
11+
<xpath
12+
expr="//table[hasclass('table-statement')]/thead/tr/th[last()]"
13+
position="before"
14+
>
15+
<th t-if="l10n_it_show_riba" name="l10n_it_riba_state_th">
16+
RiBa
17+
</th>
18+
</xpath>
19+
<xpath
20+
expr="//table[hasclass('table-statement')]/tbody/tr[1]/td[last()]"
21+
position="before"
22+
>
23+
<td t-if="l10n_it_show_riba" name="l10n_it_riba_state_td">
24+
<span t-if="line['l10n_it_riba_open']" class="fa fa-check" />
25+
</td>
26+
</xpath>
27+
<!-- The last line shows the total, add an empty cell to keep it aligned. -->
28+
<xpath
29+
expr="//table[hasclass('table-statement')]/tbody/tr[last()]/td[last()]"
30+
position="before"
31+
>
32+
<td t-if="l10n_it_show_riba" name="l10n_it_riba_state_last_td" />
33+
</xpath>
34+
</template>
35+
</odoo>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright 2025 Simone Rubino - PyTech
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import _, models
5+
6+
from odoo.addons.report_xlsx_helper.report.report_xlsx_format import FORMATS
7+
8+
9+
class OutstandingStatementXslx(models.AbstractModel):
10+
_inherit = "report.p_s.report_outstanding_statement_xlsx"
11+
12+
def _get_currency_header_row_data(self, partner, currency, data):
13+
row_data = super()._get_currency_header_row_data(partner, currency, data)
14+
if data["l10n_it_show_riba"]:
15+
last_col_pos = row_data[-1]["col_pos"]
16+
row_data.insert(
17+
-1,
18+
{
19+
"col_pos": last_col_pos,
20+
"sheet_func": "write",
21+
"args": (_("RiBa"), FORMATS["format_theader_yellow_center"]),
22+
},
23+
)
24+
row_data[-1]["col_pos"] = last_col_pos + 1
25+
return row_data
26+
27+
def _get_currency_line_row_data(self, partner, currency, data, line):
28+
row_data = super()._get_currency_line_row_data(partner, currency, data, line)
29+
if data["l10n_it_show_riba"]:
30+
if line.get("blocked"):
31+
format_distributed = FORMATS["format_distributed_blocked"]
32+
else:
33+
format_distributed = FORMATS["format_distributed"]
34+
35+
move_line = self.env["account.move.line"].browse(line["id"])
36+
move = move_line.move_id
37+
# account.move.open_amount cannot be included
38+
# in the report queries
39+
# because is computed and not stored
40+
is_riba_open = move.is_unsolved or move.open_amount
41+
last_col_pos = row_data[-1]["col_pos"]
42+
row_data.insert(
43+
-1,
44+
{
45+
"col_pos": last_col_pos,
46+
"sheet_func": "write",
47+
"args": ("X" if is_riba_open else "", format_distributed),
48+
},
49+
)
50+
row_data[-1]["col_pos"] = last_col_pos + 1
51+
return row_data
52+
53+
def _get_currency_footer_row_data(self, partner, currency, data):
54+
row_data = super()._get_currency_footer_row_data(partner, currency, data)
55+
if data["l10n_it_show_riba"]:
56+
row_data[-1]["col_pos"] += 1
57+
return row_data

0 commit comments

Comments
 (0)