diff --git a/account_bank_statement_balance_start_protection/README.rst b/account_bank_statement_balance_start_protection/README.rst new file mode 100644 index 000000000..0dfea2b2c --- /dev/null +++ b/account_bank_statement_balance_start_protection/README.rst @@ -0,0 +1,63 @@ +======================================= +Cash statement balance start protection +======================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:24df3bea9f57114efe68307863d4ec9c920e80b99d5d45cbf81b235f37d92032 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-NuoBiT%2Fodoo--addons-lightgray.png?logo=github + :target: https://github.com/NuoBiT/odoo-addons/tree/18.0/account_bank_statement_balance_start_protection + :alt: NuoBiT/odoo-addons + +|badge1| |badge2| |badge3| + +Cash statement balance start protection + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* NuoBiT Solutions SL + +Contributors +------------ + +- `NuoBiT `__: + + - Eric Antones eantones@nuobit.com + - Deniz Gallo dgallo@nuobit.com + +Maintainers +----------- + +This module is part of the `NuoBiT/odoo-addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/account_bank_statement_balance_start_protection/__init__.py b/account_bank_statement_balance_start_protection/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/account_bank_statement_balance_start_protection/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_bank_statement_balance_start_protection/__manifest__.py b/account_bank_statement_balance_start_protection/__manifest__.py new file mode 100644 index 000000000..1f9178354 --- /dev/null +++ b/account_bank_statement_balance_start_protection/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright NuoBiT Solutions SL - Eric Antones +# Copyright 2025 NuoBiT Solutions SL - Deniz Gallo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +{ + "name": "Cash statement balance start protection", + "summary": "Cash statement balance start protection", + "version": "18.0.1.0.0", + "author": "NuoBiT Solutions SL", + "license": "AGPL-3", + "category": "Custom", + "website": "https://github.com/NuoBiT/odoo-addons", + "depends": ["account_reconcile_oca"], + "data": ["views/account_views.xml"], +} diff --git a/account_bank_statement_balance_start_protection/models/__init__.py b/account_bank_statement_balance_start_protection/models/__init__.py new file mode 100644 index 000000000..0882dd26a --- /dev/null +++ b/account_bank_statement_balance_start_protection/models/__init__.py @@ -0,0 +1 @@ +from . import account_bank_statement diff --git a/account_bank_statement_balance_start_protection/models/account_bank_statement.py b/account_bank_statement_balance_start_protection/models/account_bank_statement.py new file mode 100644 index 000000000..096278638 --- /dev/null +++ b/account_bank_statement_balance_start_protection/models/account_bank_statement.py @@ -0,0 +1,26 @@ +# Copyright NuoBiT Solutions SL - Eric Antones +# Copyright 2025 NuoBiT Solutions SL - Deniz Gallo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import api, fields, models + + +class AccountBankStatement(models.Model): + _inherit = "account.bank.statement" + + disable_balance_start = fields.Boolean() + journal_type = fields.Selection( + related="journal_id.type", help="Technical field used for usability purposes" + ) + + @api.model_create_multi + def create(self, vals_list): + for vals in vals_list: + vals.update({"disable_balance_start": True}) + result = super().create(vals_list) + return result + + def write(self, vals): + vals.update({"disable_balance_start": True}) + result = super().write(vals) + return result diff --git a/account_bank_statement_balance_start_protection/pyproject.toml b/account_bank_statement_balance_start_protection/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/account_bank_statement_balance_start_protection/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_bank_statement_balance_start_protection/readme/CONTRIBUTORS.md b/account_bank_statement_balance_start_protection/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..909507cba --- /dev/null +++ b/account_bank_statement_balance_start_protection/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [NuoBiT](https://www.nuobit.com): + - Eric Antones + - Deniz Gallo diff --git a/account_bank_statement_balance_start_protection/readme/DESCRIPTION.md b/account_bank_statement_balance_start_protection/readme/DESCRIPTION.md new file mode 100644 index 000000000..f12451e4d --- /dev/null +++ b/account_bank_statement_balance_start_protection/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Cash statement balance start protection diff --git a/account_bank_statement_balance_start_protection/static/description/icon.png b/account_bank_statement_balance_start_protection/static/description/icon.png new file mode 100644 index 000000000..1cd641e79 Binary files /dev/null and b/account_bank_statement_balance_start_protection/static/description/icon.png differ diff --git a/account_bank_statement_balance_start_protection/static/description/index.html b/account_bank_statement_balance_start_protection/static/description/index.html new file mode 100644 index 000000000..de4730610 --- /dev/null +++ b/account_bank_statement_balance_start_protection/static/description/index.html @@ -0,0 +1,420 @@ + + + + + +Cash statement balance start protection + + + +
+

Cash statement balance start protection

+ + +

Beta License: AGPL-3 NuoBiT/odoo-addons

+

Cash statement balance start protection

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • NuoBiT Solutions SL
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the NuoBiT/odoo-addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/account_bank_statement_balance_start_protection/views/account_views.xml b/account_bank_statement_balance_start_protection/views/account_views.xml new file mode 100644 index 000000000..ae60e4978 --- /dev/null +++ b/account_bank_statement_balance_start_protection/views/account_views.xml @@ -0,0 +1,21 @@ + + + + + account.bank.statement.form.inherit + account.bank.statement + + + + + + + disable_balance_start != False or journal_type == 'cash' + + + +