Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
VoicuStefan2001 authored Nov 28, 2023
1 parent e203ffa commit 724f463
Show file tree
Hide file tree
Showing 40 changed files with 1,439 additions and 0 deletions.
66 changes: 66 additions & 0 deletions deltatech_account_restrict_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
=====================
Restrict account date
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2b3726716ea1f3a454c13c55b823540719e2a6bb705a561ee573f9b59ecfeb83
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-OPL--1-blue.png
:target: https://www.odoo.com/documentation/master/legal/licenses.html
:alt: License: OPL-1
.. |badge3| image:: https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github
:target: https://github.com/dhongu/deltatech/tree/17.0/deltatech_account_restrict_date
:alt: dhongu/deltatech

|badge1| |badge2| |badge3|


Features:
* Restrict statement line reconciliation cancel if date before the value of system parameter "sequence.mixin.constraint_start_date"

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/dhongu/deltatech/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 <https://github.com/dhongu/deltatech/issues/new?body=module:%20deltatech_account_restrict_date%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Terrabit
* Dan Stoica

Maintainers
~~~~~~~~~~~

.. |maintainer-danila12| image:: https://github.com/danila12.png?size=40px
:target: https://github.com/danila12
:alt: danila12

Current maintainer:

|maintainer-danila12|

This module is part of the `dhongu/deltatech <https://github.com/dhongu/deltatech/tree/17.0/deltatech_account_restrict_date>`_ project on GitHub.

You are welcome to contribute.
5 changes: 5 additions & 0 deletions deltatech_account_restrict_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# © 2015-now Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details

from . import models
21 changes: 21 additions & 0 deletions deltatech_account_restrict_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# © 2015-2018 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details


{
"name": "Restrict account date",
"version": "17.0.1.0.1",
"author": "Terrabit, Dan Stoica",
"website": "https://www.terrabit.ro",
"summary": "Restrict certain operations depending on date",
"category": "Accounting",
"depends": [
"account",
],
"license": "OPL-1",
# "data": ["views/product_view.xml", "security/ir.model.access.csv"],
"images": ["images/main_screenshot.png"],
"development_status": "Beta",
"maintainers": ["danila12"],
}
Binary file not shown.
46 changes: 46 additions & 0 deletions deltatech_account_restrict_date/i18n/ro.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * deltatech_account_restrict_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-09 10:38+0000\n"
"PO-Revision-Date: 2022-06-09 10:38+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: deltatech_account_restrict_date
#: model:ir.model,name:deltatech_account_restrict_date.model_account_bank_statement_line
msgid "Bank Statement Line"
msgstr "Linie extras bacă"

#. module: deltatech_account_restrict_date
#: model:ir.model.fields,field_description:deltatech_account_restrict_date.field_account_bank_statement_line__display_name
msgid "Display Name"
msgstr "Nume afișat"

#. module: deltatech_account_restrict_date
#: model:ir.model.fields,field_description:deltatech_account_restrict_date.field_account_bank_statement_line__id
msgid "ID"
msgstr ""

#. module: deltatech_account_restrict_date
#: model:ir.model.fields,field_description:deltatech_account_restrict_date.field_account_bank_statement_line____last_update
msgid "Last Modified on"
msgstr "Ultima modificare la"

#. module: deltatech_account_restrict_date
#: code:addons/deltatech_account_restrict_date/models/account_bank_statement.py:0
#, python-format
msgid ""
"You cannot perform this operation on this line (date restriction). Please "
"contact your support team."
msgstr ""
"Această operație nu poate fi efectuată (restricție dată). Vă rugăm "
"să contactați echipa de asistență."
5 changes: 5 additions & 0 deletions deltatech_account_restrict_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# © 2015-now Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details

from . import account_bank_statement
Binary file not shown.
Binary file not shown.
27 changes: 27 additions & 0 deletions deltatech_account_restrict_date/models/account_bank_statement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# © 2015-now Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details


from datetime import datetime

from odoo import _, models
from odoo.exceptions import UserError


class AccountBankStatementLine(models.Model):
_inherit = "account.bank.statement.line"

def action_undo_reconciliation(self):
get_param = self.env["ir.config_parameter"].sudo().get_param
date_limit = get_param("sequence.mixin.constraint_start_date", "2000-01-01")
if date_limit:
date_limit_obj = datetime.strptime(date_limit, "%Y-%m-%d").date()
for st_line in self:
if st_line.date < date_limit_obj:
raise UserError(
_(
"You cannot perform this operation on this line (date restriction). Please contact your support team."
)
)
return super().action_undo_reconciliation()
3 changes: 3 additions & 0 deletions deltatech_account_restrict_date/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

Features:
* Restrict statement line reconciliation cancel if date before the value of system parameter "sequence.mixin.constraint_start_date"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 724f463

Please sign in to comment.