odoo-addon-account-loan 16.0.1.0.5__py3-none-any.whl → 17.0.1.0.0.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 +37 -33
- odoo/addons/account_loan/__manifest__.py +1 -1
- odoo/addons/account_loan/i18n/account_loan.pot +1 -24
- odoo/addons/account_loan/i18n/am.po +0 -3
- odoo/addons/account_loan/i18n/ar.po +0 -7
- odoo/addons/account_loan/i18n/bg.po +0 -3
- odoo/addons/account_loan/i18n/bs.po +0 -7
- odoo/addons/account_loan/i18n/ca.po +0 -10
- odoo/addons/account_loan/i18n/cs.po +0 -7
- odoo/addons/account_loan/i18n/de.po +0 -25
- odoo/addons/account_loan/i18n/el_GR.po +0 -3
- odoo/addons/account_loan/i18n/en_GB.po +0 -7
- odoo/addons/account_loan/i18n/es.po +0 -42
- odoo/addons/account_loan/i18n/es_CO.po +0 -3
- odoo/addons/account_loan/i18n/es_CR.po +0 -7
- odoo/addons/account_loan/i18n/es_EC.po +0 -7
- odoo/addons/account_loan/i18n/es_MX.po +0 -7
- odoo/addons/account_loan/i18n/es_VE.po +0 -4
- odoo/addons/account_loan/i18n/et.po +0 -7
- odoo/addons/account_loan/i18n/fi.po +0 -3
- odoo/addons/account_loan/i18n/fr.po +0 -10
- odoo/addons/account_loan/i18n/fr_CA.po +0 -3
- odoo/addons/account_loan/i18n/fr_CH.po +0 -3
- odoo/addons/account_loan/i18n/fr_FR.po +0 -3
- odoo/addons/account_loan/i18n/gl.po +0 -6
- odoo/addons/account_loan/i18n/hr.po +0 -10
- odoo/addons/account_loan/i18n/hr_HR.po +0 -6
- odoo/addons/account_loan/i18n/hu.po +0 -7
- odoo/addons/account_loan/i18n/id.po +0 -7
- odoo/addons/account_loan/i18n/it.po +0 -42
- odoo/addons/account_loan/i18n/ja.po +0 -7
- odoo/addons/account_loan/i18n/lt.po +0 -7
- odoo/addons/account_loan/i18n/mk.po +0 -7
- odoo/addons/account_loan/i18n/mn.po +0 -7
- odoo/addons/account_loan/i18n/nb.po +0 -7
- odoo/addons/account_loan/i18n/nb_NO.po +0 -3
- odoo/addons/account_loan/i18n/nl.po +0 -10
- odoo/addons/account_loan/i18n/nl_BE.po +0 -7
- odoo/addons/account_loan/i18n/nl_NL.po +0 -3
- odoo/addons/account_loan/i18n/pl.po +0 -7
- odoo/addons/account_loan/i18n/pt.po +0 -39
- odoo/addons/account_loan/i18n/pt_BR.po +0 -39
- odoo/addons/account_loan/i18n/pt_PT.po +0 -10
- odoo/addons/account_loan/i18n/ro.po +0 -7
- odoo/addons/account_loan/i18n/ru.po +0 -7
- odoo/addons/account_loan/i18n/sk_SK.po +0 -3
- odoo/addons/account_loan/i18n/sl.po +0 -12
- odoo/addons/account_loan/i18n/sr@latin.po +0 -4
- odoo/addons/account_loan/i18n/sv.po +0 -7
- odoo/addons/account_loan/i18n/th.po +0 -3
- odoo/addons/account_loan/i18n/tr.po +0 -7
- odoo/addons/account_loan/i18n/tr_TR.po +0 -7
- odoo/addons/account_loan/i18n/vi.po +0 -4
- odoo/addons/account_loan/i18n/zh_CN.po +0 -7
- odoo/addons/account_loan/i18n/zh_TW.po +0 -7
- odoo/addons/account_loan/migrations/17.0.1.0.0/noupdate_changes.xml +9 -0
- odoo/addons/account_loan/migrations/17.0.1.0.0/post-migration.py +10 -0
- odoo/addons/account_loan/models/account_loan.py +4 -44
- odoo/addons/account_loan/models/account_loan_line.py +5 -14
- odoo/addons/account_loan/models/res_partner.py +0 -2
- odoo/addons/account_loan/readme/CONTRIBUTORS.md +3 -0
- odoo/addons/account_loan/readme/DESCRIPTION.md +13 -0
- odoo/addons/account_loan/readme/HISTORY.md +4 -0
- odoo/addons/account_loan/readme/USAGE.md +17 -0
- odoo/addons/account_loan/security/account_loan_security.xml +2 -6
- odoo/addons/account_loan/static/description/index.html +23 -22
- odoo/addons/account_loan/tests/test_loan.py +23 -11
- odoo/addons/account_loan/views/account_loan_lines_view.xml +15 -11
- odoo/addons/account_loan/views/account_loan_view.xml +53 -35
- odoo/addons/account_loan/views/account_move_view.xml +1 -1
- odoo/addons/account_loan/views/res_partner.xml +2 -2
- odoo/addons/account_loan/wizards/account_loan_generate_entries_view.xml +0 -1
- odoo/addons/account_loan/wizards/account_loan_increase_amount.xml +0 -1
- odoo/addons/account_loan/wizards/account_loan_pay_amount_view.xml +0 -1
- odoo/addons/account_loan/wizards/account_loan_post_view.xml +0 -1
- {odoo_addon_account_loan-16.0.1.0.5.dist-info → odoo_addon_account_loan-17.0.1.0.0.3.dist-info}/METADATA +44 -40
- odoo_addon_account_loan-17.0.1.0.0.3.dist-info/RECORD +114 -0
- {odoo_addon_account_loan-16.0.1.0.5.dist-info → odoo_addon_account_loan-17.0.1.0.0.3.dist-info}/WHEEL +1 -1
- odoo_addon_account_loan-17.0.1.0.0.3.dist-info/top_level.txt +1 -0
- odoo/addons/account_loan/readme/CONTRIBUTORS.rst +0 -3
- odoo/addons/account_loan/readme/DESCRIPTION.rst +0 -12
- odoo/addons/account_loan/readme/HISTORY.rst +0 -4
- odoo/addons/account_loan/readme/USAGE.rst +0 -18
- odoo_addon_account_loan-16.0.1.0.5.dist-info/RECORD +0 -112
- odoo_addon_account_loan-16.0.1.0.5.dist-info/top_level.txt +0 -1
|
@@ -367,23 +367,24 @@ 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:fae1f5805841bcbac809ea9548904a5098614ee325624645cec438bb6ec36a25
|
|
371
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
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/
|
|
373
|
-
<p>This module extends the functionality of accounting to support loans.
|
|
374
|
-
|
|
375
|
-
|
|
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
|
+
<p>This module extends the functionality of accounting to support loans. It
|
|
374
|
+
will create automatically moves or invoices for loans. Moreover, you can
|
|
375
|
+
check the pending amount to be paid and reduce the debt.</p>
|
|
376
376
|
<p>It currently supports two kinds of debts:</p>
|
|
377
|
-
<ul
|
|
378
|
-
<li><
|
|
379
|
-
<
|
|
380
|
-
<
|
|
377
|
+
<ul>
|
|
378
|
+
<li><div class="first line-block">
|
|
379
|
+
<div class="line">Loans: a standard debt with banks, that only creates account moves.</div>
|
|
380
|
+
<div class="line">Loan types info:
|
|
381
381
|
<a class="reference external" href="https://en.wikipedia.org/wiki/Annual_percentage_rate">APR</a>,
|
|
382
382
|
<a class="reference external" href="https://en.wikipedia.org/wiki/Effective_interest_rate">EAR</a>,
|
|
383
|
-
<a class="reference external" href="https://en.wikipedia.org/wiki/Real_interest_rate">Real Rate</a>.</
|
|
384
|
-
</
|
|
383
|
+
<a class="reference external" href="https://en.wikipedia.org/wiki/Real_interest_rate">Real Rate</a>.</div>
|
|
384
|
+
</div>
|
|
385
|
+
</li>
|
|
386
|
+
<li><p class="first">Leases: a debt with a bank where purchase invoices are necessary</p>
|
|
385
387
|
</li>
|
|
386
|
-
<li>Leases: a debt with a bank where purchase invoices are necessary</li>
|
|
387
388
|
</ul>
|
|
388
389
|
<p><strong>Table of contents</strong></p>
|
|
389
390
|
<div class="contents local topic" id="contents">
|
|
@@ -406,12 +407,13 @@ Moreover, you can check the pending amount to be paid and reduce the debt.</p>
|
|
|
406
407
|
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
|
|
407
408
|
<p>To use this module, you need to:</p>
|
|
408
409
|
<ol class="arabic simple">
|
|
409
|
-
<li>Go to
|
|
410
|
-
<li>Configure a loan selecting the company, loan type, amount, rate and
|
|
410
|
+
<li>Go to Invoicing / Accounting > Accounting > Loans</li>
|
|
411
|
+
<li>Configure a loan selecting the company, loan type, amount, rate and
|
|
412
|
+
accounts</li>
|
|
411
413
|
<li>Post the loan, it will automatically create an account move with the
|
|
412
414
|
expected amounts</li>
|
|
413
|
-
<li>Create automatically the account moves / invoices related to loans
|
|
414
|
-
leases before a selected date</li>
|
|
415
|
+
<li>Create automatically the account moves / invoices related to loans
|
|
416
|
+
and leases before a selected date</li>
|
|
415
417
|
</ol>
|
|
416
418
|
<p>On a posted loan you can:</p>
|
|
417
419
|
<ul class="simple">
|
|
@@ -419,15 +421,14 @@ leases before a selected date</li>
|
|
|
419
421
|
<li>Modify rates when needed (only unposted lines will be modified)</li>
|
|
420
422
|
<li>Reduce or cancel the debt of a loan / lease</li>
|
|
421
423
|
</ul>
|
|
422
|
-
<a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/92/12.0">
|
|
423
|
-
<img alt="Try me on Runbot" src="https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas" />
|
|
424
|
-
</a>
|
|
424
|
+
<p><a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/92/12.0"><img alt="Try me on Runbot" src="https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas" /></a></p>
|
|
425
425
|
</div>
|
|
426
426
|
<div class="section" id="changelog">
|
|
427
427
|
<h1><a class="toc-backref" href="#toc-entry-2">Changelog</a></h1>
|
|
428
428
|
<div class="section" id="section-1">
|
|
429
429
|
<h2><a class="toc-backref" href="#toc-entry-3">16.0.1.0.0</a></h2>
|
|
430
|
-
<p>Due to the changes on 16, we will generate two moves on leasings, one
|
|
430
|
+
<p>Due to the changes on 16, we will generate two moves on leasings, one
|
|
431
|
+
for the invoice, and another one for the change from long to short term.</p>
|
|
431
432
|
</div>
|
|
432
433
|
</div>
|
|
433
434
|
<div class="section" id="bug-tracker">
|
|
@@ -435,7 +436,7 @@ leases before a selected date</li>
|
|
|
435
436
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-tools/issues">GitHub Issues</a>.
|
|
436
437
|
In case of trouble, please check there if your issue has already been reported.
|
|
437
438
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
438
|
-
<a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_loan%0Aversion:%
|
|
439
|
+
<a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_loan%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
|
439
440
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
440
441
|
</div>
|
|
441
442
|
<div class="section" id="credits">
|
|
@@ -465,7 +466,7 @@ mission is to support the collaborative development of Odoo features and
|
|
|
465
466
|
promote its widespread use.</p>
|
|
466
467
|
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
|
467
468
|
<p><a class="reference external image-reference" href="https://github.com/etobella"><img alt="etobella" src="https://github.com/etobella.png?size=40px" /></a></p>
|
|
468
|
-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/
|
|
469
|
+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/17.0/account_loan">OCA/account-financial-tools</a> project on GitHub.</p>
|
|
469
470
|
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
|
470
471
|
</div>
|
|
471
472
|
</div>
|
|
@@ -7,17 +7,20 @@ from dateutil.relativedelta import relativedelta
|
|
|
7
7
|
|
|
8
8
|
from odoo import fields
|
|
9
9
|
from odoo.exceptions import UserError
|
|
10
|
-
from odoo.tests import
|
|
10
|
+
from odoo.tests import Form, tagged
|
|
11
|
+
from odoo.tools import mute_logger
|
|
12
|
+
|
|
13
|
+
from odoo.addons.base.tests.common import BaseCommon
|
|
11
14
|
|
|
12
15
|
_logger = logging.getLogger(__name__)
|
|
13
16
|
try:
|
|
14
17
|
import numpy_financial
|
|
15
|
-
except (
|
|
18
|
+
except (OSError, ImportError) as err:
|
|
16
19
|
_logger.error(err)
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
@tagged("post_install", "-at_install")
|
|
20
|
-
class TestLoan(
|
|
23
|
+
class TestLoan(BaseCommon):
|
|
21
24
|
@classmethod
|
|
22
25
|
def setUpClass(cls):
|
|
23
26
|
super().setUpClass()
|
|
@@ -53,7 +56,7 @@ class TestLoan(TransactionCase):
|
|
|
53
56
|
)
|
|
54
57
|
|
|
55
58
|
def test_onchange(self):
|
|
56
|
-
loan = self.env["account.loan"].
|
|
59
|
+
loan = self.env["account.loan"].create(
|
|
57
60
|
{
|
|
58
61
|
"name": "LOAN",
|
|
59
62
|
"company_id": self.company.id,
|
|
@@ -69,13 +72,11 @@ class TestLoan(TransactionCase):
|
|
|
69
72
|
"partner_id": self.partner.id,
|
|
70
73
|
}
|
|
71
74
|
)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
loan.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
loan._onchange_company()
|
|
78
|
-
self.assertFalse(loan.interest_expenses_account_id)
|
|
75
|
+
loan_form = Form(loan)
|
|
76
|
+
loan_form.is_leasing = True
|
|
77
|
+
self.assertNotEqual(loan.journal_id, loan_form.journal_id)
|
|
78
|
+
loan_form.company_id = self.company_02
|
|
79
|
+
self.assertFalse(loan_form.interest_expenses_account_id)
|
|
79
80
|
|
|
80
81
|
def test_partner_loans(self):
|
|
81
82
|
self.assertFalse(self.partner.lended_loan_count)
|
|
@@ -84,6 +85,7 @@ class TestLoan(TransactionCase):
|
|
|
84
85
|
action = self.partner.action_view_partner_lended_loans()
|
|
85
86
|
self.assertEqual(loan, self.env[action["res_model"]].search(action["domain"]))
|
|
86
87
|
|
|
88
|
+
@mute_logger("odoo.models.unlink")
|
|
87
89
|
def test_round_on_end(self):
|
|
88
90
|
loan = self.create_loan("fixed-annuity", 500000, 1, 60)
|
|
89
91
|
loan.round_on_end = True
|
|
@@ -103,6 +105,7 @@ class TestLoan(TransactionCase):
|
|
|
103
105
|
self.assertEqual(line_1.principal_amount, 0)
|
|
104
106
|
self.assertEqual(line_end.principal_amount, 500000)
|
|
105
107
|
|
|
108
|
+
@mute_logger("odoo.models.unlink")
|
|
106
109
|
def test_increase_amount_validation(self):
|
|
107
110
|
amount = 10000
|
|
108
111
|
periods = 24
|
|
@@ -149,6 +152,7 @@ class TestLoan(TransactionCase):
|
|
|
149
152
|
default_loan_id=loan.id
|
|
150
153
|
).create({"amount": -100, "date": line.date}).run()
|
|
151
154
|
|
|
155
|
+
@mute_logger("odoo.models.unlink")
|
|
152
156
|
def test_pay_amount_validation(self):
|
|
153
157
|
amount = 10000
|
|
154
158
|
periods = 24
|
|
@@ -200,6 +204,7 @@ class TestLoan(TransactionCase):
|
|
|
200
204
|
default_loan_id=loan.id
|
|
201
205
|
).create({"amount": -100, "fees": 100, "date": line.date}).run()
|
|
202
206
|
|
|
207
|
+
@mute_logger("odoo.models.unlink")
|
|
203
208
|
def test_increase_amount_loan(self):
|
|
204
209
|
amount = 10000
|
|
205
210
|
periods = 24
|
|
@@ -246,6 +251,7 @@ class TestLoan(TransactionCase):
|
|
|
246
251
|
self.assertEqual(loan, new_move.loan_id)
|
|
247
252
|
self.assertEqual(loan.pending_principal_amount, pending_principal_amount + 1000)
|
|
248
253
|
|
|
254
|
+
@mute_logger("odoo.models.unlink")
|
|
249
255
|
def test_increase_amount_leasing(self):
|
|
250
256
|
amount = 10000
|
|
251
257
|
periods = 24
|
|
@@ -298,6 +304,7 @@ class TestLoan(TransactionCase):
|
|
|
298
304
|
self.assertEqual(loan, new_move.loan_id)
|
|
299
305
|
self.assertEqual(loan.pending_principal_amount, pending_principal_amount + 1000)
|
|
300
306
|
|
|
307
|
+
@mute_logger("odoo.models.unlink")
|
|
301
308
|
def test_fixed_annuity_begin_loan(self):
|
|
302
309
|
amount = 10000
|
|
303
310
|
periods = 24
|
|
@@ -348,6 +355,7 @@ class TestLoan(TransactionCase):
|
|
|
348
355
|
with self.assertRaises(UserError):
|
|
349
356
|
line.view_process_values()
|
|
350
357
|
|
|
358
|
+
@mute_logger("odoo.models.unlink")
|
|
351
359
|
def test_fixed_annuity_loan(self):
|
|
352
360
|
amount = 10000
|
|
353
361
|
periods = 24
|
|
@@ -394,6 +402,7 @@ class TestLoan(TransactionCase):
|
|
|
394
402
|
with self.assertRaises(UserError):
|
|
395
403
|
line.view_process_values()
|
|
396
404
|
|
|
405
|
+
@mute_logger("odoo.models.unlink")
|
|
397
406
|
def test_fixed_principal_loan_leasing(self):
|
|
398
407
|
amount = 24000
|
|
399
408
|
periods = 24
|
|
@@ -498,6 +507,7 @@ class TestLoan(TransactionCase):
|
|
|
498
507
|
with self.assertRaises(UserError):
|
|
499
508
|
line.view_process_values()
|
|
500
509
|
|
|
510
|
+
@mute_logger("odoo.models.unlink")
|
|
501
511
|
def test_fixed_principal_loan_auto_post_leasing(self):
|
|
502
512
|
amount = 24000
|
|
503
513
|
periods = 24
|
|
@@ -525,6 +535,7 @@ class TestLoan(TransactionCase):
|
|
|
525
535
|
self.assertTrue(line.has_invoices)
|
|
526
536
|
self.assertTrue(line.has_moves)
|
|
527
537
|
|
|
538
|
+
@mute_logger("odoo.models.unlink")
|
|
528
539
|
def test_interests_on_end_loan(self):
|
|
529
540
|
amount = 10000
|
|
530
541
|
periods = 10
|
|
@@ -555,6 +566,7 @@ class TestLoan(TransactionCase):
|
|
|
555
566
|
self.assertEqual(loan.payment_amount - loan.interests_amount, amount)
|
|
556
567
|
self.assertEqual(loan.pending_principal_amount, 0)
|
|
557
568
|
|
|
569
|
+
@mute_logger("odoo.models.unlink")
|
|
558
570
|
def test_cancel_loan(self):
|
|
559
571
|
amount = 10000
|
|
560
572
|
periods = 10
|
|
@@ -16,31 +16,31 @@
|
|
|
16
16
|
<field name="interests_amount" sum="Total interests" />
|
|
17
17
|
<field
|
|
18
18
|
name="long_term_pending_principal_amount"
|
|
19
|
-
|
|
19
|
+
column_invisible="not parent.long_term_loan_account_id"
|
|
20
20
|
/>
|
|
21
21
|
<field
|
|
22
22
|
name="long_term_principal_amount"
|
|
23
|
-
|
|
23
|
+
column_invisible="not parent.long_term_loan_account_id"
|
|
24
24
|
/>
|
|
25
|
-
<field name="long_term_loan_account_id"
|
|
26
|
-
<field name="loan_state"
|
|
27
|
-
<field name="is_leasing"
|
|
28
|
-
<field name="has_invoices"
|
|
29
|
-
<field name="has_moves"
|
|
30
|
-
<field name="currency_id"
|
|
25
|
+
<field name="long_term_loan_account_id" column_invisible="True" />
|
|
26
|
+
<field name="loan_state" column_invisible="True" />
|
|
27
|
+
<field name="is_leasing" column_invisible="True" />
|
|
28
|
+
<field name="has_invoices" column_invisible="True" />
|
|
29
|
+
<field name="has_moves" column_invisible="True" />
|
|
30
|
+
<field name="currency_id" column_invisible="True" />
|
|
31
31
|
<button
|
|
32
32
|
name="view_account_values"
|
|
33
33
|
string="Values"
|
|
34
34
|
type="object"
|
|
35
35
|
icon="fa-eye"
|
|
36
|
-
|
|
36
|
+
invisible="not has_moves and not has_invoices"
|
|
37
37
|
/>
|
|
38
38
|
<button
|
|
39
39
|
name="view_process_values"
|
|
40
40
|
string="Process"
|
|
41
41
|
type="object"
|
|
42
42
|
icon="fa-cogs"
|
|
43
|
-
|
|
43
|
+
invisible="has_moves or has_invoices or loan_state != 'posted'"
|
|
44
44
|
/>
|
|
45
45
|
</tree>
|
|
46
46
|
</field>
|
|
@@ -86,7 +86,11 @@
|
|
|
86
86
|
<field name="interests_amount" />
|
|
87
87
|
<field name="long_term_pending_principal_amount" />
|
|
88
88
|
<field name="long_term_principal_amount" />
|
|
89
|
-
<field
|
|
89
|
+
<field
|
|
90
|
+
name="company_id"
|
|
91
|
+
optional="hide"
|
|
92
|
+
groups="base.group_multi_company"
|
|
93
|
+
/>
|
|
90
94
|
<field name="partner_id" optional="hide" />
|
|
91
95
|
<field name="journal_id" optional="hide" />
|
|
92
96
|
<field name="short_term_loan_account_id" optional="hide" />
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<tree>
|
|
22
22
|
<field name="name" />
|
|
23
23
|
<field name="partner_id" optional="hide" />
|
|
24
|
-
<field name="company_id" />
|
|
24
|
+
<field name="company_id" groups="base.group_multi_company" />
|
|
25
25
|
<field name="is_leasing" />
|
|
26
26
|
<field name="state" />
|
|
27
27
|
<field name="rate" optional="hide" />
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<button name="compute_lines" type="object" string="Compute items" />
|
|
42
42
|
<button
|
|
43
43
|
name="%(account_loan_post_action)d"
|
|
44
|
-
|
|
44
|
+
invisible="state != 'draft'"
|
|
45
45
|
type="action"
|
|
46
46
|
string="Post"
|
|
47
47
|
groups="account.group_account_manager"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
name="view_account_moves"
|
|
55
55
|
class="oe_stat_button"
|
|
56
56
|
icon="fa-bars"
|
|
57
|
-
|
|
57
|
+
invisible="state == 'draft'"
|
|
58
58
|
type="object"
|
|
59
59
|
string="Moves"
|
|
60
60
|
/>
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
name="view_account_invoices"
|
|
63
63
|
class="oe_stat_button"
|
|
64
64
|
icon="fa-pencil-square-o"
|
|
65
|
-
|
|
65
|
+
invisible="state == 'draft' or not is_leasing"
|
|
66
66
|
type="object"
|
|
67
67
|
string="Invoices"
|
|
68
68
|
/>
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
name="%(account_loan_pay_amount_action)d"
|
|
71
71
|
class="oe_stat_button"
|
|
72
72
|
icon="fa-arrow-down"
|
|
73
|
-
|
|
73
|
+
invisible="state != 'posted'"
|
|
74
74
|
type="action"
|
|
75
75
|
groups="account.group_account_manager"
|
|
76
76
|
>
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
name="%(account_loan_increase_amount_act_window)d"
|
|
84
84
|
class="oe_stat_button"
|
|
85
85
|
icon="fa-arrow-up"
|
|
86
|
-
|
|
86
|
+
invisible="state != 'posted'"
|
|
87
87
|
type="action"
|
|
88
88
|
groups="account.group_account_manager"
|
|
89
89
|
>
|
|
@@ -94,34 +94,43 @@
|
|
|
94
94
|
</button>
|
|
95
95
|
</div>
|
|
96
96
|
<h1>
|
|
97
|
-
<field name="name" />
|
|
97
|
+
<field name="name" readonly="state != 'draft'" />
|
|
98
98
|
</h1>
|
|
99
99
|
<group>
|
|
100
100
|
<group>
|
|
101
|
-
<field name="company_id"
|
|
102
|
-
<field
|
|
103
|
-
|
|
101
|
+
<field name="company_id" invisible="1" />
|
|
102
|
+
<field
|
|
103
|
+
name="company_id"
|
|
104
|
+
options="{'no_create': True}"
|
|
105
|
+
readonly="state != 'draft'"
|
|
106
|
+
groups="base.group_multi_company"
|
|
107
|
+
/>
|
|
108
|
+
<field name="loan_type" readonly="state != 'draft'" />
|
|
109
|
+
<field name="loan_amount" readonly="state != 'draft'" />
|
|
104
110
|
</group>
|
|
105
111
|
<group>
|
|
106
|
-
<field name="rate_type" />
|
|
112
|
+
<field name="rate_type" readonly="state != 'draft'" />
|
|
107
113
|
<field name="rate" />
|
|
108
114
|
<field name="rate_period" />
|
|
109
115
|
</group>
|
|
110
116
|
</group>
|
|
111
117
|
<group>
|
|
112
118
|
<group>
|
|
113
|
-
<field name="partner_id" />
|
|
114
|
-
<field name="start_date" />
|
|
115
|
-
<field name="periods" />
|
|
116
|
-
<field name="method_period" />
|
|
119
|
+
<field name="partner_id" readonly="state != 'draft'" />
|
|
120
|
+
<field name="start_date" readonly="state != 'draft'" />
|
|
121
|
+
<field name="periods" readonly="state != 'draft'" />
|
|
122
|
+
<field name="method_period" readonly="state != 'draft'" />
|
|
117
123
|
</group>
|
|
118
124
|
<group>
|
|
119
|
-
<field name="is_leasing" />
|
|
120
|
-
<field name="round_on_end" />
|
|
121
|
-
<field
|
|
125
|
+
<field name="is_leasing" readonly="state != 'draft'" />
|
|
126
|
+
<field name="round_on_end" readonly="state != 'draft'" />
|
|
127
|
+
<field
|
|
128
|
+
name="payment_on_first_period"
|
|
129
|
+
readonly="state != 'draft'"
|
|
130
|
+
/>
|
|
122
131
|
</group>
|
|
123
132
|
</group>
|
|
124
|
-
<group
|
|
133
|
+
<group invisible="state == 'draft'">
|
|
125
134
|
<group>
|
|
126
135
|
<field name="pending_principal_amount" />
|
|
127
136
|
<field name="payment_amount" />
|
|
@@ -138,38 +147,47 @@
|
|
|
138
147
|
<page string="Accounts" id="accounting">
|
|
139
148
|
<group>
|
|
140
149
|
<group>
|
|
141
|
-
<field
|
|
142
|
-
|
|
150
|
+
<field
|
|
151
|
+
name="journal_id"
|
|
152
|
+
readonly="state != 'draft'"
|
|
153
|
+
/>
|
|
154
|
+
<field
|
|
155
|
+
name="short_term_loan_account_id"
|
|
156
|
+
readonly="state != 'draft'"
|
|
157
|
+
/>
|
|
143
158
|
<field name="journal_type" invisible="1" />
|
|
144
159
|
</group>
|
|
145
160
|
<group>
|
|
146
|
-
<field
|
|
147
|
-
|
|
161
|
+
<field
|
|
162
|
+
name="long_term_loan_account_id"
|
|
163
|
+
readonly="state != 'draft'"
|
|
164
|
+
/>
|
|
165
|
+
<field
|
|
166
|
+
name="interest_expenses_account_id"
|
|
167
|
+
readonly="state != 'draft'"
|
|
168
|
+
/>
|
|
148
169
|
<field name="currency_id" invisible="1" />
|
|
149
170
|
</group>
|
|
150
171
|
</group>
|
|
151
172
|
</page>
|
|
152
|
-
<page
|
|
153
|
-
string="Leasing"
|
|
154
|
-
id="leasing"
|
|
155
|
-
attrs="{'invisible': [('is_leasing', '=', False)]}"
|
|
156
|
-
>
|
|
173
|
+
<page string="Leasing" id="leasing" invisible="not is_leasing">
|
|
157
174
|
<group>
|
|
158
175
|
<group>
|
|
159
176
|
<field
|
|
160
177
|
name="leased_asset_account_id"
|
|
161
|
-
|
|
178
|
+
required="is_leasing"
|
|
179
|
+
readonly="state != 'draft'"
|
|
162
180
|
/>
|
|
163
|
-
<field name="residual_amount" />
|
|
164
|
-
</group>
|
|
165
|
-
<group>
|
|
166
181
|
<field
|
|
167
|
-
name="
|
|
168
|
-
|
|
182
|
+
name="residual_amount"
|
|
183
|
+
readonly="state != 'draft'"
|
|
169
184
|
/>
|
|
185
|
+
</group>
|
|
186
|
+
<group>
|
|
187
|
+
<field name="product_id" required="is_leasing" />
|
|
170
188
|
<field
|
|
171
189
|
name="interests_product_id"
|
|
172
|
-
|
|
190
|
+
required="is_leasing"
|
|
173
191
|
/>
|
|
174
192
|
<field name="post_invoice" />
|
|
175
193
|
</group>
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
icon="fa-money"
|
|
16
16
|
name="action_view_partner_lended_loans"
|
|
17
17
|
groups="account.group_account_user"
|
|
18
|
-
context="{'default_partner_id':
|
|
19
|
-
|
|
18
|
+
context="{'default_partner_id': id}"
|
|
19
|
+
invisible="lended_loan_count == 0"
|
|
20
20
|
>
|
|
21
21
|
<div class="o_form_field o_stat_info">
|
|
22
22
|
<span class="o_stat_value">
|