odoo-addon-account-loan 16.0.1.0.4.7__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 +30 -24
- 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.py +1 -0
- odoo/addons/account_loan/wizards/account_loan_post_view.xml +0 -1
- {odoo_addon_account_loan-16.0.1.0.4.7.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.4.7.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.4.7.dist-info/RECORD +0 -112
- odoo_addon_account_loan-16.0.1.0.4.7.dist-info/top_level.txt +0 -1
|
@@ -1030,13 +1030,3 @@ msgstr ""
|
|
|
1030
1030
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1031
1031
|
msgid "or"
|
|
1032
1032
|
msgstr "of"
|
|
1033
|
-
|
|
1034
|
-
#~ msgid "Invoice"
|
|
1035
|
-
#~ msgstr "Factuur"
|
|
1036
|
-
|
|
1037
|
-
#, fuzzy
|
|
1038
|
-
#~ msgid "Journal Entries"
|
|
1039
|
-
#~ msgstr "Dagboek"
|
|
1040
|
-
|
|
1041
|
-
#~ msgid "Account Entry"
|
|
1042
|
-
#~ msgstr "Boeking"
|
|
@@ -1031,10 +1031,3 @@ msgstr ""
|
|
|
1031
1031
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1032
1032
|
msgid "or"
|
|
1033
1033
|
msgstr "of"
|
|
1034
|
-
|
|
1035
|
-
#~ msgid "Invoice"
|
|
1036
|
-
#~ msgstr "Factuur"
|
|
1037
|
-
|
|
1038
|
-
#, fuzzy
|
|
1039
|
-
#~ msgid "Journal Entries"
|
|
1040
|
-
#~ msgstr "Journaal"
|
|
@@ -1032,10 +1032,3 @@ msgstr ""
|
|
|
1032
1032
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1033
1033
|
msgid "or"
|
|
1034
1034
|
msgstr "lub"
|
|
1035
|
-
|
|
1036
|
-
#~ msgid "Invoice"
|
|
1037
|
-
#~ msgstr "Faktura"
|
|
1038
|
-
|
|
1039
|
-
#, fuzzy
|
|
1040
|
-
#~ msgid "Journal Entries"
|
|
1041
|
-
#~ msgstr "Dziennik"
|
|
@@ -1038,42 +1038,3 @@ msgstr ""
|
|
|
1038
1038
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1039
1039
|
msgid "or"
|
|
1040
1040
|
msgstr "ou"
|
|
1041
|
-
|
|
1042
|
-
#~ msgid "Followers (Channels)"
|
|
1043
|
-
#~ msgstr "Seguidores (Canais)"
|
|
1044
|
-
|
|
1045
|
-
#~ msgid "If checked new messages require your attention."
|
|
1046
|
-
#~ msgstr "Se selecionado novas mensagens necessitam da sua atenção."
|
|
1047
|
-
|
|
1048
|
-
#~ msgid "Invoice"
|
|
1049
|
-
#~ msgstr "Fatura"
|
|
1050
|
-
|
|
1051
|
-
#~ msgid "Journal Entries"
|
|
1052
|
-
#~ msgstr "Movimentos de Diário"
|
|
1053
|
-
|
|
1054
|
-
#~ msgid "Number of error"
|
|
1055
|
-
#~ msgstr "Número de erros"
|
|
1056
|
-
|
|
1057
|
-
#~ msgid "Number of messages which requires an action"
|
|
1058
|
-
#~ msgstr "Número de mensagens que requerem atenção"
|
|
1059
|
-
|
|
1060
|
-
#~ msgid "Number of unread messages"
|
|
1061
|
-
#~ msgstr "Número de mensagens não lidas"
|
|
1062
|
-
|
|
1063
|
-
#~ msgid "Overdue"
|
|
1064
|
-
#~ msgstr "Em mora"
|
|
1065
|
-
|
|
1066
|
-
#~ msgid "Planned"
|
|
1067
|
-
#~ msgstr "Planeado"
|
|
1068
|
-
|
|
1069
|
-
#~ msgid "Today"
|
|
1070
|
-
#~ msgstr "Hoje"
|
|
1071
|
-
|
|
1072
|
-
#~ msgid "Unread Messages"
|
|
1073
|
-
#~ msgstr "Mensagens Não lidas"
|
|
1074
|
-
|
|
1075
|
-
#~ msgid "Unread Messages Counter"
|
|
1076
|
-
#~ msgstr "Contador de Mensagens Não Lidas"
|
|
1077
|
-
|
|
1078
|
-
#~ msgid "Account Entry"
|
|
1079
|
-
#~ msgstr "Movimento de Conta"
|
|
@@ -1042,42 +1042,3 @@ msgstr ""
|
|
|
1042
1042
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1043
1043
|
msgid "or"
|
|
1044
1044
|
msgstr "ou"
|
|
1045
|
-
|
|
1046
|
-
#~ msgid "Followers (Channels)"
|
|
1047
|
-
#~ msgstr "Seguidores (Canais)"
|
|
1048
|
-
|
|
1049
|
-
#~ msgid "If checked new messages require your attention."
|
|
1050
|
-
#~ msgstr "Se marcado, novas mensagens solicitarão sua atenção."
|
|
1051
|
-
|
|
1052
|
-
#~ msgid "Invoice"
|
|
1053
|
-
#~ msgstr "Fatura"
|
|
1054
|
-
|
|
1055
|
-
#~ msgid "Journal Entries"
|
|
1056
|
-
#~ msgstr "Lançamentos de Diário"
|
|
1057
|
-
|
|
1058
|
-
#~ msgid "Number of error"
|
|
1059
|
-
#~ msgstr "Número do erro"
|
|
1060
|
-
|
|
1061
|
-
#~ msgid "Number of messages which requires an action"
|
|
1062
|
-
#~ msgstr "Número de mensagens que requer uma ação"
|
|
1063
|
-
|
|
1064
|
-
#~ msgid "Number of unread messages"
|
|
1065
|
-
#~ msgstr "Quantidade de mensagens não lidas"
|
|
1066
|
-
|
|
1067
|
-
#~ msgid "Overdue"
|
|
1068
|
-
#~ msgstr "Vencido(a)"
|
|
1069
|
-
|
|
1070
|
-
#~ msgid "Planned"
|
|
1071
|
-
#~ msgstr "Planejado"
|
|
1072
|
-
|
|
1073
|
-
#~ msgid "Today"
|
|
1074
|
-
#~ msgstr "Hoje"
|
|
1075
|
-
|
|
1076
|
-
#~ msgid "Unread Messages"
|
|
1077
|
-
#~ msgstr "Mensagens não lidas"
|
|
1078
|
-
|
|
1079
|
-
#~ msgid "Unread Messages Counter"
|
|
1080
|
-
#~ msgstr "Contador de Mensagens Não Lidas"
|
|
1081
|
-
|
|
1082
|
-
#~ msgid "Account Entry"
|
|
1083
|
-
#~ msgstr "Entrada de conta"
|
|
@@ -1031,13 +1031,3 @@ msgstr ""
|
|
|
1031
1031
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1032
1032
|
msgid "or"
|
|
1033
1033
|
msgstr "ou"
|
|
1034
|
-
|
|
1035
|
-
#~ msgid "Invoice"
|
|
1036
|
-
#~ msgstr "Fatura"
|
|
1037
|
-
|
|
1038
|
-
#, fuzzy
|
|
1039
|
-
#~ msgid "Journal Entries"
|
|
1040
|
-
#~ msgstr "Diário"
|
|
1041
|
-
|
|
1042
|
-
#~ msgid "Account Entry"
|
|
1043
|
-
#~ msgstr "Movimento de Conta"
|
|
@@ -1031,10 +1031,3 @@ msgstr ""
|
|
|
1031
1031
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1032
1032
|
msgid "or"
|
|
1033
1033
|
msgstr "sau"
|
|
1034
|
-
|
|
1035
|
-
#~ msgid "Invoice"
|
|
1036
|
-
#~ msgstr "Factura"
|
|
1037
|
-
|
|
1038
|
-
#, fuzzy
|
|
1039
|
-
#~ msgid "Journal Entries"
|
|
1040
|
-
#~ msgstr "Registru"
|
|
@@ -1032,15 +1032,3 @@ msgstr ""
|
|
|
1032
1032
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1033
1033
|
msgid "or"
|
|
1034
1034
|
msgstr "ali"
|
|
1035
|
-
|
|
1036
|
-
#~ msgid "Invoice"
|
|
1037
|
-
#~ msgstr "Račun"
|
|
1038
|
-
|
|
1039
|
-
#~ msgid "Journal Entries"
|
|
1040
|
-
#~ msgstr "Dnevniški vnosi"
|
|
1041
|
-
|
|
1042
|
-
#~ msgid "Planned"
|
|
1043
|
-
#~ msgstr "Planirano"
|
|
1044
|
-
|
|
1045
|
-
#~ msgid "Account Entry"
|
|
1046
|
-
#~ msgstr "Knjigovodski vnos"
|
|
@@ -1048,10 +1048,3 @@ msgstr "Vid kontroll kommer den första betalningen att vara på startdatum"
|
|
|
1048
1048
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1049
1049
|
msgid "or"
|
|
1050
1050
|
msgstr "eller"
|
|
1051
|
-
|
|
1052
|
-
#~ msgid "Invoice"
|
|
1053
|
-
#~ msgstr "Faktura"
|
|
1054
|
-
|
|
1055
|
-
#, fuzzy
|
|
1056
|
-
#~ msgid "Journal Entries"
|
|
1057
|
-
#~ msgstr "Journal"
|
|
@@ -1030,10 +1030,3 @@ msgstr ""
|
|
|
1030
1030
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1031
1031
|
msgid "or"
|
|
1032
1032
|
msgstr "ya da"
|
|
1033
|
-
|
|
1034
|
-
#~ msgid "Invoice"
|
|
1035
|
-
#~ msgstr "Fatura"
|
|
1036
|
-
|
|
1037
|
-
#, fuzzy
|
|
1038
|
-
#~ msgid "Journal Entries"
|
|
1039
|
-
#~ msgstr "Günlük"
|
|
@@ -1031,10 +1031,3 @@ msgstr ""
|
|
|
1031
1031
|
#: model_terms:ir.ui.view,arch_db:account_loan.account_loan_post_form
|
|
1032
1032
|
msgid "or"
|
|
1033
1033
|
msgstr "ya da "
|
|
1034
|
-
|
|
1035
|
-
#~ msgid "Invoice"
|
|
1036
|
-
#~ msgstr "Fatura"
|
|
1037
|
-
|
|
1038
|
-
#, fuzzy
|
|
1039
|
-
#~ msgid "Journal Entries"
|
|
1040
|
-
#~ msgstr "Yevmiye"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
+
<odoo>
|
|
3
|
+
<record id="account_loan_multi_company_rule" model="ir.rule">
|
|
4
|
+
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
|
5
|
+
</record>
|
|
6
|
+
<record id="account_loan_line_multi_company_rule" model="ir.rule">
|
|
7
|
+
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
|
8
|
+
</record>
|
|
9
|
+
</odoo>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Copyright 2024 Tecnativa - Víctor Martínez
|
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
3
|
+
from openupgradelib import openupgrade
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@openupgrade.migrate()
|
|
7
|
+
def migrate(env, version):
|
|
8
|
+
openupgrade.load_data(
|
|
9
|
+
env.cr, "account_loan", "migrations/17.0.1.0.0/noupdate_changes.xml"
|
|
10
|
+
)
|
|
@@ -12,7 +12,7 @@ from odoo import api, fields, models
|
|
|
12
12
|
_logger = logging.getLogger(__name__)
|
|
13
13
|
try:
|
|
14
14
|
import numpy_financial
|
|
15
|
-
except (
|
|
15
|
+
except (OSError, ImportError) as err:
|
|
16
16
|
_logger.debug(err)
|
|
17
17
|
|
|
18
18
|
|
|
@@ -27,24 +27,18 @@ class AccountLoan(models.Model):
|
|
|
27
27
|
name = fields.Char(
|
|
28
28
|
copy=False,
|
|
29
29
|
required=True,
|
|
30
|
-
readonly=True,
|
|
31
30
|
default="/",
|
|
32
|
-
states={"draft": [("readonly", False)]},
|
|
33
31
|
)
|
|
34
32
|
partner_id = fields.Many2one(
|
|
35
33
|
"res.partner",
|
|
36
34
|
required=True,
|
|
37
35
|
string="Lender",
|
|
38
36
|
help="Company or individual that lends the money at an interest rate.",
|
|
39
|
-
readonly=True,
|
|
40
|
-
states={"draft": [("readonly", False)]},
|
|
41
37
|
)
|
|
42
38
|
company_id = fields.Many2one(
|
|
43
39
|
"res.company",
|
|
44
40
|
required=True,
|
|
45
41
|
default=_default_company,
|
|
46
|
-
readonly=True,
|
|
47
|
-
states={"draft": [("readonly", False)]},
|
|
48
42
|
)
|
|
49
43
|
state = fields.Selection(
|
|
50
44
|
[
|
|
@@ -65,8 +59,6 @@ class AccountLoan(models.Model):
|
|
|
65
59
|
)
|
|
66
60
|
periods = fields.Integer(
|
|
67
61
|
required=True,
|
|
68
|
-
readonly=True,
|
|
69
|
-
states={"draft": [("readonly", False)]},
|
|
70
62
|
help="Number of periods that the loan will last",
|
|
71
63
|
)
|
|
72
64
|
method_period = fields.Integer(
|
|
@@ -74,13 +66,9 @@ class AccountLoan(models.Model):
|
|
|
74
66
|
default=1,
|
|
75
67
|
help="State here the time between 2 depreciations, in months",
|
|
76
68
|
required=True,
|
|
77
|
-
readonly=True,
|
|
78
|
-
states={"draft": [("readonly", False)]},
|
|
79
69
|
)
|
|
80
70
|
start_date = fields.Date(
|
|
81
71
|
help="Start of the moves",
|
|
82
|
-
readonly=True,
|
|
83
|
-
states={"draft": [("readonly", False)]},
|
|
84
72
|
copy=False,
|
|
85
73
|
)
|
|
86
74
|
rate = fields.Float(
|
|
@@ -100,8 +88,6 @@ class AccountLoan(models.Model):
|
|
|
100
88
|
required=True,
|
|
101
89
|
help="Method of computation of the applied rate",
|
|
102
90
|
default="napr",
|
|
103
|
-
readonly=True,
|
|
104
|
-
states={"draft": [("readonly", False)]},
|
|
105
91
|
)
|
|
106
92
|
loan_type = fields.Selection(
|
|
107
93
|
[
|
|
@@ -112,8 +98,6 @@ class AccountLoan(models.Model):
|
|
|
112
98
|
],
|
|
113
99
|
required=True,
|
|
114
100
|
help="Method of computation of the period annuity",
|
|
115
|
-
readonly=True,
|
|
116
|
-
states={"draft": [("readonly", False)]},
|
|
117
101
|
default="fixed-annuity",
|
|
118
102
|
)
|
|
119
103
|
fixed_amount = fields.Monetary(
|
|
@@ -134,30 +118,20 @@ class AccountLoan(models.Model):
|
|
|
134
118
|
loan_amount = fields.Monetary(
|
|
135
119
|
currency_field="currency_id",
|
|
136
120
|
required=True,
|
|
137
|
-
readonly=True,
|
|
138
|
-
states={"draft": [("readonly", False)]},
|
|
139
121
|
)
|
|
140
122
|
residual_amount = fields.Monetary(
|
|
141
123
|
currency_field="currency_id",
|
|
142
124
|
default=0.0,
|
|
143
125
|
required=True,
|
|
144
|
-
readonly=True,
|
|
145
|
-
states={"draft": [("readonly", False)]},
|
|
146
126
|
help="Residual amount of the lease that must be payed on the end in "
|
|
147
127
|
"order to acquire the asset",
|
|
148
128
|
)
|
|
149
129
|
round_on_end = fields.Boolean(
|
|
150
|
-
default=False,
|
|
151
130
|
help="When checked, the differences will be applied on the last period"
|
|
152
131
|
", if it is unchecked, the annuity will be recalculated on each "
|
|
153
132
|
"period.",
|
|
154
|
-
readonly=True,
|
|
155
|
-
states={"draft": [("readonly", False)]},
|
|
156
133
|
)
|
|
157
134
|
payment_on_first_period = fields.Boolean(
|
|
158
|
-
default=False,
|
|
159
|
-
readonly=True,
|
|
160
|
-
states={"draft": [("readonly", False)]},
|
|
161
135
|
help="When checked, the first payment will be on start date",
|
|
162
136
|
)
|
|
163
137
|
currency_id = fields.Many2one(
|
|
@@ -170,8 +144,6 @@ class AccountLoan(models.Model):
|
|
|
170
144
|
"account.journal",
|
|
171
145
|
domain="[('company_id', '=', company_id),('type', '=', journal_type)]",
|
|
172
146
|
required=True,
|
|
173
|
-
readonly=True,
|
|
174
|
-
states={"draft": [("readonly", False)]},
|
|
175
147
|
)
|
|
176
148
|
short_term_loan_account_id = fields.Many2one(
|
|
177
149
|
"account.account",
|
|
@@ -179,16 +151,12 @@ class AccountLoan(models.Model):
|
|
|
179
151
|
string="Short term account",
|
|
180
152
|
help="Account that will contain the pending amount on short term",
|
|
181
153
|
required=True,
|
|
182
|
-
readonly=True,
|
|
183
|
-
states={"draft": [("readonly", False)]},
|
|
184
154
|
)
|
|
185
155
|
long_term_loan_account_id = fields.Many2one(
|
|
186
156
|
"account.account",
|
|
187
157
|
string="Long term account",
|
|
188
158
|
help="Account that will contain the pending amount on Long term",
|
|
189
159
|
domain="[('company_id', '=', company_id)]",
|
|
190
|
-
readonly=True,
|
|
191
|
-
states={"draft": [("readonly", False)]},
|
|
192
160
|
)
|
|
193
161
|
interest_expenses_account_id = fields.Many2one(
|
|
194
162
|
"account.account",
|
|
@@ -196,19 +164,11 @@ class AccountLoan(models.Model):
|
|
|
196
164
|
string="Interests account",
|
|
197
165
|
help="Account where the interests will be assigned to",
|
|
198
166
|
required=True,
|
|
199
|
-
readonly=True,
|
|
200
|
-
states={"draft": [("readonly", False)]},
|
|
201
|
-
)
|
|
202
|
-
is_leasing = fields.Boolean(
|
|
203
|
-
default=False,
|
|
204
|
-
readonly=True,
|
|
205
|
-
states={"draft": [("readonly", False)]},
|
|
206
167
|
)
|
|
168
|
+
is_leasing = fields.Boolean()
|
|
207
169
|
leased_asset_account_id = fields.Many2one(
|
|
208
170
|
"account.account",
|
|
209
171
|
domain="[('company_id', '=', company_id)]",
|
|
210
|
-
readonly=True,
|
|
211
|
-
states={"draft": [("readonly", False)]},
|
|
212
172
|
)
|
|
213
173
|
product_id = fields.Many2one(
|
|
214
174
|
"product.product",
|
|
@@ -400,7 +360,7 @@ class AccountLoan(models.Model):
|
|
|
400
360
|
date = line.date + relativedelta(months=12)
|
|
401
361
|
if self.state == "draft" or line.sequence != final_sequence:
|
|
402
362
|
line.long_term_pending_principal_amount = sum(
|
|
403
|
-
self.line_ids.filtered(lambda r: r.date >= date).mapped(
|
|
363
|
+
self.line_ids.filtered(lambda r, date=date: r.date >= date).mapped(
|
|
404
364
|
"principal_amount"
|
|
405
365
|
)
|
|
406
366
|
)
|
|
@@ -452,7 +412,7 @@ class AccountLoan(models.Model):
|
|
|
452
412
|
def view_account_invoices(self):
|
|
453
413
|
self.ensure_one()
|
|
454
414
|
result = self.env["ir.actions.act_window"]._for_xml_id(
|
|
455
|
-
"account.
|
|
415
|
+
"account.action_move_in_invoice_type"
|
|
456
416
|
)
|
|
457
417
|
result["domain"] = [("loan_id", "=", self.id), ("move_type", "=", "in_invoice")]
|
|
458
418
|
return result
|
|
@@ -9,7 +9,7 @@ from odoo.exceptions import UserError
|
|
|
9
9
|
_logger = logging.getLogger(__name__)
|
|
10
10
|
try:
|
|
11
11
|
import numpy_financial
|
|
12
|
-
except (
|
|
12
|
+
except (OSError, ImportError) as err:
|
|
13
13
|
_logger.error(err)
|
|
14
14
|
|
|
15
15
|
|
|
@@ -27,35 +27,27 @@ class AccountLoanLine(models.Model):
|
|
|
27
27
|
)
|
|
28
28
|
company_id = fields.Many2one(
|
|
29
29
|
"res.company",
|
|
30
|
-
readonly=True,
|
|
31
30
|
related="loan_id.company_id",
|
|
32
31
|
store=True,
|
|
33
32
|
)
|
|
34
|
-
partner_id = fields.Many2one(
|
|
35
|
-
"res.partner", readonly=True, related="loan_id.partner_id"
|
|
36
|
-
)
|
|
33
|
+
partner_id = fields.Many2one("res.partner", related="loan_id.partner_id")
|
|
37
34
|
is_leasing = fields.Boolean(
|
|
38
35
|
related="loan_id.is_leasing",
|
|
39
|
-
readonly=True,
|
|
40
36
|
)
|
|
41
37
|
journal_id = fields.Many2one(
|
|
42
38
|
"account.journal",
|
|
43
|
-
readonly=True,
|
|
44
39
|
related="loan_id.journal_id",
|
|
45
40
|
)
|
|
46
41
|
short_term_loan_account_id = fields.Many2one(
|
|
47
42
|
"account.account",
|
|
48
|
-
readonly=True,
|
|
49
43
|
related="loan_id.short_term_loan_account_id",
|
|
50
44
|
)
|
|
51
45
|
interest_expenses_account_id = fields.Many2one(
|
|
52
46
|
"account.account",
|
|
53
|
-
readonly=True,
|
|
54
47
|
related="loan_id.interest_expenses_account_id",
|
|
55
48
|
)
|
|
56
49
|
loan_type = fields.Selection(
|
|
57
50
|
related="loan_id.loan_type",
|
|
58
|
-
readonly=True,
|
|
59
51
|
)
|
|
60
52
|
loan_state = fields.Selection(
|
|
61
53
|
related="loan_id.state",
|
|
@@ -70,7 +62,6 @@ class AccountLoanLine(models.Model):
|
|
|
70
62
|
)
|
|
71
63
|
long_term_loan_account_id = fields.Many2one(
|
|
72
64
|
"account.account",
|
|
73
|
-
readonly=True,
|
|
74
65
|
related="loan_id.long_term_loan_account_id",
|
|
75
66
|
)
|
|
76
67
|
currency_id = fields.Many2one(
|
|
@@ -363,7 +354,7 @@ class AccountLoanLine(models.Model):
|
|
|
363
354
|
for record in self:
|
|
364
355
|
if not record.move_ids:
|
|
365
356
|
if record.loan_id.line_ids.filtered(
|
|
366
|
-
lambda r: r.date < record.date and not r.move_ids
|
|
357
|
+
lambda r, record=record: r.date < record.date and not r.move_ids
|
|
367
358
|
):
|
|
368
359
|
raise UserError(_("Some moves must be created first"))
|
|
369
360
|
move = self.env["account.move"].create(
|
|
@@ -394,7 +385,7 @@ class AccountLoanLine(models.Model):
|
|
|
394
385
|
for record in self:
|
|
395
386
|
if not record.move_ids:
|
|
396
387
|
if record.loan_id.line_ids.filtered(
|
|
397
|
-
lambda r: r.date < record.date and not r.move_ids
|
|
388
|
+
lambda r, record=record: r.date < record.date and not r.move_ids
|
|
398
389
|
):
|
|
399
390
|
raise UserError(_("Some invoices must be created first"))
|
|
400
391
|
invoice = self.env["account.move"].create(record._invoice_vals())
|
|
@@ -404,7 +395,7 @@ class AccountLoanLine(models.Model):
|
|
|
404
395
|
invoice.flush_recordset()
|
|
405
396
|
invoice.filtered(
|
|
406
397
|
lambda m: m.currency_id.round(m.amount_total) < 0
|
|
407
|
-
).
|
|
398
|
+
).action_switch_move_type()
|
|
408
399
|
if record.loan_id.post_invoice:
|
|
409
400
|
invoice.action_post()
|
|
410
401
|
if (
|
|
@@ -5,7 +5,6 @@ from odoo import api, fields, models
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class ResPartner(models.Model):
|
|
8
|
-
|
|
9
8
|
_inherit = "res.partner"
|
|
10
9
|
|
|
11
10
|
lended_loan_ids = fields.One2many("account.loan", inverse_name="partner_id")
|
|
@@ -20,7 +19,6 @@ class ResPartner(models.Model):
|
|
|
20
19
|
record.lended_loan_count = len(record.lended_loan_ids)
|
|
21
20
|
|
|
22
21
|
def action_view_partner_lended_loans(self):
|
|
23
|
-
|
|
24
22
|
self.ensure_one()
|
|
25
23
|
action = self.env["ir.actions.actions"]._for_xml_id(
|
|
26
24
|
"account_loan.account_loan_action"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
This module extends the functionality of accounting to support loans. It
|
|
2
|
+
will create automatically moves or invoices for loans. Moreover, you can
|
|
3
|
+
check the pending amount to be paid and reduce the debt.
|
|
4
|
+
|
|
5
|
+
It currently supports two kinds of debts:
|
|
6
|
+
|
|
7
|
+
- Loans: a standard debt with banks, that only creates account moves.
|
|
8
|
+
Loan types info:
|
|
9
|
+
[APR](https://en.wikipedia.org/wiki/Annual_percentage_rate),
|
|
10
|
+
[EAR](https://en.wikipedia.org/wiki/Effective_interest_rate), [Real
|
|
11
|
+
Rate](https://en.wikipedia.org/wiki/Real_interest_rate).
|
|
12
|
+
|
|
13
|
+
- Leases: a debt with a bank where purchase invoices are necessary
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
To use this module, you need to:
|
|
2
|
+
|
|
3
|
+
1. Go to Invoicing / Accounting \> Accounting \> Loans
|
|
4
|
+
2. Configure a loan selecting the company, loan type, amount, rate and
|
|
5
|
+
accounts
|
|
6
|
+
3. Post the loan, it will automatically create an account move with the
|
|
7
|
+
expected amounts
|
|
8
|
+
4. Create automatically the account moves / invoices related to loans
|
|
9
|
+
and leases before a selected date
|
|
10
|
+
|
|
11
|
+
On a posted loan you can:
|
|
12
|
+
|
|
13
|
+
- Create moves or invoices (according to the configuration)
|
|
14
|
+
- Modify rates when needed (only unposted lines will be modified)
|
|
15
|
+
- Reduce or cancel the debt of a loan / lease
|
|
16
|
+
|
|
17
|
+
[](https://runbot.odoo-community.org/runbot/92/12.0)
|
|
@@ -4,17 +4,13 @@
|
|
|
4
4
|
<field name="name">Account loan multi-company</field>
|
|
5
5
|
<field ref="model_account_loan" name="model_id" />
|
|
6
6
|
<field eval="True" name="global" />
|
|
7
|
-
<field name="domain_force">
|
|
8
|
-
['|',('company_id','=',False),('company_id','in',company_ids)]
|
|
9
|
-
</field>
|
|
7
|
+
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
|
10
8
|
</record>
|
|
11
9
|
|
|
12
10
|
<record id="account_loan_line_multi_company_rule" model="ir.rule">
|
|
13
11
|
<field name="name">Account loan line multi-company</field>
|
|
14
12
|
<field ref="model_account_loan_line" name="model_id" />
|
|
15
13
|
<field eval="True" name="global" />
|
|
16
|
-
<field name="domain_force">
|
|
17
|
-
['|',('company_id','=',False),('company_id','in',company_ids)]
|
|
18
|
-
</field>
|
|
14
|
+
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
|
19
15
|
</record>
|
|
20
16
|
</odoo>
|