Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions account_check_printing_sequence_option/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================================
Account Check Printing Sequence Option
======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:dba7434be9c19ba92d10899d40cd5a37bc132390d333ea8abe71eedee3969ce8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/license-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-OCA%2Faccount--financial--tools-lightgray.png?logo=github
:target: https://github.com/OCA/account-financial-tools/tree/19.0/account_check_printing_sequence_option
:alt: OCA/account-financial-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-financial-tools-19-0/account-financial-tools-19-0-account_check_printing_sequence_option
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module enables multiple users to use different check sequences. It
extends the OCA account sequence option module to support per-user check
numbering.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Configuration
=============

Go to Accounting / Configuration / Accounting / Journals.

- Under the Outgoing Payments tab, disable the Manual Numbering checkbox
on the journal form.

Usage
=====

Go to *Settings / Technical / Sequences & Identifiers / Manage Sequence
Options*.

- Create an entry for the Account Payment module.
- Set the desired rule and sequence.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/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/OCA/account-financial-tools/issues/new?body=module:%20account_check_printing_sequence_option%0Aversion:%2019.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
-------

* ForgeFlow

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

- Isabel Andreu <isabel.andreu@forgeflow.com>

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

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/19.0/account_check_printing_sequence_option>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions account_check_printing_sequence_option/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions account_check_printing_sequence_option/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2026 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Check Printing Sequence Option",
"summary": "Check printing number with multiple sequences",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "ForgeFlow,Odoo Community Association (OCA)",
"development_status": "Alpha",
"website": "https://github.com/OCA/account-financial-tools",
"category": "Accounting",
"depends": ["account_sequence_option", "account_check_printing"],
"data": [],
"installable": True,
}
2 changes: 2 additions & 0 deletions account_check_printing_sequence_option/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import account_payment
from . import sequence_option
72 changes: 72 additions & 0 deletions account_check_printing_sequence_option/models/account_payment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copyright 2026 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models


class AccountPayment(models.Model):
_inherit = "account.payment"

@api.depends("journal_id", "payment_method_code")
def _compute_check_number(self):
options = self.env["ir.sequence.option.line"].get_model_options(self._name)

payment_sequence_map = {}
for pay in self:
if (
pay.payment_method_code == "check_printing"
and not pay.journal_id.check_manual_sequencing
):
sequence = self.env["ir.sequence.option.line"].get_sequence(
pay, options=options
)
if sequence:
payment_sequence_map[pay] = sequence

for pay, sequence in payment_sequence_map.items():
pay.check_number = sequence.get_next_char(sequence.number_next_actual)

payments_without_sequence = self.filtered(
lambda p: p not in payment_sequence_map
)
if payments_without_sequence:
super(AccountPayment, payments_without_sequence)._compute_check_number()
return

def print_checks(self):
res = super().print_checks()
if isinstance(res, dict):
options = self.env["ir.sequence.option.line"].get_model_options(self._name)

payment_sequence_map = {}
for payment in self:
sequence = self.env["ir.sequence.option.line"].get_sequence(
payment, options=options
)
if sequence:
payment_sequence_map[payment] = sequence

if payment_sequence_map:
for payment, sequence in payment_sequence_map.items():
payment.check_number = sequence.next_by_id()

payments_with_sequence = self.filtered(
lambda r: r in payment_sequence_map
)
payments_with_sequence.filtered(
lambda r: r.state == "draft"
).action_post()

return payments_with_sequence.do_print_checks()
return res

def _check_build_page_info(self, i, p):
page = super()._check_build_page_info(i, p)

options = self.env["ir.sequence.option.line"].get_model_options(self._name)
sequence = self.env["ir.sequence.option.line"].get_sequence(
self, options=options
)
if sequence:
page["manual_sequencing"] = True

return page
13 changes: 13 additions & 0 deletions account_check_printing_sequence_option/models/sequence_option.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2026 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class IrSequenceOption(models.Model):
_inherit = "ir.sequence.option"

model = fields.Selection(
selection_add=[("account.payment", "account.payment")],
ondelete={"account.payment": "cascade"},
)
3 changes: 3 additions & 0 deletions account_check_printing_sequence_option/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions account_check_printing_sequence_option/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Go to Accounting / Configuration / Accounting / Journals.

- Under the Outgoing Payments tab, disable the Manual Numbering checkbox on the journal form.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Isabel Andreu \<<isabel.andreu@forgeflow.com>\>
2 changes: 2 additions & 0 deletions account_check_printing_sequence_option/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module enables multiple users to use different check sequences.
It extends the OCA account sequence option module to support per-user check numbering.
4 changes: 4 additions & 0 deletions account_check_printing_sequence_option/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Go to *Settings / Technical / Sequences & Identifiers / Manage Sequence Options*.

- Create an entry for the Account Payment module.
- Set the desired rule and sequence.
Loading
Loading