odoo-addon-account-loan 17.0.1.1.1__py3-none-any.whl → 17.0.2.2.0__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.
Files changed (91) hide show
  1. odoo/addons/account_loan/README.rst +6 -2
  2. odoo/addons/account_loan/__manifest__.py +1 -1
  3. odoo/addons/account_loan/i18n/account_loan.pot +46 -0
  4. odoo/addons/account_loan/i18n/am.po +36 -0
  5. odoo/addons/account_loan/i18n/ar.po +36 -0
  6. odoo/addons/account_loan/i18n/bg.po +36 -0
  7. odoo/addons/account_loan/i18n/bs.po +36 -0
  8. odoo/addons/account_loan/i18n/ca.po +36 -0
  9. odoo/addons/account_loan/i18n/ca_ES.po +36 -0
  10. odoo/addons/account_loan/i18n/cs.po +36 -0
  11. odoo/addons/account_loan/i18n/da.po +36 -0
  12. odoo/addons/account_loan/i18n/de.po +36 -0
  13. odoo/addons/account_loan/i18n/el_GR.po +36 -0
  14. odoo/addons/account_loan/i18n/en_AU.po +36 -0
  15. odoo/addons/account_loan/i18n/en_GB.po +36 -0
  16. odoo/addons/account_loan/i18n/es.po +36 -0
  17. odoo/addons/account_loan/i18n/es_AR.po +36 -0
  18. odoo/addons/account_loan/i18n/es_CL.po +36 -0
  19. odoo/addons/account_loan/i18n/es_CO.po +36 -0
  20. odoo/addons/account_loan/i18n/es_CR.po +36 -0
  21. odoo/addons/account_loan/i18n/es_DO.po +36 -0
  22. odoo/addons/account_loan/i18n/es_EC.po +36 -0
  23. odoo/addons/account_loan/i18n/es_ES.po +36 -0
  24. odoo/addons/account_loan/i18n/es_MX.po +36 -0
  25. odoo/addons/account_loan/i18n/es_PE.po +36 -0
  26. odoo/addons/account_loan/i18n/es_PY.po +36 -0
  27. odoo/addons/account_loan/i18n/es_VE.po +36 -0
  28. odoo/addons/account_loan/i18n/et.po +36 -0
  29. odoo/addons/account_loan/i18n/eu.po +36 -0
  30. odoo/addons/account_loan/i18n/fa.po +36 -0
  31. odoo/addons/account_loan/i18n/fi.po +36 -0
  32. odoo/addons/account_loan/i18n/fr.po +36 -0
  33. odoo/addons/account_loan/i18n/fr_CA.po +36 -0
  34. odoo/addons/account_loan/i18n/fr_CH.po +36 -0
  35. odoo/addons/account_loan/i18n/fr_FR.po +36 -0
  36. odoo/addons/account_loan/i18n/gl.po +36 -0
  37. odoo/addons/account_loan/i18n/gl_ES.po +36 -0
  38. odoo/addons/account_loan/i18n/gu.po +36 -0
  39. odoo/addons/account_loan/i18n/he.po +36 -0
  40. odoo/addons/account_loan/i18n/hi.po +36 -0
  41. odoo/addons/account_loan/i18n/hr.po +36 -0
  42. odoo/addons/account_loan/i18n/hr_HR.po +36 -0
  43. odoo/addons/account_loan/i18n/hu.po +36 -0
  44. odoo/addons/account_loan/i18n/id.po +36 -0
  45. odoo/addons/account_loan/i18n/it.po +46 -5
  46. odoo/addons/account_loan/i18n/ja.po +36 -0
  47. odoo/addons/account_loan/i18n/ko.po +36 -0
  48. odoo/addons/account_loan/i18n/lo.po +36 -0
  49. odoo/addons/account_loan/i18n/lt.po +36 -0
  50. odoo/addons/account_loan/i18n/lt_LT.po +36 -0
  51. odoo/addons/account_loan/i18n/lv.po +36 -0
  52. odoo/addons/account_loan/i18n/mk.po +36 -0
  53. odoo/addons/account_loan/i18n/mn.po +36 -0
  54. odoo/addons/account_loan/i18n/nb.po +36 -0
  55. odoo/addons/account_loan/i18n/nb_NO.po +36 -0
  56. odoo/addons/account_loan/i18n/nl.po +36 -0
  57. odoo/addons/account_loan/i18n/nl_BE.po +36 -0
  58. odoo/addons/account_loan/i18n/nl_NL.po +36 -0
  59. odoo/addons/account_loan/i18n/pl.po +36 -0
  60. odoo/addons/account_loan/i18n/pt.po +36 -0
  61. odoo/addons/account_loan/i18n/pt_BR.po +36 -0
  62. odoo/addons/account_loan/i18n/pt_PT.po +36 -0
  63. odoo/addons/account_loan/i18n/ro.po +36 -0
  64. odoo/addons/account_loan/i18n/ru.po +36 -0
  65. odoo/addons/account_loan/i18n/sk.po +36 -0
  66. odoo/addons/account_loan/i18n/sk_SK.po +36 -0
  67. odoo/addons/account_loan/i18n/sl.po +36 -0
  68. odoo/addons/account_loan/i18n/sr.po +36 -0
  69. odoo/addons/account_loan/i18n/sr@latin.po +36 -0
  70. odoo/addons/account_loan/i18n/sv.po +36 -0
  71. odoo/addons/account_loan/i18n/th.po +36 -0
  72. odoo/addons/account_loan/i18n/tr.po +36 -0
  73. odoo/addons/account_loan/i18n/tr_TR.po +36 -0
  74. odoo/addons/account_loan/i18n/uk.po +36 -0
  75. odoo/addons/account_loan/i18n/vi.po +36 -0
  76. odoo/addons/account_loan/i18n/vi_VN.po +36 -0
  77. odoo/addons/account_loan/i18n/zh_CN.po +36 -0
  78. odoo/addons/account_loan/i18n/zh_TW.po +36 -0
  79. odoo/addons/account_loan/models/account_loan.py +44 -14
  80. odoo/addons/account_loan/models/account_loan_line.py +30 -18
  81. odoo/addons/account_loan/models/account_move.py +0 -1
  82. odoo/addons/account_loan/static/description/index.html +19 -13
  83. odoo/addons/account_loan/tests/test_loan.py +49 -1
  84. odoo/addons/account_loan/views/account_loan_lines_view.xml +18 -10
  85. odoo/addons/account_loan/views/account_loan_view.xml +24 -4
  86. odoo/addons/account_loan/wizards/account_loan_post.py +15 -15
  87. {odoo_addon_account_loan-17.0.1.1.1.dist-info → odoo_addon_account_loan-17.0.2.2.0.dist-info}/METADATA +8 -3
  88. odoo_addon_account_loan-17.0.2.2.0.dist-info/RECORD +114 -0
  89. {odoo_addon_account_loan-17.0.1.1.1.dist-info → odoo_addon_account_loan-17.0.2.2.0.dist-info}/WHEEL +1 -1
  90. odoo_addon_account_loan-17.0.1.1.1.dist-info/RECORD +0 -114
  91. {odoo_addon_account_loan-17.0.1.1.1.dist-info → odoo_addon_account_loan-17.0.2.2.0.dist-info}/top_level.txt +0 -0
@@ -440,6 +440,15 @@ msgstr ""
440
440
  msgid "Is Leasing"
441
441
  msgstr ""
442
442
 
443
+ #. module: account_loan
444
+ #. odoo-python
445
+ #: code:addons/account_loan/models/account_loan.py:0
446
+ #, python-format
447
+ msgid ""
448
+ "It is only possible to change to draft if the status is cancelled or posted "
449
+ "and there are no account moves."
450
+ msgstr ""
451
+
443
452
  #. module: account_loan
444
453
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
445
454
  msgid "Items"
@@ -635,6 +644,11 @@ msgstr ""
635
644
  msgid "Move"
636
645
  msgstr ""
637
646
 
647
+ #. module: account_loan
648
+ #: model:ir.model.fields,field_description:account_loan.field_account_loan__move_count
649
+ msgid "Move Count"
650
+ msgstr ""
651
+
638
652
  #. module: account_loan
639
653
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
640
654
  msgid "Moves"
@@ -809,6 +823,13 @@ msgstr ""
809
823
  msgid "Rate"
810
824
  msgstr ""
811
825
 
826
+ #. module: account_loan
827
+ #. odoo-python
828
+ #: code:addons/account_loan/models/account_loan.py:0
829
+ #, python-format
830
+ msgid "Rate Change"
831
+ msgstr ""
832
+
812
833
  #. module: account_loan
813
834
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__rate_period
814
835
  msgid "Rate Period"
@@ -829,6 +850,11 @@ msgstr ""
829
850
  msgid "Real rate that will be applied on each period"
830
851
  msgstr ""
831
852
 
853
+ #. module: account_loan
854
+ #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
855
+ msgid "Reset to draft"
856
+ msgstr ""
857
+
832
858
  #. module: account_loan
833
859
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__residual_amount
834
860
  msgid "Residual Amount"
@@ -1010,6 +1036,16 @@ msgstr ""
1010
1036
  msgid "When checked, the first payment will be on start date"
1011
1037
  msgstr ""
1012
1038
 
1039
+ #. module: account_loan
1040
+ #. odoo-python
1041
+ #: code:addons/account_loan/models/account_loan.py:0
1042
+ #, python-format
1043
+ msgid ""
1044
+ "You have modified the interest rate. Click the Compute items button to "
1045
+ "update the lines. Please note that if you have manually edited these lines, "
1046
+ "those changes will be lost upon computation."
1047
+ msgstr ""
1048
+
1013
1049
  #. module: account_loan
1014
1050
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_line_tree
1015
1051
  msgid "principal_amount"
@@ -440,6 +440,15 @@ msgstr ""
440
440
  msgid "Is Leasing"
441
441
  msgstr ""
442
442
 
443
+ #. module: account_loan
444
+ #. odoo-python
445
+ #: code:addons/account_loan/models/account_loan.py:0
446
+ #, python-format
447
+ msgid ""
448
+ "It is only possible to change to draft if the status is cancelled or posted "
449
+ "and there are no account moves."
450
+ msgstr ""
451
+
443
452
  #. module: account_loan
444
453
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
445
454
  msgid "Items"
@@ -635,6 +644,11 @@ msgstr ""
635
644
  msgid "Move"
636
645
  msgstr ""
637
646
 
647
+ #. module: account_loan
648
+ #: model:ir.model.fields,field_description:account_loan.field_account_loan__move_count
649
+ msgid "Move Count"
650
+ msgstr ""
651
+
638
652
  #. module: account_loan
639
653
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
640
654
  msgid "Moves"
@@ -809,6 +823,13 @@ msgstr ""
809
823
  msgid "Rate"
810
824
  msgstr ""
811
825
 
826
+ #. module: account_loan
827
+ #. odoo-python
828
+ #: code:addons/account_loan/models/account_loan.py:0
829
+ #, python-format
830
+ msgid "Rate Change"
831
+ msgstr ""
832
+
812
833
  #. module: account_loan
813
834
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__rate_period
814
835
  msgid "Rate Period"
@@ -829,6 +850,11 @@ msgstr ""
829
850
  msgid "Real rate that will be applied on each period"
830
851
  msgstr ""
831
852
 
853
+ #. module: account_loan
854
+ #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
855
+ msgid "Reset to draft"
856
+ msgstr ""
857
+
832
858
  #. module: account_loan
833
859
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__residual_amount
834
860
  msgid "Residual Amount"
@@ -1010,6 +1036,16 @@ msgstr ""
1010
1036
  msgid "When checked, the first payment will be on start date"
1011
1037
  msgstr ""
1012
1038
 
1039
+ #. module: account_loan
1040
+ #. odoo-python
1041
+ #: code:addons/account_loan/models/account_loan.py:0
1042
+ #, python-format
1043
+ msgid ""
1044
+ "You have modified the interest rate. Click the Compute items button to "
1045
+ "update the lines. Please note that if you have manually edited these lines, "
1046
+ "those changes will be lost upon computation."
1047
+ msgstr ""
1048
+
1013
1049
  #. module: account_loan
1014
1050
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_line_tree
1015
1051
  msgid "principal_amount"
@@ -441,6 +441,15 @@ msgstr ""
441
441
  msgid "Is Leasing"
442
442
  msgstr ""
443
443
 
444
+ #. module: account_loan
445
+ #. odoo-python
446
+ #: code:addons/account_loan/models/account_loan.py:0
447
+ #, python-format
448
+ msgid ""
449
+ "It is only possible to change to draft if the status is cancelled or posted "
450
+ "and there are no account moves."
451
+ msgstr ""
452
+
444
453
  #. module: account_loan
445
454
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
446
455
  msgid "Items"
@@ -636,6 +645,11 @@ msgstr ""
636
645
  msgid "Move"
637
646
  msgstr ""
638
647
 
648
+ #. module: account_loan
649
+ #: model:ir.model.fields,field_description:account_loan.field_account_loan__move_count
650
+ msgid "Move Count"
651
+ msgstr ""
652
+
639
653
  #. module: account_loan
640
654
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
641
655
  msgid "Moves"
@@ -810,6 +824,13 @@ msgstr ""
810
824
  msgid "Rate"
811
825
  msgstr ""
812
826
 
827
+ #. module: account_loan
828
+ #. odoo-python
829
+ #: code:addons/account_loan/models/account_loan.py:0
830
+ #, python-format
831
+ msgid "Rate Change"
832
+ msgstr ""
833
+
813
834
  #. module: account_loan
814
835
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__rate_period
815
836
  msgid "Rate Period"
@@ -830,6 +851,11 @@ msgstr ""
830
851
  msgid "Real rate that will be applied on each period"
831
852
  msgstr ""
832
853
 
854
+ #. module: account_loan
855
+ #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
856
+ msgid "Reset to draft"
857
+ msgstr ""
858
+
833
859
  #. module: account_loan
834
860
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__residual_amount
835
861
  msgid "Residual Amount"
@@ -1011,6 +1037,16 @@ msgstr ""
1011
1037
  msgid "When checked, the first payment will be on start date"
1012
1038
  msgstr ""
1013
1039
 
1040
+ #. module: account_loan
1041
+ #. odoo-python
1042
+ #: code:addons/account_loan/models/account_loan.py:0
1043
+ #, python-format
1044
+ msgid ""
1045
+ "You have modified the interest rate. Click the Compute items button to "
1046
+ "update the lines. Please note that if you have manually edited these lines, "
1047
+ "those changes will be lost upon computation."
1048
+ msgstr ""
1049
+
1014
1050
  #. module: account_loan
1015
1051
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_line_tree
1016
1052
  msgid "principal_amount"
@@ -441,6 +441,15 @@ msgstr ""
441
441
  msgid "Is Leasing"
442
442
  msgstr ""
443
443
 
444
+ #. module: account_loan
445
+ #. odoo-python
446
+ #: code:addons/account_loan/models/account_loan.py:0
447
+ #, python-format
448
+ msgid ""
449
+ "It is only possible to change to draft if the status is cancelled or posted "
450
+ "and there are no account moves."
451
+ msgstr ""
452
+
444
453
  #. module: account_loan
445
454
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
446
455
  msgid "Items"
@@ -636,6 +645,11 @@ msgstr ""
636
645
  msgid "Move"
637
646
  msgstr ""
638
647
 
648
+ #. module: account_loan
649
+ #: model:ir.model.fields,field_description:account_loan.field_account_loan__move_count
650
+ msgid "Move Count"
651
+ msgstr ""
652
+
639
653
  #. module: account_loan
640
654
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
641
655
  msgid "Moves"
@@ -809,6 +823,13 @@ msgstr ""
809
823
  msgid "Rate"
810
824
  msgstr ""
811
825
 
826
+ #. module: account_loan
827
+ #. odoo-python
828
+ #: code:addons/account_loan/models/account_loan.py:0
829
+ #, python-format
830
+ msgid "Rate Change"
831
+ msgstr ""
832
+
812
833
  #. module: account_loan
813
834
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__rate_period
814
835
  msgid "Rate Period"
@@ -829,6 +850,11 @@ msgstr ""
829
850
  msgid "Real rate that will be applied on each period"
830
851
  msgstr ""
831
852
 
853
+ #. module: account_loan
854
+ #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
855
+ msgid "Reset to draft"
856
+ msgstr ""
857
+
832
858
  #. module: account_loan
833
859
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__residual_amount
834
860
  msgid "Residual Amount"
@@ -1010,6 +1036,16 @@ msgstr ""
1010
1036
  msgid "When checked, the first payment will be on start date"
1011
1037
  msgstr ""
1012
1038
 
1039
+ #. module: account_loan
1040
+ #. odoo-python
1041
+ #: code:addons/account_loan/models/account_loan.py:0
1042
+ #, python-format
1043
+ msgid ""
1044
+ "You have modified the interest rate. Click the Compute items button to "
1045
+ "update the lines. Please note that if you have manually edited these lines, "
1046
+ "those changes will be lost upon computation."
1047
+ msgstr ""
1048
+
1013
1049
  #. module: account_loan
1014
1050
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_line_tree
1015
1051
  msgid "principal_amount"
@@ -440,6 +440,15 @@ msgstr ""
440
440
  msgid "Is Leasing"
441
441
  msgstr ""
442
442
 
443
+ #. module: account_loan
444
+ #. odoo-python
445
+ #: code:addons/account_loan/models/account_loan.py:0
446
+ #, python-format
447
+ msgid ""
448
+ "It is only possible to change to draft if the status is cancelled or posted "
449
+ "and there are no account moves."
450
+ msgstr ""
451
+
443
452
  #. module: account_loan
444
453
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
445
454
  msgid "Items"
@@ -635,6 +644,11 @@ msgstr ""
635
644
  msgid "Move"
636
645
  msgstr ""
637
646
 
647
+ #. module: account_loan
648
+ #: model:ir.model.fields,field_description:account_loan.field_account_loan__move_count
649
+ msgid "Move Count"
650
+ msgstr ""
651
+
638
652
  #. module: account_loan
639
653
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
640
654
  msgid "Moves"
@@ -808,6 +822,13 @@ msgstr ""
808
822
  msgid "Rate"
809
823
  msgstr ""
810
824
 
825
+ #. module: account_loan
826
+ #. odoo-python
827
+ #: code:addons/account_loan/models/account_loan.py:0
828
+ #, python-format
829
+ msgid "Rate Change"
830
+ msgstr ""
831
+
811
832
  #. module: account_loan
812
833
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__rate_period
813
834
  msgid "Rate Period"
@@ -828,6 +849,11 @@ msgstr ""
828
849
  msgid "Real rate that will be applied on each period"
829
850
  msgstr ""
830
851
 
852
+ #. module: account_loan
853
+ #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
854
+ msgid "Reset to draft"
855
+ msgstr ""
856
+
831
857
  #. module: account_loan
832
858
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__residual_amount
833
859
  msgid "Residual Amount"
@@ -1009,6 +1035,16 @@ msgstr ""
1009
1035
  msgid "When checked, the first payment will be on start date"
1010
1036
  msgstr ""
1011
1037
 
1038
+ #. module: account_loan
1039
+ #. odoo-python
1040
+ #: code:addons/account_loan/models/account_loan.py:0
1041
+ #, python-format
1042
+ msgid ""
1043
+ "You have modified the interest rate. Click the Compute items button to "
1044
+ "update the lines. Please note that if you have manually edited these lines, "
1045
+ "those changes will be lost upon computation."
1046
+ msgstr ""
1047
+
1012
1048
  #. module: account_loan
1013
1049
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_line_tree
1014
1050
  msgid "principal_amount"
@@ -441,6 +441,15 @@ msgstr ""
441
441
  msgid "Is Leasing"
442
442
  msgstr ""
443
443
 
444
+ #. module: account_loan
445
+ #. odoo-python
446
+ #: code:addons/account_loan/models/account_loan.py:0
447
+ #, python-format
448
+ msgid ""
449
+ "It is only possible to change to draft if the status is cancelled or posted "
450
+ "and there are no account moves."
451
+ msgstr ""
452
+
444
453
  #. module: account_loan
445
454
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
446
455
  msgid "Items"
@@ -636,6 +645,11 @@ msgstr ""
636
645
  msgid "Move"
637
646
  msgstr ""
638
647
 
648
+ #. module: account_loan
649
+ #: model:ir.model.fields,field_description:account_loan.field_account_loan__move_count
650
+ msgid "Move Count"
651
+ msgstr ""
652
+
639
653
  #. module: account_loan
640
654
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
641
655
  msgid "Moves"
@@ -809,6 +823,13 @@ msgstr ""
809
823
  msgid "Rate"
810
824
  msgstr ""
811
825
 
826
+ #. module: account_loan
827
+ #. odoo-python
828
+ #: code:addons/account_loan/models/account_loan.py:0
829
+ #, python-format
830
+ msgid "Rate Change"
831
+ msgstr ""
832
+
812
833
  #. module: account_loan
813
834
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__rate_period
814
835
  msgid "Rate Period"
@@ -829,6 +850,11 @@ msgstr ""
829
850
  msgid "Real rate that will be applied on each period"
830
851
  msgstr ""
831
852
 
853
+ #. module: account_loan
854
+ #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
855
+ msgid "Reset to draft"
856
+ msgstr ""
857
+
832
858
  #. module: account_loan
833
859
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__residual_amount
834
860
  msgid "Residual Amount"
@@ -1010,6 +1036,16 @@ msgstr ""
1010
1036
  msgid "When checked, the first payment will be on start date"
1011
1037
  msgstr ""
1012
1038
 
1039
+ #. module: account_loan
1040
+ #. odoo-python
1041
+ #: code:addons/account_loan/models/account_loan.py:0
1042
+ #, python-format
1043
+ msgid ""
1044
+ "You have modified the interest rate. Click the Compute items button to "
1045
+ "update the lines. Please note that if you have manually edited these lines, "
1046
+ "those changes will be lost upon computation."
1047
+ msgstr ""
1048
+
1013
1049
  #. module: account_loan
1014
1050
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_line_tree
1015
1051
  msgid "principal_amount"
@@ -441,6 +441,15 @@ msgstr ""
441
441
  msgid "Is Leasing"
442
442
  msgstr ""
443
443
 
444
+ #. module: account_loan
445
+ #. odoo-python
446
+ #: code:addons/account_loan/models/account_loan.py:0
447
+ #, python-format
448
+ msgid ""
449
+ "It is only possible to change to draft if the status is cancelled or posted "
450
+ "and there are no account moves."
451
+ msgstr ""
452
+
444
453
  #. module: account_loan
445
454
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
446
455
  msgid "Items"
@@ -636,6 +645,11 @@ msgstr ""
636
645
  msgid "Move"
637
646
  msgstr ""
638
647
 
648
+ #. module: account_loan
649
+ #: model:ir.model.fields,field_description:account_loan.field_account_loan__move_count
650
+ msgid "Move Count"
651
+ msgstr ""
652
+
639
653
  #. module: account_loan
640
654
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
641
655
  msgid "Moves"
@@ -810,6 +824,13 @@ msgstr ""
810
824
  msgid "Rate"
811
825
  msgstr ""
812
826
 
827
+ #. module: account_loan
828
+ #. odoo-python
829
+ #: code:addons/account_loan/models/account_loan.py:0
830
+ #, python-format
831
+ msgid "Rate Change"
832
+ msgstr ""
833
+
813
834
  #. module: account_loan
814
835
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__rate_period
815
836
  msgid "Rate Period"
@@ -830,6 +851,11 @@ msgstr ""
830
851
  msgid "Real rate that will be applied on each period"
831
852
  msgstr ""
832
853
 
854
+ #. module: account_loan
855
+ #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
856
+ msgid "Reset to draft"
857
+ msgstr ""
858
+
833
859
  #. module: account_loan
834
860
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__residual_amount
835
861
  msgid "Residual Amount"
@@ -1011,6 +1037,16 @@ msgstr ""
1011
1037
  msgid "When checked, the first payment will be on start date"
1012
1038
  msgstr ""
1013
1039
 
1040
+ #. module: account_loan
1041
+ #. odoo-python
1042
+ #: code:addons/account_loan/models/account_loan.py:0
1043
+ #, python-format
1044
+ msgid ""
1045
+ "You have modified the interest rate. Click the Compute items button to "
1046
+ "update the lines. Please note that if you have manually edited these lines, "
1047
+ "those changes will be lost upon computation."
1048
+ msgstr ""
1049
+
1014
1050
  #. module: account_loan
1015
1051
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_line_tree
1016
1052
  msgid "principal_amount"
@@ -441,6 +441,15 @@ msgstr ""
441
441
  msgid "Is Leasing"
442
442
  msgstr ""
443
443
 
444
+ #. module: account_loan
445
+ #. odoo-python
446
+ #: code:addons/account_loan/models/account_loan.py:0
447
+ #, python-format
448
+ msgid ""
449
+ "It is only possible to change to draft if the status is cancelled or posted "
450
+ "and there are no account moves."
451
+ msgstr ""
452
+
444
453
  #. module: account_loan
445
454
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
446
455
  msgid "Items"
@@ -636,6 +645,11 @@ msgstr ""
636
645
  msgid "Move"
637
646
  msgstr ""
638
647
 
648
+ #. module: account_loan
649
+ #: model:ir.model.fields,field_description:account_loan.field_account_loan__move_count
650
+ msgid "Move Count"
651
+ msgstr ""
652
+
639
653
  #. module: account_loan
640
654
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
641
655
  msgid "Moves"
@@ -810,6 +824,13 @@ msgstr ""
810
824
  msgid "Rate"
811
825
  msgstr ""
812
826
 
827
+ #. module: account_loan
828
+ #. odoo-python
829
+ #: code:addons/account_loan/models/account_loan.py:0
830
+ #, python-format
831
+ msgid "Rate Change"
832
+ msgstr ""
833
+
813
834
  #. module: account_loan
814
835
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__rate_period
815
836
  msgid "Rate Period"
@@ -830,6 +851,11 @@ msgstr ""
830
851
  msgid "Real rate that will be applied on each period"
831
852
  msgstr ""
832
853
 
854
+ #. module: account_loan
855
+ #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_form
856
+ msgid "Reset to draft"
857
+ msgstr ""
858
+
833
859
  #. module: account_loan
834
860
  #: model:ir.model.fields,field_description:account_loan.field_account_loan__residual_amount
835
861
  msgid "Residual Amount"
@@ -1011,6 +1037,16 @@ msgstr ""
1011
1037
  msgid "When checked, the first payment will be on start date"
1012
1038
  msgstr ""
1013
1039
 
1040
+ #. module: account_loan
1041
+ #. odoo-python
1042
+ #: code:addons/account_loan/models/account_loan.py:0
1043
+ #, python-format
1044
+ msgid ""
1045
+ "You have modified the interest rate. Click the Compute items button to "
1046
+ "update the lines. Please note that if you have manually edited these lines, "
1047
+ "those changes will be lost upon computation."
1048
+ msgstr ""
1049
+
1014
1050
  #. module: account_loan
1015
1051
  #: model_terms:ir.ui.view,arch_db:account_loan.account_loan_line_tree
1016
1052
  msgid "principal_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",
@@ -205,21 +207,37 @@ class AccountLoan(models.Model):
205
207
  ("name_uniq", "unique(name, company_id)", "Loan name must be unique"),
206
208
  ]
207
209
 
210
+ @api.onchange("rate")
211
+ def _onchange_rate_warning(self):
212
+ if self.state != "draft":
213
+ return {
214
+ "warning": {
215
+ "title": _("Rate Change"),
216
+ "message": _(
217
+ "You have modified the interest rate. Click the Compute items button to update the lines. Please note that if you have manually edited these lines, those changes will be lost upon computation."
218
+ ),
219
+ }
220
+ }
221
+
208
222
  @api.onchange("line_ids")
209
223
  def _onchange_line_ids_draft_manual(self):
210
- if self.state == "draft":
211
- self.line_ids = self.line_ids.sorted(key=lambda line: line.sequence)
212
- previous_pending_principal = 0
213
- previous_principal_amount = 0
214
- for line in self.line_ids:
215
- if line.sequence == 1:
216
- line.pending_principal_amount = line.loan_id.loan_amount
217
- else:
218
- line.pending_principal_amount = (
219
- previous_pending_principal - previous_principal_amount
220
- )
221
- previous_pending_principal = line.pending_principal_amount
222
- previous_principal_amount = line.principal_amount
224
+ self.line_ids = self.line_ids.sorted(key=lambda line: line.sequence)
225
+ previous_pending_principal = 0
226
+ previous_principal_amount = 0
227
+ for line in self.line_ids:
228
+ if line.sequence == 1:
229
+ line.pending_principal_amount = line.loan_id.loan_amount
230
+ else:
231
+ line.pending_principal_amount = (
232
+ previous_pending_principal - previous_principal_amount
233
+ )
234
+ previous_pending_principal = line.pending_principal_amount
235
+ previous_principal_amount = line.principal_amount
236
+
237
+ @api.depends("move_ids")
238
+ def _compute_move_count(self):
239
+ for item in self:
240
+ item.move_count = len(item.move_ids)
223
241
 
224
242
  @api.depends("line_ids", "currency_id", "loan_amount")
225
243
  def _compute_total_amounts(self):
@@ -409,6 +427,7 @@ class AccountLoan(models.Model):
409
427
  delta = relativedelta(months=self.method_period)
410
428
  if not self.payment_on_first_period:
411
429
  date = initial_date + delta
430
+ initial_date = date
412
431
  for i in range(1, self.periods + 1):
413
432
  line = self.env["account.loan.line"].create(
414
433
  self._new_line_vals(i, date, amount)
@@ -419,6 +438,17 @@ class AccountLoan(models.Model):
419
438
  if self.long_term_loan_account_id:
420
439
  self._check_long_term_principal_amount()
421
440
 
441
+ def button_draft(self):
442
+ for item in self:
443
+ if item.state not in ("posted", "cancelled") or item.move_count > 0:
444
+ raise UserError(
445
+ _(
446
+ "It is only possible to change to draft if the status is "
447
+ "cancelled or posted and there are no account moves."
448
+ )
449
+ )
450
+ item.state = "draft"
451
+
422
452
  def view_account_moves(self):
423
453
  self.ensure_one()
424
454
  result = self.env["ir.actions.act_window"]._for_xml_id(