odoo-addon-account-loan 17.0.1.1.2.1__py3-none-any.whl → 17.0.1.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of odoo-addon-account-loan might be problematic. Click here for more details.
- odoo/addons/account_loan/README.rst +1 -1
- odoo/addons/account_loan/__manifest__.py +1 -1
- odoo/addons/account_loan/i18n/account_loan.pot +19 -0
- odoo/addons/account_loan/models/account_loan.py +19 -1
- odoo/addons/account_loan/models/account_loan_line.py +5 -3
- odoo/addons/account_loan/static/description/index.html +1 -1
- odoo/addons/account_loan/tests/test_loan.py +8 -0
- odoo/addons/account_loan/views/account_loan_view.xml +11 -2
- {odoo_addon_account_loan-17.0.1.1.2.1.dist-info → odoo_addon_account_loan-17.0.1.1.3.dist-info}/METADATA +2 -2
- {odoo_addon_account_loan-17.0.1.1.2.1.dist-info → odoo_addon_account_loan-17.0.1.1.3.dist-info}/RECORD +12 -12
- {odoo_addon_account_loan-17.0.1.1.2.1.dist-info → odoo_addon_account_loan-17.0.1.1.3.dist-info}/WHEEL +0 -0
- {odoo_addon_account_loan-17.0.1.1.2.1.dist-info → odoo_addon_account_loan-17.0.1.1.3.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ Account Loan management
|
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
|
8
8
|
!! changes will be overwritten. !!
|
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
-
!! source digest: sha256:
|
|
10
|
+
!! source digest: sha256:f2a9518a8e816743c4850fcb76c1f1a8ae99663e505310e7fedce1a5040a07ff
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
3
3
|
{
|
|
4
4
|
"name": "Account Loan management",
|
|
5
|
-
"version": "17.0.1.1.
|
|
5
|
+
"version": "17.0.1.1.3",
|
|
6
6
|
"author": "Creu Blanca,Odoo Community Association (OCA)",
|
|
7
7
|
"website": "https://github.com/OCA/account-financial-tools",
|
|
8
8
|
"license": "AGPL-3",
|
|
@@ -435,6 +435,15 @@ msgstr ""
|
|
|
435
435
|
msgid "Is Leasing"
|
|
436
436
|
msgstr ""
|
|
437
437
|
|
|
438
|
+
#. module: account_loan
|
|
439
|
+
#. odoo-python
|
|
440
|
+
#: code:addons/account_loan/models/account_loan.py:0
|
|
441
|
+
#, python-format
|
|
442
|
+
msgid ""
|
|
443
|
+
"It is only possible to change to draft if the status is cancelled or posted "
|
|
444
|
+
"and there are no account moves."
|
|
445
|
+
msgstr ""
|
|
446
|
+
|
|
438
447
|
#. module: account_loan
|
|
439
448
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
|
|
440
449
|
msgid "Items"
|
|
@@ -630,6 +639,11 @@ msgstr ""
|
|
|
630
639
|
msgid "Move"
|
|
631
640
|
msgstr ""
|
|
632
641
|
|
|
642
|
+
#. module: account_loan
|
|
643
|
+
#: model:ir.model.fields,field_description:account_loan.field_account_loan__move_count
|
|
644
|
+
msgid "Move Count"
|
|
645
|
+
msgstr ""
|
|
646
|
+
|
|
633
647
|
#. module: account_loan
|
|
634
648
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
|
|
635
649
|
msgid "Moves"
|
|
@@ -823,6 +837,11 @@ msgstr ""
|
|
|
823
837
|
msgid "Real rate that will be applied on each period"
|
|
824
838
|
msgstr ""
|
|
825
839
|
|
|
840
|
+
#. module: account_loan
|
|
841
|
+
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
|
|
842
|
+
msgid "Reset to draft"
|
|
843
|
+
msgstr ""
|
|
844
|
+
|
|
826
845
|
#. module: account_loan
|
|
827
846
|
#: model:ir.model.fields,field_description:account_loan.field_account_loan__residual_amount
|
|
828
847
|
msgid "Residual Amount"
|
|
@@ -7,7 +7,8 @@ from datetime import datetime
|
|
|
7
7
|
|
|
8
8
|
from dateutil.relativedelta import relativedelta
|
|
9
9
|
|
|
10
|
-
from odoo import api, fields, models
|
|
10
|
+
from odoo import _, api, fields, models
|
|
11
|
+
from odoo.exceptions import UserError
|
|
11
12
|
|
|
12
13
|
_logger = logging.getLogger(__name__)
|
|
13
14
|
try:
|
|
@@ -183,6 +184,7 @@ class AccountLoan(models.Model):
|
|
|
183
184
|
"invoice is created",
|
|
184
185
|
)
|
|
185
186
|
move_ids = fields.One2many("account.move", copy=False, inverse_name="loan_id")
|
|
187
|
+
move_count = fields.Integer(compute="_compute_move_count")
|
|
186
188
|
pending_principal_amount = fields.Monetary(
|
|
187
189
|
currency_field="currency_id",
|
|
188
190
|
compute="_compute_total_amounts",
|
|
@@ -221,6 +223,11 @@ class AccountLoan(models.Model):
|
|
|
221
223
|
previous_pending_principal = line.pending_principal_amount
|
|
222
224
|
previous_principal_amount = line.principal_amount
|
|
223
225
|
|
|
226
|
+
@api.depends("move_ids")
|
|
227
|
+
def _compute_move_count(self):
|
|
228
|
+
for item in self:
|
|
229
|
+
item.move_count = len(item.move_ids)
|
|
230
|
+
|
|
224
231
|
@api.depends("line_ids", "currency_id", "loan_amount")
|
|
225
232
|
def _compute_total_amounts(self):
|
|
226
233
|
for record in self:
|
|
@@ -420,6 +427,17 @@ class AccountLoan(models.Model):
|
|
|
420
427
|
if self.long_term_loan_account_id:
|
|
421
428
|
self._check_long_term_principal_amount()
|
|
422
429
|
|
|
430
|
+
def button_draft(self):
|
|
431
|
+
for item in self:
|
|
432
|
+
if item.state not in ("posted", "cancelled") or item.move_count > 0:
|
|
433
|
+
raise UserError(
|
|
434
|
+
_(
|
|
435
|
+
"It is only possible to change to draft if the status is "
|
|
436
|
+
"cancelled or posted and there are no account moves."
|
|
437
|
+
)
|
|
438
|
+
)
|
|
439
|
+
item.state = "draft"
|
|
440
|
+
|
|
423
441
|
def view_account_moves(self):
|
|
424
442
|
self.ensure_one()
|
|
425
443
|
result = self.env["ir.actions.act_window"]._for_xml_id(
|
|
@@ -5,6 +5,7 @@ import logging
|
|
|
5
5
|
|
|
6
6
|
from odoo import Command, _, api, fields, models
|
|
7
7
|
from odoo.exceptions import UserError
|
|
8
|
+
from odoo.tools import float_is_zero
|
|
8
9
|
|
|
9
10
|
_logger = logging.getLogger(__name__)
|
|
10
11
|
try:
|
|
@@ -127,9 +128,10 @@ class AccountLoanLine(models.Model):
|
|
|
127
128
|
@api.depends("interests_amount")
|
|
128
129
|
def _compute_rate(self):
|
|
129
130
|
for record in self:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
rate = 0
|
|
132
|
+
if not float_is_zero(record.pending_principal_amount, precision_digits=2):
|
|
133
|
+
rate = (record.interests_amount * 100) / record.pending_principal_amount
|
|
134
|
+
record.rate = rate
|
|
133
135
|
|
|
134
136
|
@api.depends("rate")
|
|
135
137
|
def _compute_interests_amount(self):
|
|
@@ -367,7 +367,7 @@ ul.auto-toc {
|
|
|
367
367
|
!! This file is generated by oca-gen-addon-readme !!
|
|
368
368
|
!! changes will be overwritten. !!
|
|
369
369
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
370
|
-
!! source digest: sha256:
|
|
370
|
+
!! source digest: sha256:f2a9518a8e816743c4850fcb76c1f1a8ae99663e505310e7fedce1a5040a07ff
|
|
371
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
372
372
|
<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/account-financial-tools/tree/17.0/account_loan"><img alt="OCA/account-financial-tools" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-tools-17-0/account-financial-tools-17-0-account_loan"><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/account-financial-tools&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
373
373
|
<p>This module extends the functionality of accounting to support loans. It
|
|
@@ -648,6 +648,8 @@ class TestLoan(BaseCommon):
|
|
|
648
648
|
periods = 10
|
|
649
649
|
loan = self.create_loan("fixed-annuity", amount, 1, periods)
|
|
650
650
|
self.post(loan)
|
|
651
|
+
with self.assertRaises(UserError):
|
|
652
|
+
loan.button_draft()
|
|
651
653
|
line = loan.line_ids.filtered(lambda r: r.sequence == 1)
|
|
652
654
|
line.view_process_values()
|
|
653
655
|
self.assertTrue(line.move_ids)
|
|
@@ -660,6 +662,12 @@ class TestLoan(BaseCommon):
|
|
|
660
662
|
self.assertEqual(pay.amount, line.final_pending_principal_amount)
|
|
661
663
|
pay.run()
|
|
662
664
|
self.assertEqual(loan.state, "cancelled")
|
|
665
|
+
with self.assertRaises(UserError):
|
|
666
|
+
loan.button_draft()
|
|
667
|
+
loan.move_ids.button_draft()
|
|
668
|
+
loan.move_ids.unlink()
|
|
669
|
+
loan.button_draft()
|
|
670
|
+
self.assertEqual(loan.state, "draft")
|
|
663
671
|
|
|
664
672
|
def post(self, loan):
|
|
665
673
|
self.assertFalse(loan.move_ids)
|
|
@@ -42,10 +42,18 @@
|
|
|
42
42
|
<button
|
|
43
43
|
name="%(account_loan_post_action)d"
|
|
44
44
|
invisible="state != 'draft'"
|
|
45
|
+
class="oe_highlight"
|
|
45
46
|
type="action"
|
|
46
47
|
string="Post"
|
|
47
48
|
groups="account.group_account_manager"
|
|
48
49
|
/>
|
|
50
|
+
<button
|
|
51
|
+
name="button_draft"
|
|
52
|
+
invisible="state not in ('posted', 'cancelled') or move_count != 0"
|
|
53
|
+
type="object"
|
|
54
|
+
string="Reset to draft"
|
|
55
|
+
groups="account.group_account_manager"
|
|
56
|
+
/>
|
|
49
57
|
<field name="state" widget="statusbar" />
|
|
50
58
|
</header>
|
|
51
59
|
<sheet>
|
|
@@ -56,8 +64,9 @@
|
|
|
56
64
|
icon="fa-bars"
|
|
57
65
|
invisible="state == 'draft'"
|
|
58
66
|
type="object"
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
>
|
|
68
|
+
<field string="Moves" name="move_count" widget="statinfo" />
|
|
69
|
+
</button>
|
|
61
70
|
<button
|
|
62
71
|
name="view_account_invoices"
|
|
63
72
|
class="oe_stat_button"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-account_loan
|
|
3
|
-
Version: 17.0.1.1.
|
|
3
|
+
Version: 17.0.1.1.3
|
|
4
4
|
Requires-Python: >=3.10
|
|
5
5
|
Requires-Dist: numpy-financial<=1.0.0
|
|
6
6
|
Requires-Dist: numpy>=1.15
|
|
@@ -24,7 +24,7 @@ Account Loan management
|
|
|
24
24
|
!! This file is generated by oca-gen-addon-readme !!
|
|
25
25
|
!! changes will be overwritten. !!
|
|
26
26
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
27
|
-
!! source digest: sha256:
|
|
27
|
+
!! source digest: sha256:f2a9518a8e816743c4850fcb76c1f1a8ae99663e505310e7fedce1a5040a07ff
|
|
28
28
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
29
29
|
|
|
30
30
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
odoo/addons/account_loan/README.rst,sha256=
|
|
1
|
+
odoo/addons/account_loan/README.rst,sha256=bQRBGoWxnr790PO4yAuYpfzs_ETB-VtcDpcJ28WO5N8,4864
|
|
2
2
|
odoo/addons/account_loan/__init__.py,sha256=o9EnCAU5AKoGmP2X6ytOhQFxVqIh5Y1itLUOmzxSUJY,113
|
|
3
|
-
odoo/addons/account_loan/__manifest__.py,sha256=
|
|
3
|
+
odoo/addons/account_loan/__manifest__.py,sha256=WycJscZW7DHZS69hj3RmiDmkRsSRhzZX-QkD5PWl6Nk,1083
|
|
4
4
|
odoo/addons/account_loan/data/ir_sequence_data.xml,sha256=bLydnK8X-0QWzFoBms4UpGYYle25C2DmbpVECEG4PMc,540
|
|
5
|
-
odoo/addons/account_loan/i18n/account_loan.pot,sha256=
|
|
5
|
+
odoo/addons/account_loan/i18n/account_loan.pot,sha256=hjVY11lPF5-JiEuzKu_cYZAeBkRmuhSpnu_oT3sMO0U,35759
|
|
6
6
|
odoo/addons/account_loan/i18n/am.po,sha256=uFav8c0Tyk-mOoPQYCqd2gqXCtx4AfL1-YunXvZasRk,35663
|
|
7
7
|
odoo/addons/account_loan/i18n/ar.po,sha256=pcKOygVuzAR5N-x4zIWzo-tjrESG2lirUxEMdpC7w4M,35939
|
|
8
8
|
odoo/addons/account_loan/i18n/bg.po,sha256=rvdgYUA4gU-CmwxzjdavetS8KiqmElQwnC0o57o262I,35870
|
|
@@ -81,8 +81,8 @@ odoo/addons/account_loan/i18n/zh_TW.po,sha256=IqTd4oYt78_0lCHKDuzEWSeB_LlnkhETjc
|
|
|
81
81
|
odoo/addons/account_loan/migrations/17.0.1.0.0/noupdate_changes.xml,sha256=bZbGut6mOAMZsniduY1yY2QA8W31LLNcBJFGjt1EFeE,398
|
|
82
82
|
odoo/addons/account_loan/migrations/17.0.1.0.0/post-migration.py,sha256=0XUOqdMYcrw_CbdeWHc5BgWUEhEG_Rxed6I1bdq9H3c,314
|
|
83
83
|
odoo/addons/account_loan/models/__init__.py,sha256=jwLlr4SgTaxqvv5CCJkgGwhwNus45E4E4e3pijuROJY,211
|
|
84
|
-
odoo/addons/account_loan/models/account_loan.py,sha256=
|
|
85
|
-
odoo/addons/account_loan/models/account_loan_line.py,sha256=
|
|
84
|
+
odoo/addons/account_loan/models/account_loan.py,sha256=hJMrZaOK1toCwBMeNlafbB8-ImRnbyqzD-wFhLX-zvs,16515
|
|
85
|
+
odoo/addons/account_loan/models/account_loan_line.py,sha256=0rHUsVIUoz0QqVFSidwJU0yUjTxQD_tzWXMX3vD5uqM,18102
|
|
86
86
|
odoo/addons/account_loan/models/account_move.py,sha256=8p2V854_J060o_yupWrGyVa5Ps44d8GpkY4azcAUz3k,937
|
|
87
87
|
odoo/addons/account_loan/models/res_partner.py,sha256=6NgoxHUstcHftmDGj9NWzxfb9MBDG6XATj_1OwMao84,995
|
|
88
88
|
odoo/addons/account_loan/readme/CONTRIBUTORS.md,sha256=w4frkcHOfPes7QOWbCyGpnNbYcxJhFM0A9x0qCxxQd4,227
|
|
@@ -92,11 +92,11 @@ odoo/addons/account_loan/readme/USAGE.md,sha256=pQ7Eb0xRbAdguo8JAxUQ-irEFkOdIeor
|
|
|
92
92
|
odoo/addons/account_loan/security/account_loan_security.xml,sha256=je25Lct1hJDX_5Qz9vhmXWF9n3s47WSzN9Ic8l8mr2k,752
|
|
93
93
|
odoo/addons/account_loan/security/ir.model.access.csv,sha256=3RwBdFKlfSzAJCUWYxDBGUw0t0ZLuBphkZWYtNHGmlI,1009
|
|
94
94
|
odoo/addons/account_loan/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
|
95
|
-
odoo/addons/account_loan/static/description/index.html,sha256=
|
|
95
|
+
odoo/addons/account_loan/static/description/index.html,sha256=Wv-nQ139YpXLJ1KxvBYd02kTdov37cRDQIhc6mIwim0,15392
|
|
96
96
|
odoo/addons/account_loan/tests/__init__.py,sha256=I1GwELsBL3FTRS0pVrE5q-qEk537mMnSOXpWkPVcBnY,94
|
|
97
|
-
odoo/addons/account_loan/tests/test_loan.py,sha256=
|
|
97
|
+
odoo/addons/account_loan/tests/test_loan.py,sha256=sCnOT9RdiIsrDJUSgIQpIDAt0SdZLUhBbNHZ1MGS55I,31061
|
|
98
98
|
odoo/addons/account_loan/views/account_loan_lines_view.xml,sha256=BNt633HUe9J-rpSi-VbJ8fp4IagJNf-LS46A9g6sVoc,6224
|
|
99
|
-
odoo/addons/account_loan/views/account_loan_view.xml,sha256=
|
|
99
|
+
odoo/addons/account_loan/views/account_loan_view.xml,sha256=aPtN3ZjPy_m5xCWUtuwNrCL3PP8t3btP2lBy5c9hwRs,10996
|
|
100
100
|
odoo/addons/account_loan/views/account_move_view.xml,sha256=-dFzRj3e84NTkLCoaAzneAPlwxVtzbjBZyAt6eK_NfM,814
|
|
101
101
|
odoo/addons/account_loan/views/res_partner.xml,sha256=rneFt7lW3cUoI8UVaLQc9mkiSCii2Os1T3TTYCEB_s0,1248
|
|
102
102
|
odoo/addons/account_loan/wizards/__init__.py,sha256=mq87kRH_mXzIn76cBCeuzptRiIOdQWjImjmZ_HNGUVU,227
|
|
@@ -108,7 +108,7 @@ odoo/addons/account_loan/wizards/account_loan_pay_amount.py,sha256=-kG1q8Ueh0Fl_
|
|
|
108
108
|
odoo/addons/account_loan/wizards/account_loan_pay_amount_view.xml,sha256=9rCkG5kL3u2vc4Mmz9zo5Sqfp6raGnPz3ZGv2AlLIN4,1596
|
|
109
109
|
odoo/addons/account_loan/wizards/account_loan_post.py,sha256=9aRQaqPGdV5NSUJ6oiTV8kaUhT5TzuqJ3oFJKefL3Tw,3667
|
|
110
110
|
odoo/addons/account_loan/wizards/account_loan_post_view.xml,sha256=s-teTEY9HCEA2CHD3_tQZJIGOHJMZNAlR1pSN5Dpdn8,1440
|
|
111
|
-
odoo_addon_account_loan-17.0.1.1.
|
|
112
|
-
odoo_addon_account_loan-17.0.1.1.
|
|
113
|
-
odoo_addon_account_loan-17.0.1.1.
|
|
114
|
-
odoo_addon_account_loan-17.0.1.1.
|
|
111
|
+
odoo_addon_account_loan-17.0.1.1.3.dist-info/METADATA,sha256=9jrPftUhti6uqX5o5k_csDs1AngVrt2uh6b0OeM9ccs,5450
|
|
112
|
+
odoo_addon_account_loan-17.0.1.1.3.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
|
|
113
|
+
odoo_addon_account_loan-17.0.1.1.3.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
|
114
|
+
odoo_addon_account_loan-17.0.1.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|