Skip to content

Commit 6dad008

Browse files
committed
[IMP] account_fiscal_year_closing: pre-commit auto fixes
1 parent a993ce7 commit 6dad008

19 files changed

+186
-189
lines changed

account_fiscal_year_closing/README.rst

Lines changed: 71 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ Fiscal year closing
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--closing-lightgray.png?logo=github
20-
:target: https://github.com/OCA/account-closing/tree/16.0/account_fiscal_year_closing
20+
:target: https://github.com/OCA/account-closing/tree/18.0/account_fiscal_year_closing
2121
:alt: OCA/account-closing
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_fiscal_year_closing
23+
:target: https://translation.odoo-community.org/projects/account-closing-18-0/account-closing-18-0-account_fiscal_year_closing
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-closing&target_branch=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-closing&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
3030

3131
This module implements a generic fiscal year closing system for those
32-
countries where closing/opening moves or other kind of closing operations are
33-
mandatory in accounting books.
32+
countries where closing/opening moves or other kind of closing
33+
operations are mandatory in accounting books.
3434

3535
It includes a template mechanism that can be used in localizations for
3636
providing the possible configurations to be used by the closing engine.
@@ -45,89 +45,95 @@ Configuration
4545

4646
If you want to add a closing template or check existing ones:
4747

48-
#. Go to *Accounting/Invoicing > Configuration > Fiscal year closing > Closing templates*.
49-
#. Click on Create.
50-
#. Put a name for the template.
51-
#. Mark if you want to check if there's any draft move in the date range
52-
before making the closing operations.
53-
#. Select the chart templates for which companies that have this chart you want
54-
this template to be available for.
55-
#. Add one line for each of the journal entries you want to create on the
56-
closing operation.
57-
#. This line has a name, a code, an optional journal (selectable per company),
58-
a sequence for ordering this line with the others, and the type we want to
59-
assign on the resulting journal entry created.
60-
#. Then you can configure accounts for being mapped on the section
61-
"Accounts mapping".
62-
#. If you put a destination account on each mapping line, then the balance of
63-
the source account will be transferred to that account.
64-
#. If there's no destination account, then the balance of the account will be
65-
nullified through one or several journal items with the opposite balance.
66-
#. The way these opposite journal items will be created is determined by the
67-
closing type in the section "Account closing types":
68-
69-
* Balance: There will be only one journal item with the opposite balance.
70-
* Un-reconciled: The opposite balance will be grouped by the partner field
71-
in the period journal entries.
72-
73-
#. There's a default closing type to use, and you can specify others by
74-
account type.
75-
#. You can configure a closing operation for being the reverse move of another
76-
previous move generated by a closing operation (typically, the opening
77-
move after the closing one). For making that, fill the "Inverse config"
78-
field with the code of the closing operation you want to reverse, and
79-
place this operation after that one (not necessarily immediately after).
80-
#. The balances of the inverted journal items and the initial ones are
81-
reconciled by default.
48+
1. Go to *Accounting/Invoicing > Configuration > Fiscal year closing >
49+
Closing templates*.
50+
2. Click on Create.
51+
3. Put a name for the template.
52+
4. Mark if you want to check if there's any draft move in the date
53+
range before making the closing operations.
54+
5. Select the chart templates for which companies that have this chart
55+
you want this template to be available for.
56+
6. Add one line for each of the journal entries you want to create on
57+
the closing operation.
58+
7. This line has a name, a code, an optional journal (selectable per
59+
company), a sequence for ordering this line with the others, and the
60+
type we want to assign on the resulting journal entry created.
61+
8. Then you can configure accounts for being mapped on the section
62+
"Accounts mapping".
63+
9. If you put a destination account on each mapping line, then the
64+
balance of the source account will be transferred to that account.
65+
10. If there's no destination account, then the balance of the account
66+
will be nullified through one or several journal items with the
67+
opposite balance.
68+
11. The way these opposite journal items will be created is determined
69+
by the closing type in the section "Account closing types":
70+
71+
- Balance: There will be only one journal item with the opposite
72+
balance.
73+
- Un-reconciled: The opposite balance will be grouped by the
74+
partner field in the period journal entries.
75+
76+
12. There's a default closing type to use, and you can specify others by
77+
account type.
78+
13. You can configure a closing operation for being the reverse move of
79+
another previous move generated by a closing operation (typically,
80+
the opening move after the closing one). For making that, fill the
81+
"Inverse config" field with the code of the closing operation you
82+
want to reverse, and place this operation after that one (not
83+
necessarily immediately after).
84+
14. The balances of the inverted journal items and the initial ones are
85+
reconciled by default.
8286

8387
Usage
8488
=====
8589

8690
For closing a fiscal year:
8791

88-
#. Go to *Accounting > Adviser > Fiscal year closings*
89-
#. Click on create.
90-
#. Select the year for which you want to perform the closing. If your fiscal
91-
year doesn't coincide with a natural year, input the last year of both of
92-
the involved years.
93-
#. Select the closing template you want to use.
94-
#. Click on "Calculate".
95-
#. Check the result clicking on the "Show Moves" or "Show Move Lines" buttons.
96-
#. If everything is OK, then click on "Confirm and post moves" for finishing
97-
the closing, posting and reconciling the journal entries.
98-
#. You can cancel the closing in any moment pressing "Cancel" button, which
99-
unreconciles and removes closing journal entries.
100-
#. If one of the created journal entries is unbalanced, as Odoo doesn't allow
101-
to create unbalanced entries, a new screen will be shown for checking the
102-
problem on the created entry.
92+
1. Go to *Accounting > Adviser > Fiscal year closings*
93+
2. Click on create.
94+
3. Select the year for which you want to perform the closing. If your
95+
fiscal year doesn't coincide with a natural year, input the last year
96+
of both of the involved years.
97+
4. Select the closing template you want to use.
98+
5. Click on "Calculate".
99+
6. Check the result clicking on the "Show Moves" or "Show Move Lines"
100+
buttons.
101+
7. If everything is OK, then click on "Confirm and post moves" for
102+
finishing the closing, posting and reconciling the journal entries.
103+
8. You can cancel the closing in any moment pressing "Cancel" button,
104+
which unreconciles and removes closing journal entries.
105+
9. If one of the created journal entries is unbalanced, as Odoo doesn't
106+
allow to create unbalanced entries, a new screen will be shown for
107+
checking the problem on the created entry.
103108

104109
Bug Tracker
105110
===========
106111

107112
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-closing/issues>`_.
108113
In case of trouble, please check there if your issue has already been reported.
109114
If you spotted it first, help us to smash it by providing a detailed and welcomed
110-
`feedback <https://github.com/OCA/account-closing/issues/new?body=module:%20account_fiscal_year_closing%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
115+
`feedback <https://github.com/OCA/account-closing/issues/new?body=module:%20account_fiscal_year_closing%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
111116

112117
Do not contact contributors directly about support or help with technical issues.
113118

114119
Credits
115120
=======
116121

117122
Contributors
118-
~~~~~~~~~~~~
123+
------------
119124

120-
* Antonio Espinosa <[email protected]>
121-
* Pedro M. Baeza <[email protected]>
122-
* Jordi Ballester Alomar <https://github.com/JordiBForgeFlow>
123-
* Sergio Corato <https://github.com/sergiocorato>
124-
* `CorporateHub <https://corporatehub.eu/>`__
125+
- Antonio Espinosa <[email protected]>
126+
- Pedro M. Baeza <[email protected]>
127+
- Jordi Ballester Alomar <https://github.com/JordiBForgeFlow>
128+
- Sergio Corato <https://github.com/sergiocorato>
129+
- `CorporateHub <https://corporatehub.eu/>`__
125130

126-
* Alexey Pelykh <[email protected]>
127-
* Giuseppe Borruso <[email protected]>
131+
- Alexey Pelykh <[email protected]>
132+
133+
- Giuseppe Borruso <[email protected]>
128134

129135
Maintainers
130-
~~~~~~~~~~~
136+
-----------
131137

132138
This module is maintained by the OCA.
133139

@@ -139,6 +145,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
139145
mission is to support the collaborative development of Odoo features and
140146
promote its widespread use.
141147

142-
This module is part of the `OCA/account-closing <https://github.com/OCA/account-closing/tree/16.0/account_fiscal_year_closing>`_ project on GitHub.
148+
This module is part of the `OCA/account-closing <https://github.com/OCA/account-closing/tree/18.0/account_fiscal_year_closing>`_ project on GitHub.
143149

144150
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

account_fiscal_year_closing/migrations/16.0.1.0.0/noupdate_changes.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<odoo>
3-
43
<record id="fiscalyear_closing_multi_company_rule" model="ir.rule">
54
<field
65
name="domain_force"
@@ -12,5 +11,4 @@
1211
name="domain_force"
1312
>['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
1413
</record>
15-
1614
</odoo>

account_fiscal_year_closing/migrations/16.0.1.0.0/post-migration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
@openupgrade.migrate()
99
def migrate(env, version):
10-
1110
openupgrade.load_data(
1211
env.cr,
1312
"account_fiscal_year_closing",

account_fiscal_year_closing/migrations/16.0.1.0.0/pre-migration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,5 @@ def update_account_type(env, table):
5656

5757
@openupgrade.migrate()
5858
def migrate(env, version):
59-
6059
update_account_type(env, "account_fiscalyear_closing_type_template")
6160
update_account_type(env, "account_fiscalyear_closing_type")

account_fiscal_year_closing/models/account_fiscalyear_closing.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def _onchange_year(self):
218218
)
219219
self.date_opening = fields.Date.to_string(date_end + relativedelta(days=1))
220220
if self.date_start != self.date_end:
221-
self.name = "{}-{}".format(self.date_start, self.date_end)
221+
self.name = f"{self.date_start}-{self.date_end}"
222222
else:
223223
self.name = str(self.date_end)
224224

@@ -235,12 +235,7 @@ def draft_moves_check(self):
235235
if draft_moves:
236236
msg = _("One or more draft moves found: \n")
237237
for move in draft_moves:
238-
msg += "ID: {}, Date: {}, Number: {}, Ref: {}\n".format(
239-
move.id,
240-
move.date,
241-
move.name,
242-
move.ref,
243-
)
238+
msg += f"ID: {move.id}, Date: {move.date}, Number: {move.name}, Ref: {move.ref}\n"
244239
raise ValidationError(msg)
245240
return True
246241

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
If you want to add a closing template or check existing ones:
2+
3+
1. Go to *Accounting/Invoicing \> Configuration \> Fiscal year closing
4+
\> Closing templates*.
5+
2. Click on Create.
6+
3. Put a name for the template.
7+
4. Mark if you want to check if there's any draft move in the date
8+
range before making the closing operations.
9+
5. Select the chart templates for which companies that have this chart
10+
you want this template to be available for.
11+
6. Add one line for each of the journal entries you want to create on
12+
the closing operation.
13+
7. This line has a name, a code, an optional journal (selectable per
14+
company), a sequence for ordering this line with the others, and the
15+
type we want to assign on the resulting journal entry created.
16+
8. Then you can configure accounts for being mapped on the section
17+
"Accounts mapping".
18+
9. If you put a destination account on each mapping line, then the
19+
balance of the source account will be transferred to that account.
20+
10. If there's no destination account, then the balance of the account
21+
will be nullified through one or several journal items with the
22+
opposite balance.
23+
11. The way these opposite journal items will be created is determined
24+
by the closing type in the section "Account closing types":
25+
- Balance: There will be only one journal item with the opposite
26+
balance.
27+
- Un-reconciled: The opposite balance will be grouped by the partner
28+
field in the period journal entries.
29+
12. There's a default closing type to use, and you can specify others by
30+
account type.
31+
13. You can configure a closing operation for being the reverse move of
32+
another previous move generated by a closing operation (typically,
33+
the opening move after the closing one). For making that, fill the
34+
"Inverse config" field with the code of the closing operation you
35+
want to reverse, and place this operation after that one (not
36+
necessarily immediately after).
37+
14. The balances of the inverted journal items and the initial ones are
38+
reconciled by default.

account_fiscal_year_closing/readme/CONFIGURE.rst

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- Antonio Espinosa \<<[email protected]>\>
2+
- Pedro M. Baeza \<<[email protected]>\>
3+
- Jordi Ballester Alomar \<<https://github.com/JordiBForgeFlow>\>
4+
- Sergio Corato \<<https://github.com/sergiocorato>\>
5+
- [CorporateHub](https://corporatehub.eu/)
6+
- Alexey Pelykh \<<[email protected]>\>
7+
- Giuseppe Borruso \<<[email protected]>\>

account_fiscal_year_closing/readme/CONTRIBUTORS.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)