From 0775d2e9e6819e64f09c33fb0062faf43f069e91 Mon Sep 17 00:00:00 2001
From: Morita Shinnosuke
Date: Mon, 6 Apr 2026 07:00:30 +0000
Subject: [PATCH 1/2] [6456][ADD] account_billing_target_month
---
account_billing_target_month/README.rst | 62 +++
account_billing_target_month/__init__.py | 4 +
account_billing_target_month/__manifest__.py | 17 +
account_billing_target_month/i18n/ja.po | 87 ++++
.../models/__init__.py | 4 +
.../models/account_billing.py | 36 ++
account_billing_target_month/pyproject.toml | 3 +
.../readme/DESCRIPTION.md | 8 +
.../report_summary_invoice_templates.xml | 11 +
.../static/description/index.html | 414 ++++++++++++++++++
.../tests/__init__.py | 1 +
.../test_account_billing_target_month.py | 30 ++
.../views/account_billing_views.xml | 36 ++
13 files changed, 713 insertions(+)
create mode 100644 account_billing_target_month/README.rst
create mode 100644 account_billing_target_month/__init__.py
create mode 100644 account_billing_target_month/__manifest__.py
create mode 100644 account_billing_target_month/i18n/ja.po
create mode 100644 account_billing_target_month/models/__init__.py
create mode 100644 account_billing_target_month/models/account_billing.py
create mode 100644 account_billing_target_month/pyproject.toml
create mode 100644 account_billing_target_month/readme/DESCRIPTION.md
create mode 100644 account_billing_target_month/reports/report_summary_invoice_templates.xml
create mode 100644 account_billing_target_month/static/description/index.html
create mode 100644 account_billing_target_month/tests/__init__.py
create mode 100644 account_billing_target_month/tests/test_account_billing_target_month.py
create mode 100644 account_billing_target_month/views/account_billing_views.xml
diff --git a/account_billing_target_month/README.rst b/account_billing_target_month/README.rst
new file mode 100644
index 00000000..a25d14a3
--- /dev/null
+++ b/account_billing_target_month/README.rst
@@ -0,0 +1,62 @@
+============================
+Account Billing Target Month
+============================
+
+..
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! source digest: sha256:4727c2352f1c1afcefee757106fa4dbd50bec366643c764c8dd6ed5ec3172e99
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |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-qrtl%2Fhls--custom-lightgray.png?logo=github
+ :target: https://github.com/qrtl/hls-custom/tree/18.0/account_billing_target_month
+ :alt: qrtl/hls-custom
+
+|badge1| |badge2| |badge3|
+
+This module extends ``l10n_jp_summary_invoice`` to add a **Target
+Month** field to the billing document, computed automatically from the
+threshold date. If the threshold date falls on the last day of the
+month, the target month is set to the following month; otherwise it is
+set to the same month as the threshold date.
+
+The target month is also displayed as a prefix in the summary invoice
+PDF title (e.g. "3 Summary Invoice").
+
+**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
+-------
+
+* Quartile
+
+Maintainers
+-----------
+
+This module is part of the `qrtl/hls-custom `_ project on GitHub.
+
+You are welcome to contribute.
diff --git a/account_billing_target_month/__init__.py b/account_billing_target_month/__init__.py
new file mode 100644
index 00000000..5b9da0c1
--- /dev/null
+++ b/account_billing_target_month/__init__.py
@@ -0,0 +1,4 @@
+# Copyright 2026 Quartile
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+
+from . import models
diff --git a/account_billing_target_month/__manifest__.py b/account_billing_target_month/__manifest__.py
new file mode 100644
index 00000000..b16ae712
--- /dev/null
+++ b/account_billing_target_month/__manifest__.py
@@ -0,0 +1,17 @@
+# Copyright 2026 Quartile
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+
+{
+ "name": "Account Billing Target Month",
+ "version": "18.0.1.0.0",
+ "author": "Quartile",
+ "website": "https://www.quartile.co",
+ "category": "Invoice",
+ "license": "AGPL-3",
+ "depends": ["l10n_jp_summary_invoice"],
+ "data": [
+ "views/account_billing_views.xml",
+ "reports/report_summary_invoice_templates.xml",
+ ],
+ "installable": True,
+}
diff --git a/account_billing_target_month/i18n/ja.po b/account_billing_target_month/i18n/ja.po
new file mode 100644
index 00000000..d6a2a553
--- /dev/null
+++ b/account_billing_target_month/i18n/ja.po
@@ -0,0 +1,87 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_billing_target_month
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 18.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2026-04-01 03:54+0000\n"
+"PO-Revision-Date: 2026-04-01 03:54+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: account_billing_target_month
+#: model:ir.model,name:account_billing_target_month.model_account_billing
+msgid "Account Billing"
+msgstr "合計請求書"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__4
+msgid "April"
+msgstr "4月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__8
+msgid "August"
+msgstr "8月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__12
+msgid "December"
+msgstr "12月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__2
+msgid "February"
+msgstr "2月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__1
+msgid "January"
+msgstr "1月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__7
+msgid "July"
+msgstr "7月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__6
+msgid "June"
+msgstr "6月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__3
+msgid "March"
+msgstr "3月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__5
+msgid "May"
+msgstr "5月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__11
+msgid "November"
+msgstr "11月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__10
+msgid "October"
+msgstr "10月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields.selection,name:account_billing_target_month.selection__account_billing__target_month__9
+msgid "September"
+msgstr "9月"
+
+#. module: account_billing_target_month
+#: model:ir.model.fields,field_description:account_billing_target_month.field_account_billing__target_month
+#: model_terms:ir.ui.view,arch_db:account_billing_target_month.report_summary_invoice_document
+msgid "Target Month"
+msgstr "対象月"
diff --git a/account_billing_target_month/models/__init__.py b/account_billing_target_month/models/__init__.py
new file mode 100644
index 00000000..23902420
--- /dev/null
+++ b/account_billing_target_month/models/__init__.py
@@ -0,0 +1,4 @@
+# Copyright 2026 Quartile
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+
+from . import account_billing
diff --git a/account_billing_target_month/models/account_billing.py b/account_billing_target_month/models/account_billing.py
new file mode 100644
index 00000000..3c0eeabf
--- /dev/null
+++ b/account_billing_target_month/models/account_billing.py
@@ -0,0 +1,36 @@
+# Copyright 2026 Quartile
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+
+from odoo import api, fields, models
+
+
+class AccountBilling(models.Model):
+ _inherit = "account.billing"
+
+ target_month = fields.Selection(
+ selection=[
+ ("1", "January"),
+ ("2", "February"),
+ ("3", "March"),
+ ("4", "April"),
+ ("5", "May"),
+ ("6", "June"),
+ ("7", "July"),
+ ("8", "August"),
+ ("9", "September"),
+ ("10", "October"),
+ ("11", "November"),
+ ("12", "December"),
+ ],
+ compute="_compute_target_month",
+ store=True,
+ readonly=False,
+ )
+
+ @api.depends("threshold_date")
+ def _compute_target_month(self):
+ for rec in self:
+ if not rec.threshold_date:
+ rec.target_month = False
+ continue
+ rec.target_month = str(rec.threshold_date.month)
diff --git a/account_billing_target_month/pyproject.toml b/account_billing_target_month/pyproject.toml
new file mode 100644
index 00000000..4231d0cc
--- /dev/null
+++ b/account_billing_target_month/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["whool"]
+build-backend = "whool.buildapi"
diff --git a/account_billing_target_month/readme/DESCRIPTION.md b/account_billing_target_month/readme/DESCRIPTION.md
new file mode 100644
index 00000000..1c0f1d4d
--- /dev/null
+++ b/account_billing_target_month/readme/DESCRIPTION.md
@@ -0,0 +1,8 @@
+This module extends `l10n_jp_summary_invoice` to add a **Target Month**
+field to the billing document, computed automatically from the threshold
+date. If the threshold date falls on the last day of the month, the target
+month is set to the following month; otherwise it is set to the same month
+as the threshold date.
+
+The target month is also displayed as a prefix in the summary invoice PDF
+title (e.g. "3 Summary Invoice").
diff --git a/account_billing_target_month/reports/report_summary_invoice_templates.xml b/account_billing_target_month/reports/report_summary_invoice_templates.xml
new file mode 100644
index 00000000..338f8a97
--- /dev/null
+++ b/account_billing_target_month/reports/report_summary_invoice_templates.xml
@@ -0,0 +1,11 @@
+
+
+
+
+ Target Month
+
+
+
diff --git a/account_billing_target_month/static/description/index.html b/account_billing_target_month/static/description/index.html
new file mode 100644
index 00000000..c735c0d5
--- /dev/null
+++ b/account_billing_target_month/static/description/index.html
@@ -0,0 +1,414 @@
+
+
+
+
+
+Account Billing Target Month
+
+
+
+
+
Account Billing Target Month
+
+
+

+
This module extends l10n_jp_summary_invoice to add a Target
+Month field to the billing document, computed automatically from the
+threshold date. If the threshold date falls on the last day of the
+month, the target month is set to the following month; otherwise it is
+set to the same month as the threshold date.
+
The target month is also displayed as a prefix in the summary invoice
+PDF title (e.g. “3 Summary Invoice”).
+
Table of contents
+
+
+
+
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.
+
+
+
+
+
+
+
This module is part of the qrtl/hls-custom project on GitHub.
+
You are welcome to contribute.
+
+
+
+
+
diff --git a/account_billing_target_month/tests/__init__.py b/account_billing_target_month/tests/__init__.py
new file mode 100644
index 00000000..c75d690b
--- /dev/null
+++ b/account_billing_target_month/tests/__init__.py
@@ -0,0 +1 @@
+from . import test_account_billing_target_month
diff --git a/account_billing_target_month/tests/test_account_billing_target_month.py b/account_billing_target_month/tests/test_account_billing_target_month.py
new file mode 100644
index 00000000..c3273989
--- /dev/null
+++ b/account_billing_target_month/tests/test_account_billing_target_month.py
@@ -0,0 +1,30 @@
+# Copyright 2026 Quartile
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+
+from datetime import date
+
+from odoo.tests.common import TransactionCase
+
+
+class TestAccountBillingTargetMonth(TransactionCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.partner = cls.env["res.partner"].create({"name": "Test Partner"})
+ cls.billing = cls.env["account.billing"].create(
+ {
+ "partner_id": cls.partner.id,
+ "threshold_date": date(2026, 3, 15),
+ }
+ )
+
+ def test_target_month(self):
+ # Mid-month: same month
+ self.billing.threshold_date = date(2026, 3, 15)
+ self.assertEqual(self.billing.target_month, "3")
+ # Last day of month: same month
+ self.billing.threshold_date = date(2026, 3, 31)
+ self.assertEqual(self.billing.target_month, "3")
+ # Last day of December: same month
+ self.billing.threshold_date = date(2026, 12, 31)
+ self.assertEqual(self.billing.target_month, "12")
diff --git a/account_billing_target_month/views/account_billing_views.xml b/account_billing_target_month/views/account_billing_views.xml
new file mode 100644
index 00000000..c0e230e1
--- /dev/null
+++ b/account_billing_target_month/views/account_billing_views.xml
@@ -0,0 +1,36 @@
+
+
+
+ account.billing.form
+ account.billing
+
+
+
+
+
+
+
+
+ account.billing.list
+ account.billing
+
+
+
+
+
+
+
+
+ account.supplier.billing.list
+ account.billing
+
+
+
+
+
+
+
+
From 9d5100e0b8526e9cc7582122e62a643de13a2816 Mon Sep 17 00:00:00 2001
From: Morita Shinnosuke
Date: Fri, 10 Apr 2026 07:49:22 +0000
Subject: [PATCH 2/2] reflect reviews
---
account_billing_target_month/README.rst | 6 ++----
account_billing_target_month/i18n/ja.po | 2 +-
account_billing_target_month/models/account_billing.py | 3 ---
account_billing_target_month/readme/DESCRIPTION.md | 6 ++----
.../static/description/index.html | 6 ++----
.../tests/test_account_billing_target_month.py | 8 --------
6 files changed, 7 insertions(+), 24 deletions(-)
diff --git a/account_billing_target_month/README.rst b/account_billing_target_month/README.rst
index a25d14a3..846a13d6 100644
--- a/account_billing_target_month/README.rst
+++ b/account_billing_target_month/README.rst
@@ -23,10 +23,8 @@ Account Billing Target Month
|badge1| |badge2| |badge3|
This module extends ``l10n_jp_summary_invoice`` to add a **Target
-Month** field to the billing document, computed automatically from the
-threshold date. If the threshold date falls on the last day of the
-month, the target month is set to the following month; otherwise it is
-set to the same month as the threshold date.
+Month** field to the billing document, derived from the month of the
+threshold date.
The target month is also displayed as a prefix in the summary invoice
PDF title (e.g. "3 Summary Invoice").
diff --git a/account_billing_target_month/i18n/ja.po b/account_billing_target_month/i18n/ja.po
index d6a2a553..b8c80471 100644
--- a/account_billing_target_month/i18n/ja.po
+++ b/account_billing_target_month/i18n/ja.po
@@ -84,4 +84,4 @@ msgstr "9月"
#: model:ir.model.fields,field_description:account_billing_target_month.field_account_billing__target_month
#: model_terms:ir.ui.view,arch_db:account_billing_target_month.report_summary_invoice_document
msgid "Target Month"
-msgstr "対象月"
+msgstr "月分"
diff --git a/account_billing_target_month/models/account_billing.py b/account_billing_target_month/models/account_billing.py
index 3c0eeabf..d9175eb2 100644
--- a/account_billing_target_month/models/account_billing.py
+++ b/account_billing_target_month/models/account_billing.py
@@ -30,7 +30,4 @@ class AccountBilling(models.Model):
@api.depends("threshold_date")
def _compute_target_month(self):
for rec in self:
- if not rec.threshold_date:
- rec.target_month = False
- continue
rec.target_month = str(rec.threshold_date.month)
diff --git a/account_billing_target_month/readme/DESCRIPTION.md b/account_billing_target_month/readme/DESCRIPTION.md
index 1c0f1d4d..e4942495 100644
--- a/account_billing_target_month/readme/DESCRIPTION.md
+++ b/account_billing_target_month/readme/DESCRIPTION.md
@@ -1,8 +1,6 @@
This module extends `l10n_jp_summary_invoice` to add a **Target Month**
-field to the billing document, computed automatically from the threshold
-date. If the threshold date falls on the last day of the month, the target
-month is set to the following month; otherwise it is set to the same month
-as the threshold date.
+field to the billing document, derived from the month
+of the threshold date.
The target month is also displayed as a prefix in the summary invoice PDF
title (e.g. "3 Summary Invoice").
diff --git a/account_billing_target_month/static/description/index.html b/account_billing_target_month/static/description/index.html
index c735c0d5..02fc637e 100644
--- a/account_billing_target_month/static/description/index.html
+++ b/account_billing_target_month/static/description/index.html
@@ -370,10 +370,8 @@ Account Billing Target Month
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

This module extends l10n_jp_summary_invoice to add a Target
-Month field to the billing document, computed automatically from the
-threshold date. If the threshold date falls on the last day of the
-month, the target month is set to the following month; otherwise it is
-set to the same month as the threshold date.
+Month field to the billing document, derived from the month of the
+threshold date.
The target month is also displayed as a prefix in the summary invoice
PDF title (e.g. “3 Summary Invoice”).
Table of contents
diff --git a/account_billing_target_month/tests/test_account_billing_target_month.py b/account_billing_target_month/tests/test_account_billing_target_month.py
index c3273989..10f85972 100644
--- a/account_billing_target_month/tests/test_account_billing_target_month.py
+++ b/account_billing_target_month/tests/test_account_billing_target_month.py
@@ -19,12 +19,4 @@ def setUpClass(cls):
)
def test_target_month(self):
- # Mid-month: same month
- self.billing.threshold_date = date(2026, 3, 15)
self.assertEqual(self.billing.target_month, "3")
- # Last day of month: same month
- self.billing.threshold_date = date(2026, 3, 31)
- self.assertEqual(self.billing.target_month, "3")
- # Last day of December: same month
- self.billing.threshold_date = date(2026, 12, 31)
- self.assertEqual(self.billing.target_month, "12")