Skip to content

Commit 1f674b5

Browse files
committed
[UPD] l10n_it_financial_statement_eu: aggiornato PR OCA#4713
1 parent 8528619 commit 1f674b5

6 files changed

Lines changed: 51 additions & 34 deletions

File tree

l10n_it_financial_statement_eu/models/financial_statement_eu.py

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class FinancialStatementEU(models.Model):
1515
_name = "financial.statement.eu"
1616
_description = "Financial statement EU line"
1717
_rec_names_search = ["complete_name"]
18+
_rec_name = "complete_name"
1819
zone_bal = fields.Selection(
1920
[
2021
("PA", "Assets"),
@@ -108,21 +109,30 @@ def financial_statement_eu_account_association(
108109
credit_fse_id,
109110
force_update,
110111
):
111-
acc_ids = self.env["account.account"].search([("code", "=ilike", acc_code)])
112-
for acc_id in acc_ids:
113-
if (
114-
(not acc_id.financial_statement_eu_debit_id)
115-
and (not acc_id.financial_statement_eu_credit_id)
116-
) or force_update:
117-
if (acc_id.financial_statement_eu_debit_id.id != debit_fse_id) or (
118-
acc_id.financial_statement_eu_credit_id.id != credit_fse_id
119-
):
120-
acc_id.write(
121-
{
122-
"financial_statement_eu_debit_id": debit_fse_id,
123-
"financial_statement_eu_credit_id": credit_fse_id,
124-
}
125-
)
112+
for company in self.env["res.company"].search([]):
113+
acc_ids = (
114+
self.env["account.account"]
115+
.with_company(company)
116+
.search(
117+
[
118+
("code", "=ilike", acc_code),
119+
]
120+
)
121+
)
122+
for acc_id in acc_ids:
123+
if (
124+
(not acc_id.financial_statement_eu_debit_id)
125+
and (not acc_id.financial_statement_eu_credit_id)
126+
) or force_update:
127+
if (acc_id.financial_statement_eu_debit_id.id != debit_fse_id) or (
128+
acc_id.financial_statement_eu_credit_id.id != credit_fse_id
129+
):
130+
acc_id.write(
131+
{
132+
"financial_statement_eu_debit_id": debit_fse_id,
133+
"financial_statement_eu_credit_id": credit_fse_id,
134+
}
135+
)
126136

127137
@api.model
128138
def financial_statement_eu_account_assoc_code(

l10n_it_financial_statement_eu/report/financial_statement_eu_report.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ def generate_xlsx_report(self, workbook, data, record_data):
2121
sheet.write(0, 0, data["company_name"], st_bold18)
2222
sheet.set_row(0, 28)
2323
sheet.write(1, 0, data["address"] + " - " + data["city"])
24-
sheet.write(2, 0, _("Share capital Euro ") + str(data["rea_capital"]))
24+
sheet.write(
25+
2,
26+
0,
27+
_("Share capital Euro ") + str(data["l10n_it_eco_index_share_capital"]),
28+
)
2529
sheet.write(4, 0, data["name"], st_bold18)
2630
sheet.set_row(4, 28)
2731
sheet.write(
@@ -242,7 +246,7 @@ def generate_report(self, ir_report, docids, data=None):
242246
xbrl += self.get_xbrl_data_tag(
243247
"DatiAnagraficiCapitaleSociale",
244248
i_year,
245-
financial_statement_form_data["rea_capital"],
249+
financial_statement_form_data["l10n_it_eco_index_share_capital"],
246250
0,
247251
)
248252
xbrl += self.get_xbrl_data_tag(
@@ -251,7 +255,7 @@ def generate_report(self, ir_report, docids, data=None):
251255
xbrl += self.get_xbrl_data_tag(
252256
"DatiAnagraficiCodiceCciaa",
253257
i_year,
254-
financial_statement_form_data["rea_office"],
258+
financial_statement_form_data["l10n_it_eco_index_office"],
255259
)
256260
xbrl += self.get_xbrl_data_tag(
257261
"DatiAnagraficiPartitaIva",
@@ -266,22 +270,22 @@ def generate_report(self, ir_report, docids, data=None):
266270
xbrl += self.get_xbrl_data_tag(
267271
"DatiAnagraficiNumeroRea",
268272
i_year,
269-
financial_statement_form_data["rea_office"]
273+
financial_statement_form_data["l10n_it_eco_index_office"]
270274
+ " "
271-
+ financial_statement_form_data["rea_num"],
275+
+ financial_statement_form_data["l10n_it_eco_index_number"],
272276
)
273277
xbrl += self.get_xbrl_data_tag("DatiAnagraficiFormaGiuridica", i_year, "")
274278
xbrl += self.get_xbrl_data_tag(
275279
"DatiAnagraficiSettoreAttivitaPrevalenteAteco", i_year, ""
276280
)
277-
if self.env.company.rea_liquidation_state == "LS":
281+
if self.env.company.l10n_it_eco_index_liquidation_state == "LS":
278282
tmp_s = "true"
279283
else:
280284
tmp_s = "false"
281285
xbrl += self.get_xbrl_data_tag(
282286
"DatiAnagraficiSocietaLiquidazione", i_year, tmp_s
283287
)
284-
if self.env.company.rea_member_type == "SU":
288+
if self.env.company.l10n_it_eco_index_sole_shareholder == "SU":
285289
tmp_s = "true"
286290
else:
287291
tmp_s = "false"

l10n_it_financial_statement_eu/report/financial_statement_eu_report.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
<t t-esc="form_data['fiscalcode']" />
6262
<br />
6363
Share capital Euro
64-
<t t-esc="form_data['rea_capital']" />
65-
- REA: <t t-esc="form_data['rea_office']" />-<t
66-
t-esc="form_data['rea_num']"
64+
<t t-esc="form_data['l10n_it_eco_index_share_capital']" />
65+
- REA: <t t-esc="form_data['l10n_it_eco_index_office']" />-<t
66+
t-esc="form_data['l10n_it_eco_index_number']"
6767
/>
6868
</h6>
6969
<br />

l10n_it_financial_statement_eu/report/templates/layouts.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
href="/l10n_it_financial_statement_eu/static/src/css/report.css"
77
rel="stylesheet"
88
/>
9-
<t t-raw="0" />
9+
<t t-out="0" />
1010
</div>
1111
<div class="footer">
1212
<div class="row">

l10n_it_financial_statement_eu/static/src/js/client_action.esm.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
/** @odoo-module **/
21
import {ReportAction} from "@web/webclient/actions/reports/report_action";
32
import {patch} from "@web/core/utils/patch";
43

54
const MODULE_NAME = "l10n_it_financial_statement_eu";
65

76
patch(ReportAction.prototype, {
87
setup() {
9-
this._super.apply(this, arguments);
8+
super.setup();
109
this.isFinancialStatementEU = this.props.report_name.startsWith(
1110
`${MODULE_NAME}.`
1211
);

l10n_it_financial_statement_eu/wizard/financial_statement_eu_wizard.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def _default_date_to(self):
7272
company_name = fields.Char()
7373
address = fields.Char()
7474
city = fields.Char()
75-
rea_office = fields.Char(string="REA office")
76-
rea_num = fields.Char(string="REA number")
77-
rea_capital = fields.Float(string="Share Capital")
75+
l10n_it_eco_index_office = fields.Char(string="REA office")
76+
l10n_it_eco_index_number = fields.Char(string="REA number")
77+
l10n_it_eco_index_share_capital = fields.Float(string="Share Capital")
7878
fiscalcode = fields.Char(string="Fiscal Code")
7979
vat_code = fields.Char(string="VAT number")
8080
vat_code_nation = fields.Char(string="VAT number nation")
@@ -117,9 +117,13 @@ def get_data(self):
117117
self.company_name = self.env.company.name
118118
self.address = self.env.company.street
119119
self.city = self.env.company.zip + " " + self.env.company.city
120-
self.rea_office = self.env.company.l10n_it_eco_index_office.code or ""
121-
self.rea_num = self.env.company.l10n_it_eco_index_number or ""
122-
self.rea_capital = self.env.company.l10n_it_eco_index_share_capital
120+
self.l10n_it_eco_index_office = (
121+
self.env.company.l10n_it_eco_index_office.code or ""
122+
)
123+
self.l10n_it_eco_index_number = self.env.company.l10n_it_eco_index_number or ""
124+
self.l10n_it_eco_index_share_capital = (
125+
self.env.company.l10n_it_eco_index_share_capital
126+
)
123127
self.fiscalcode = self.env.company.l10n_it_codice_fiscale
124128
self.vat_code = self.env.company.vat or ""
125129
self.vat_code_nation = ""

0 commit comments

Comments
 (0)