Skip to content

Commit

Permalink
adaugare modul pt seq
Browse files Browse the repository at this point in the history
  • Loading branch information
dhongu committed Oct 21, 2024
1 parent 3071bef commit de749e2
Show file tree
Hide file tree
Showing 12 changed files with 553 additions and 5 deletions.
67 changes: 67 additions & 0 deletions l10n_ro_account_sequence/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
=======================
Romania - Cash Sequence
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:eab9b8f2fd4a1039836786adeb3436cfa3e3f46346d8b6d5d589522d93155e33
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-dhongu%2Fl10n--romania-lightgray.png?logo=github
:target: https://github.com/dhongu/l10n-romania/tree/17.0/l10n_ro_account_sequence
:alt: dhongu/l10n-romania

|badge1| |badge2| |badge3|

Functionalitati

- Numerotarea separata a documetelor din jurnalul de casa

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/dhongu/l10n-romania/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/l10n-romania/issues/new?body=module:%20l10n_ro_account_sequence%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

Contributors
------------

- `Terrabit <https://www.terrabit.ro>`__:

- Dorin Hongu <[email protected]>

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

Maintainers
-----------

This module is part of the `dhongu/l10n-romania <https://github.com/dhongu/l10n-romania/tree/17.0/l10n_ro_account_sequence>`_ project on GitHub.

You are welcome to contribute.
3 changes: 3 additions & 0 deletions l10n_ro_account_sequence/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
12 changes: 12 additions & 0 deletions l10n_ro_account_sequence/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Romania - Cash Sequence",
"version": "17.0.1.0.0",
"author": "Terrabit," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-romania",
"category": "Romania Adaptation",
"depends": ["account"],
"countries": ["ro"],
"data": [],
"license": "AGPL-3",
}
4 changes: 4 additions & 0 deletions l10n_ro_account_sequence/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import account_move
# from . import account_payment
28 changes: 28 additions & 0 deletions l10n_ro_account_sequence/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from odoo import fields, models


class AccountMove(models.Model):
_inherit = "account.move"

payment_type = fields.Selection(
related="payment_id.payment_type", readonly=True, store=True
)

def _get_last_sequence_domain(self, relaxed=False):
where_string, param = super()._get_last_sequence_domain(relaxed=relaxed)
if self.journal_id and self.journal_id.type == "cash":
payment = self.payment_id
if payment:
payment_type = payment.payment_type
where_string += " AND payment_type = %(payment_type)s "
param["payment_type"] = payment_type
return where_string, param

def _get_starting_sequence(self):
starting_sequence = super()._get_starting_sequence()
if self.journal_id and self.journal_id.type == "cash":
if self.payment_id.payment_type == "inbound":
starting_sequence = "I" + starting_sequence
else:
starting_sequence = "O" + starting_sequence
return starting_sequence
3 changes: 3 additions & 0 deletions l10n_ro_account_sequence/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions l10n_ro_account_sequence/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [Terrabit](https://www.terrabit.ro):
- Dorin Hongu \<<[email protected]>\>

Do not contact contributors directly about support or help with
technical issues.
3 changes: 3 additions & 0 deletions l10n_ro_account_sequence/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Functionalitati

- Numerotarea separata a documetelor din jurnalul de casa
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 de749e2

Please sign in to comment.