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
76 changes: 76 additions & 0 deletions account_credit_control_queue_job/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================
Account Credit Control
======================

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

.. |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/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%2Fcredit--control-lightgray.png?logo=github
:target: https://github.com/OCA/credit-control/tree/19.0/account_credit_control_queue_job
:alt: OCA/credit-control
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/credit-control-19-0/credit-control-19-0-account_credit_control_queue_job
: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/credit-control&target_branch=19.0
:alt: Try me on Runboat

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

Once this module is installed, the emails will be sent in individual
jobs.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/credit-control/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/credit-control/issues/new?body=module:%20account_credit_control_queue_job%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
-------

* 360 ERP

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/credit-control <https://github.com/OCA/credit-control/tree/19.0/account_credit_control_queue_job>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions account_credit_control_queue_job/__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).
from . import models
from . import wizard
19 changes: 19 additions & 0 deletions account_credit_control_queue_job/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2025 360ERP (<https://www.360erp.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Credit Control",
"version": "19.0.1.0.0",
"author": "360 ERP, Odoo Community Association (OCA)",
"category": "Finance",
"depends": [
"account_credit_control",
"queue_job_batch",
],
"website": "https://github.com/OCA/credit-control",
"data": ["wizard/res_config_settings.xml"],
"installable": True,
"auto_install": False,
"license": "AGPL-3",
"application": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_credit_control_queue_job
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \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: account_credit_control_queue_job
#: model:ir.model.fields,field_description:account_credit_control_queue_job.field_res_config_settings__credit_control_batch_size
msgid "Batch Size for Credit Control"
msgstr ""

#. module: account_credit_control_queue_job
#: model:ir.model,name:account_credit_control_queue_job.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_communication.py:0
msgid "Credit Control Emails"
msgstr ""

#. module: account_credit_control_queue_job
#: model:ir.model,name:account_credit_control_queue_job.model_credit_control_run
msgid "Credit control line generator"
msgstr ""

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_run.py:0
msgid "Jobs enqueued"
msgstr ""

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_communication.py:0
msgid "Sending credit control email for %s"
msgstr ""

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_communication.py:0
msgid "Sending credit control emails for ids: %s"
msgstr ""

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_run.py:0
msgid "The emails will be sent in the background"
msgstr ""

#. module: account_credit_control_queue_job
#: model:ir.model,name:account_credit_control_queue_job.model_credit_control_communication
msgid "credit control communication"
msgstr ""
67 changes: 67 additions & 0 deletions account_credit_control_queue_job/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_credit_control_queue_job
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-08-16 11:07+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: account_credit_control_queue_job
#: model:ir.model.fields,field_description:account_credit_control_queue_job.field_res_config_settings__credit_control_batch_size
msgid "Batch Size for Credit Control"
msgstr "Dimensione raggruppamento per il controllo del credito"

#. module: account_credit_control_queue_job
#: model:ir.model,name:account_credit_control_queue_job.model_res_config_settings
msgid "Config Settings"
msgstr "Impostazioni configurazione"

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_communication.py:0
msgid "Credit Control Emails"
msgstr "E-mail controllo credito"

#. module: account_credit_control_queue_job
#: model:ir.model,name:account_credit_control_queue_job.model_credit_control_run
msgid "Credit control line generator"
msgstr "Generatore riga controllo credito"

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_run.py:0
msgid "Jobs enqueued"
msgstr "Lavori accodati"

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_communication.py:0
msgid "Sending credit control email for %s"
msgstr "Spedizione e-mail controllo credito per %s"

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_communication.py:0
msgid "Sending credit control emails for ids: %s"
msgstr "Spedizione controllo credito per ID: %s"

#. module: account_credit_control_queue_job
#. odoo-python
#: code:addons/account_credit_control_queue_job/models/credit_control_run.py:0
msgid "The emails will be sent in the background"
msgstr "Questa e-mail verrà spedita in background"

#. module: account_credit_control_queue_job
#: model:ir.model,name:account_credit_control_queue_job.model_credit_control_communication
msgid "credit control communication"
msgstr "comunicazione controllo credito"
3 changes: 3 additions & 0 deletions account_credit_control_queue_job/models/__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).
from . import credit_control_communication
from . import credit_control_run
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2025 360ERP (<https://www.360erp.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models
from odoo.tools import split_every


class CreditControlCommunication(models.Model):
_inherit = "credit.control.communication"

def _send_mails(self):
key = "account_credit_control_queue_job.batch_size"
batch_size = self.env["ir.config_parameter"].sudo().get_param(key)
try:
batch_size = max(1, int(batch_size))
except Exception: # pylint: disable=broad-except
batch_size = 1
batch_name = self.env._("Credit Control Emails")
batch = self.env["queue.job.batch"].get_new_batch(batch_name)
for comms in split_every(batch_size, self.ids, self.browse):
if batch_size > 1:
desc = (
self.env._("Sending credit control emails for ids: %s"),
comms.ids,
)
else:
desc = (
self.env._("Sending credit control email for %s"),
comms.partner_id.name,
)
comms.with_context(job_batch=batch).with_delay(
description=desc
)._send_communications_by_email()
19 changes: 19 additions & 0 deletions account_credit_control_queue_job/models/credit_control_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2025 360ERP (<https://www.360erp.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class CreditControlRun(models.Model):
_inherit = "credit.control.run"

def run_channel_action(self):
res = super().run_channel_action()
target = self.env.user.partner_id
msg = {
"type": "info",
"title": self.env._("Jobs enqueued"),
"message": self.env._("The emails will be sent in the background"),
}
self.env["bus.bus"]._sendone(target, "simple_notification", msg)
return res
3 changes: 3 additions & 0 deletions account_credit_control_queue_job/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions account_credit_control_queue_job/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Once this module is installed, the emails will be sent in individual jobs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading