From 21f8eaab6dbd7b96789c346f05e068a191a02b15 Mon Sep 17 00:00:00 2001 From: Morita Shinnosuke Date: Fri, 3 Jul 2026 03:26:50 +0000 Subject: [PATCH 01/12] [ADD] maintenance_equipment_additional_attributes: add specific attributes to maintenance equipment Extend maintenance.equipment with RBKK-specific attributes: set name, general name (master), national project (master), fixed asset flag/code, GMP flag with function and category, measuring instrument flag, location in use (stock.location), manufacturer and acquisition date. task-6788 --- .../README.rst | 70 +++ .../__init__.py | 1 + .../__manifest__.py | 20 + .../i18n/ja.po | 168 +++++++ .../models/__init__.py | 3 + .../models/maintenance_equipment.py | 45 ++ .../maintenance_equipment_generic_name.py | 13 + .../maintenance_equipment_national_project.py | 13 + .../pyproject.toml | 3 + .../readme/CONTRIBUTORS.md | 2 + .../readme/DESCRIPTION.md | 1 + .../security/ir.model.access.csv | 5 + .../static/description/index.html | 420 ++++++++++++++++++ ...intenance_equipment_generic_name_views.xml | 18 + ...nance_equipment_national_project_views.xml | 18 + .../views/maintenance_equipment_views.xml | 37 ++ 16 files changed, 837 insertions(+) create mode 100644 maintenance_equipment_additional_attributes/README.rst create mode 100644 maintenance_equipment_additional_attributes/__init__.py create mode 100644 maintenance_equipment_additional_attributes/__manifest__.py create mode 100644 maintenance_equipment_additional_attributes/i18n/ja.po create mode 100644 maintenance_equipment_additional_attributes/models/__init__.py create mode 100644 maintenance_equipment_additional_attributes/models/maintenance_equipment.py create mode 100644 maintenance_equipment_additional_attributes/models/maintenance_equipment_generic_name.py create mode 100644 maintenance_equipment_additional_attributes/models/maintenance_equipment_national_project.py create mode 100644 maintenance_equipment_additional_attributes/pyproject.toml create mode 100644 maintenance_equipment_additional_attributes/readme/CONTRIBUTORS.md create mode 100644 maintenance_equipment_additional_attributes/readme/DESCRIPTION.md create mode 100644 maintenance_equipment_additional_attributes/security/ir.model.access.csv create mode 100644 maintenance_equipment_additional_attributes/static/description/index.html create mode 100644 maintenance_equipment_additional_attributes/views/maintenance_equipment_generic_name_views.xml create mode 100644 maintenance_equipment_additional_attributes/views/maintenance_equipment_national_project_views.xml create mode 100644 maintenance_equipment_additional_attributes/views/maintenance_equipment_views.xml diff --git a/maintenance_equipment_additional_attributes/README.rst b/maintenance_equipment_additional_attributes/README.rst new file mode 100644 index 0000000..de75b33 --- /dev/null +++ b/maintenance_equipment_additional_attributes/README.rst @@ -0,0 +1,70 @@ +=========================================== +Maintenance Equipment Additional Attributes +=========================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:9ad8f78c23a6c682f1dc686a0c7b9fc4e4885d1c9967f504a0d169a91af62026 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Frbkk--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/rbkk-custom/tree/18.0/maintenance_equipment_additional_attributes + :alt: qrtl/rbkk-custom + +|badge1| |badge2| |badge3| + +This module adds attributes to maintenance equipment. + +**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 + +Contributors +------------ + +- `Quartile `__: + + - Shinnosuke Morita + +Maintainers +----------- + +.. |maintainer-smorita7749| image:: https://github.com/smorita7749.png?size=40px + :target: https://github.com/smorita7749 + :alt: smorita7749 + +Current maintainer: + +|maintainer-smorita7749| + +This module is part of the `qrtl/rbkk-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/maintenance_equipment_additional_attributes/__init__.py b/maintenance_equipment_additional_attributes/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/maintenance_equipment_additional_attributes/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/maintenance_equipment_additional_attributes/__manifest__.py b/maintenance_equipment_additional_attributes/__manifest__.py new file mode 100644 index 0000000..8100351 --- /dev/null +++ b/maintenance_equipment_additional_attributes/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +{ + "name": "Maintenance Equipment Additional Attributes", + "version": "18.0.1.0.0", + "category": "Maintenance", + "summary": "Add specific attributes to maintenance equipment", + "author": "Quartile", + "website": "https://www.quartile.co", + "maintainers": ["smorita7749"], + "license": "LGPL-3", + "depends": ["maintenance", "stock"], + "data": [ + "security/ir.model.access.csv", + "views/maintenance_equipment_generic_name_views.xml", + "views/maintenance_equipment_national_project_views.xml", + "views/maintenance_equipment_views.xml", + ], + "installable": True, +} diff --git a/maintenance_equipment_additional_attributes/i18n/ja.po b/maintenance_equipment_additional_attributes/i18n/ja.po new file mode 100644 index 0000000..f527c74 --- /dev/null +++ b/maintenance_equipment_additional_attributes/i18n/ja.po @@ -0,0 +1,168 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * maintenance_equipment_additional_attributes +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-07-03 03:10+0000\n" +"PO-Revision-Date: 2026-07-03 03:10+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: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__acquisition_date +msgid "Acquisition Date" +msgstr "取得年月日" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_generic_name__active +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_national_project__active +msgid "Active" +msgstr "有効" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_generic_name__create_uid +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_national_project__create_uid +msgid "Created by" +msgstr "作成者" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_generic_name__create_date +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_national_project__create_date +msgid "Created on" +msgstr "作成日" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_generic_name__display_name +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_national_project__display_name +msgid "Display Name" +msgstr "表示名" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__is_fixed_asset +msgid "Fixed Asset" +msgstr "固定資産" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__fixed_asset_code +msgid "Fixed Asset Code" +msgstr "固定資産コード" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__is_gmp +msgid "GMP" +msgstr "GMP" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__gmp_category +msgid "GMP Category" +msgstr "GMPカテゴリ" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__gmp_function +msgid "GMP Function" +msgstr "GMP機能" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__generic_name_id +msgid "General Name" +msgstr "一般名称" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.actions.act_window,name:maintenance_equipment_additional_attributes.maintenance_equipment_generic_name_action +#: model:ir.ui.menu,name:maintenance_equipment_additional_attributes.menu_maintenance_equipment_generic_name +msgid "General Names" +msgstr "一般名称" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_generic_name__id +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_national_project__id +msgid "ID" +msgstr "ID" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_generic_name__write_uid +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_national_project__write_uid +msgid "Last Updated by" +msgstr "最終更新者" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_generic_name__write_date +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_national_project__write_date +msgid "Last Updated on" +msgstr "最終更新日" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model,name:maintenance_equipment_additional_attributes.model_maintenance_equipment +msgid "Maintenance Equipment" +msgstr "整備設備" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model,name:maintenance_equipment_additional_attributes.model_maintenance_equipment_generic_name +msgid "Maintenance Equipment General Name" +msgstr "整備設備一般名称" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model,name:maintenance_equipment_additional_attributes.model_maintenance_equipment_national_project +msgid "Maintenance Equipment National Project" +msgstr "整備設備国家プロジェクト" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__manufacturer +msgid "Manufacturer" +msgstr "メーカー" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields.selection,name:maintenance_equipment_additional_attributes.selection__maintenance_equipment__gmp_function__manufacturing +msgid "Manufacturing" +msgstr "製造" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__is_measuring_instrument +msgid "Measuring Instrument" +msgstr "測定器" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_generic_name__name +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_national_project__name +msgid "Name" +msgstr "名称" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__national_project_id +msgid "National Project ID" +msgstr "国家プロジェクトID" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.actions.act_window,name:maintenance_equipment_additional_attributes.maintenance_equipment_national_project_action +#: model:ir.ui.menu,name:maintenance_equipment_additional_attributes.menu_maintenance_equipment_national_project +msgid "National Projects" +msgstr "国家プロジェクト" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields.selection,name:maintenance_equipment_additional_attributes.selection__maintenance_equipment__gmp_function__qc +msgid "QC" +msgstr "QC" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__set_name +msgid "Set Name" +msgstr "セット名称" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__smart_search +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_generic_name__smart_search +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment_national_project__smart_search +msgid "Smart Search" +msgstr "スマート検索" + +#. module: maintenance_equipment_additional_attributes +#: model:ir.model.fields,field_description:maintenance_equipment_additional_attributes.field_maintenance_equipment__location_id +msgid "Used in location" +msgstr "使用場所" diff --git a/maintenance_equipment_additional_attributes/models/__init__.py b/maintenance_equipment_additional_attributes/models/__init__.py new file mode 100644 index 0000000..094930b --- /dev/null +++ b/maintenance_equipment_additional_attributes/models/__init__.py @@ -0,0 +1,3 @@ +from . import maintenance_equipment_generic_name +from . import maintenance_equipment_national_project +from . import maintenance_equipment diff --git a/maintenance_equipment_additional_attributes/models/maintenance_equipment.py b/maintenance_equipment_additional_attributes/models/maintenance_equipment.py new file mode 100644 index 0000000..9a4dfac --- /dev/null +++ b/maintenance_equipment_additional_attributes/models/maintenance_equipment.py @@ -0,0 +1,45 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class MaintenanceEquipment(models.Model): + _inherit = "maintenance.equipment" + + set_name = fields.Char() + generic_name_id = fields.Many2one( + comodel_name="maintenance.equipment.generic.name", + string="General Name", + ) + is_fixed_asset = fields.Boolean(string="Fixed Asset") + fixed_asset_code = fields.Char() + is_gmp = fields.Boolean(string="GMP") + gmp_function = fields.Selection( + selection=[ + ("manufacturing", "Manufacturing"), + ("qc", "QC"), + ], + string="GMP Function", + ) + gmp_category = fields.Selection( + selection=[ + ("a", "A"), + ("b", "B"), + ("c", "C"), + ], + string="GMP Category", + ) + is_measuring_instrument = fields.Boolean(string="Measuring Instrument") + national_project_id = fields.Many2one( + comodel_name="maintenance.equipment.national.project", + string="National Project ID", + ) + location_id = fields.Many2one( + comodel_name="stock.location", + string="Used in location", + domain="[('usage', '=', 'internal')]", + tracking=True, + ) + manufacturer = fields.Char() + acquisition_date = fields.Date() diff --git a/maintenance_equipment_additional_attributes/models/maintenance_equipment_generic_name.py b/maintenance_equipment_additional_attributes/models/maintenance_equipment_generic_name.py new file mode 100644 index 0000000..7e1f882 --- /dev/null +++ b/maintenance_equipment_additional_attributes/models/maintenance_equipment_generic_name.py @@ -0,0 +1,13 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class MaintenanceEquipmentGenericName(models.Model): + _name = "maintenance.equipment.generic.name" + _description = "Maintenance Equipment General Name" + _order = "name" + + name = fields.Char(required=True) + active = fields.Boolean(default=True) diff --git a/maintenance_equipment_additional_attributes/models/maintenance_equipment_national_project.py b/maintenance_equipment_additional_attributes/models/maintenance_equipment_national_project.py new file mode 100644 index 0000000..ebb78f7 --- /dev/null +++ b/maintenance_equipment_additional_attributes/models/maintenance_equipment_national_project.py @@ -0,0 +1,13 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class MaintenanceEquipmentNationalProject(models.Model): + _name = "maintenance.equipment.national.project" + _description = "Maintenance Equipment National Project" + _order = "name" + + name = fields.Char(required=True, translate=True) + active = fields.Boolean(default=True) diff --git a/maintenance_equipment_additional_attributes/pyproject.toml b/maintenance_equipment_additional_attributes/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/maintenance_equipment_additional_attributes/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/maintenance_equipment_additional_attributes/readme/CONTRIBUTORS.md b/maintenance_equipment_additional_attributes/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..260160c --- /dev/null +++ b/maintenance_equipment_additional_attributes/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [Quartile](https://www.quartile.co): + - Shinnosuke Morita diff --git a/maintenance_equipment_additional_attributes/readme/DESCRIPTION.md b/maintenance_equipment_additional_attributes/readme/DESCRIPTION.md new file mode 100644 index 0000000..c35cff6 --- /dev/null +++ b/maintenance_equipment_additional_attributes/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module adds attributes to maintenance equipment. \ No newline at end of file diff --git a/maintenance_equipment_additional_attributes/security/ir.model.access.csv b/maintenance_equipment_additional_attributes/security/ir.model.access.csv new file mode 100644 index 0000000..7b22b32 --- /dev/null +++ b/maintenance_equipment_additional_attributes/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_maintenance_equipment_generic_name_user,maintenance.equipment.generic.name user,model_maintenance_equipment_generic_name,base.group_user,1,0,0,0 +access_maintenance_equipment_generic_name_manager,maintenance.equipment.generic.name manager,model_maintenance_equipment_generic_name,maintenance.group_equipment_manager,1,1,1,1 +access_maintenance_equipment_national_project_user,maintenance.equipment.national.project user,model_maintenance_equipment_national_project,base.group_user,1,0,0,0 +access_maintenance_equipment_national_project_manager,maintenance.equipment.national.project manager,model_maintenance_equipment_national_project,maintenance.group_equipment_manager,1,1,1,1 diff --git a/maintenance_equipment_additional_attributes/static/description/index.html b/maintenance_equipment_additional_attributes/static/description/index.html new file mode 100644 index 0000000..33d79d7 --- /dev/null +++ b/maintenance_equipment_additional_attributes/static/description/index.html @@ -0,0 +1,420 @@ + + + + + +Maintenance Equipment Additional Attributes + + + +
+

Maintenance Equipment Additional Attributes

+ + +

Beta License: LGPL-3 qrtl/rbkk-custom

+

This module adds attributes to maintenance equipment.

+

Table of contents

+ +
+

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
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

Current maintainer:

+

smorita7749

+

This module is part of the qrtl/rbkk-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/maintenance_equipment_additional_attributes/views/maintenance_equipment_generic_name_views.xml b/maintenance_equipment_additional_attributes/views/maintenance_equipment_generic_name_views.xml new file mode 100644 index 0000000..3475e64 --- /dev/null +++ b/maintenance_equipment_additional_attributes/views/maintenance_equipment_generic_name_views.xml @@ -0,0 +1,18 @@ + + + + General Names + maintenance.equipment.generic.name + list,form + + + diff --git a/maintenance_equipment_additional_attributes/views/maintenance_equipment_national_project_views.xml b/maintenance_equipment_additional_attributes/views/maintenance_equipment_national_project_views.xml new file mode 100644 index 0000000..1f2a403 --- /dev/null +++ b/maintenance_equipment_additional_attributes/views/maintenance_equipment_national_project_views.xml @@ -0,0 +1,18 @@ + + + + National Projects + maintenance.equipment.national.project + list,form + + + diff --git a/maintenance_equipment_additional_attributes/views/maintenance_equipment_views.xml b/maintenance_equipment_additional_attributes/views/maintenance_equipment_views.xml new file mode 100644 index 0000000..a54849f --- /dev/null +++ b/maintenance_equipment_additional_attributes/views/maintenance_equipment_views.xml @@ -0,0 +1,37 @@ + + + + maintenance.equipment.form + maintenance.equipment + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + From fd9a396a277f2bcc3873633b95a2344006134cbe Mon Sep 17 00:00:00 2001 From: Morita Shinnosuke Date: Wed, 15 Jul 2026 05:44:50 +0000 Subject: [PATCH 02/12] [FIX] restore purchase_line_budget and stock_location_report_manager_layout These two modules were dropped by the ours-style merge c2fe042 ("fixup!"), which recorded 54185f3 as a parent but kept only the feature branch tree. Recover them unchanged from 54185f3. --- purchase_line_budget/README.rst | 84 ++++ purchase_line_budget/__init__.py | 1 + purchase_line_budget/__manifest__.py | 18 + purchase_line_budget/data/server_action.xml | 11 + purchase_line_budget/i18n/ja.po | 56 +++ purchase_line_budget/models/__init__.py | 2 + purchase_line_budget/models/analytic_plan.py | 30 ++ .../models/purchase_order_line.py | 27 ++ purchase_line_budget/pyproject.toml | 3 + purchase_line_budget/readme/CONFIGURE.md | 3 + purchase_line_budget/readme/CONTRIBUTORS.md | 2 + purchase_line_budget/readme/DESCRIPTION.md | 4 + purchase_line_budget/readme/USAGE.md | 7 + .../static/description/index.html | 442 +++++++++++++++++ purchase_line_budget/tests/__init__.py | 1 + .../tests/test_purchase_order_line.py | 47 ++ .../views/analytic_plan_views.xml | 13 + .../views/purchase_order_line_views.xml | 31 ++ .../README.rst | 96 ++++ .../__init__.py | 1 + .../__manifest__.py | 17 + .../i18n/ja.po | 31 ++ .../models/__init__.py | 1 + .../models/stock_quant.py | 23 + .../pyproject.toml | 3 + .../readme/CONTRIBUTORS.md | 3 + .../readme/DESCRIPTION.md | 12 + .../readme/USAGE.md | 4 + .../static/description/index.html | 445 ++++++++++++++++++ .../tests/__init__.py | 1 + ...st_stock_location_report_manager_layout.py | 45 ++ .../views/stock_quant_views.xml | 24 + 32 files changed, 1488 insertions(+) create mode 100644 purchase_line_budget/README.rst create mode 100644 purchase_line_budget/__init__.py create mode 100644 purchase_line_budget/__manifest__.py create mode 100644 purchase_line_budget/data/server_action.xml create mode 100644 purchase_line_budget/i18n/ja.po create mode 100644 purchase_line_budget/models/__init__.py create mode 100644 purchase_line_budget/models/analytic_plan.py create mode 100644 purchase_line_budget/models/purchase_order_line.py create mode 100644 purchase_line_budget/pyproject.toml create mode 100644 purchase_line_budget/readme/CONFIGURE.md create mode 100644 purchase_line_budget/readme/CONTRIBUTORS.md create mode 100644 purchase_line_budget/readme/DESCRIPTION.md create mode 100644 purchase_line_budget/readme/USAGE.md create mode 100644 purchase_line_budget/static/description/index.html create mode 100644 purchase_line_budget/tests/__init__.py create mode 100644 purchase_line_budget/tests/test_purchase_order_line.py create mode 100644 purchase_line_budget/views/analytic_plan_views.xml create mode 100644 purchase_line_budget/views/purchase_order_line_views.xml create mode 100644 stock_location_report_manager_layout/README.rst create mode 100644 stock_location_report_manager_layout/__init__.py create mode 100644 stock_location_report_manager_layout/__manifest__.py create mode 100644 stock_location_report_manager_layout/i18n/ja.po create mode 100644 stock_location_report_manager_layout/models/__init__.py create mode 100644 stock_location_report_manager_layout/models/stock_quant.py create mode 100644 stock_location_report_manager_layout/pyproject.toml create mode 100644 stock_location_report_manager_layout/readme/CONTRIBUTORS.md create mode 100644 stock_location_report_manager_layout/readme/DESCRIPTION.md create mode 100644 stock_location_report_manager_layout/readme/USAGE.md create mode 100644 stock_location_report_manager_layout/static/description/index.html create mode 100644 stock_location_report_manager_layout/tests/__init__.py create mode 100644 stock_location_report_manager_layout/tests/test_stock_location_report_manager_layout.py create mode 100644 stock_location_report_manager_layout/views/stock_quant_views.xml diff --git a/purchase_line_budget/README.rst b/purchase_line_budget/README.rst new file mode 100644 index 0000000..7e3f884 --- /dev/null +++ b/purchase_line_budget/README.rst @@ -0,0 +1,84 @@ +==================== +Purchase Line Budget +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d2396235269cb1b0618ef4e01bcf4749a9c3b171db3bdba6362030f0a263f4e0 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Frbkk--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/rbkk-custom/tree/18.0/purchase_line_budget + :alt: qrtl/rbkk-custom + +|badge1| |badge2| |badge3| + +This module adds a stored computed ``Many2one`` field +(``analytic_budget_id``) to purchase order lines. The field extracts the +analytic account belonging to the analytic plan marked for purchase +order lines, enabling grouping and filtering by that account directly on +purchase order lines. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Go to *Invoicing > Configuration > Analytic Accounting > Analytic +Plans*, open the analytic plan to use for purchase order lines, and +enable *Use for Purchase Order Lines Budget*. + +Usage +===== + +To recompute the budget account on existing purchase order lines: + +1. Go to *Settings > Technical > Actions > Server Actions*, find + *Recompute Purchase Line Budget*, and click *Add Context Action*. +2. Go to *Purchase > Orders > Purchase Order Lines*, select the target + lines, and choose *Recompute Purchase Line Budget* from the *Action* + menu. + +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 + +Contributors +------------ + +- `Quartile `__: + + - Toshikimi Shigenobu + +Maintainers +----------- + +This module is part of the `qrtl/rbkk-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/purchase_line_budget/__init__.py b/purchase_line_budget/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/purchase_line_budget/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_line_budget/__manifest__.py b/purchase_line_budget/__manifest__.py new file mode 100644 index 0000000..82c0b75 --- /dev/null +++ b/purchase_line_budget/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Purchase Line Budget", + "version": "18.0.1.0.0", + "category": "Accounting/Accounting", + "summary": "Expose a stored analytic plan account on purchase order lines", + "author": "Quartile", + "website": "https://www.quartile.co", + "license": "AGPL-3", + "depends": ["purchase"], + "data": [ + "data/server_action.xml", + "views/analytic_plan_views.xml", + "views/purchase_order_line_views.xml", + ], + "installable": True, +} diff --git a/purchase_line_budget/data/server_action.xml b/purchase_line_budget/data/server_action.xml new file mode 100644 index 0000000..013dc3f --- /dev/null +++ b/purchase_line_budget/data/server_action.xml @@ -0,0 +1,11 @@ + + + + + Recompute Purchase Line Budget + + code + records._compute_analytic_budget_id() + + diff --git a/purchase_line_budget/i18n/ja.po b/purchase_line_budget/i18n/ja.po new file mode 100644 index 0000000..deb40d0 --- /dev/null +++ b/purchase_line_budget/i18n/ja.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_line_budget +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-06-08 09:30+0000\n" +"PO-Revision-Date: 2026-06-08 09:30+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: purchase_line_budget +#: model:ir.model.fields,field_description:purchase_line_budget.field_purchase_order_line__analytic_budget_id +#: model_terms:ir.ui.view,arch_db:purchase_line_budget.purchase_order_line_search_analytic_plan_account +msgid "Analytic Budget" +msgstr "予算番号" + +#. module: purchase_line_budget +#: model:ir.model,name:purchase_line_budget.model_account_analytic_plan +msgid "Analytic Plans" +msgstr "分析プラン" + +#. module: purchase_line_budget +#. odoo-python +#: code:addons/purchase_line_budget/models/analytic_plan.py:0 +msgid "" +"Only one analytic plan can be set for purchase order lines. Please disable " +"the existing plan '%(plan)s' first." +msgstr "購買オーダ明細に使用できる分析プランは1つのみです。既存の分析プラン '%(plan)s' を先に無効にしてください。" + +#. module: purchase_line_budget +#: model:ir.model,name:purchase_line_budget.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "購買オーダ明細" + +#. module: purchase_line_budget +#: model:ir.actions.server,name:purchase_line_budget.action_recompute_purchase_line_budget +msgid "Recompute Purchase Line Budget" +msgstr "購買オーダ明細の予算番号の再計算" + +#. module: purchase_line_budget +#: model:ir.model.fields,field_description:purchase_line_budget.field_account_analytic_plan__smart_search +#: model:ir.model.fields,field_description:purchase_line_budget.field_purchase_order_line__smart_search +msgid "Smart Search" +msgstr "" + +#. module: purchase_line_budget +#: model:ir.model.fields,field_description:purchase_line_budget.field_account_analytic_plan__is_budget +msgid "Use for Purchase Order Lines Budget" +msgstr "購買オーダ明細の予算番号に使用" diff --git a/purchase_line_budget/models/__init__.py b/purchase_line_budget/models/__init__.py new file mode 100644 index 0000000..847eb35 --- /dev/null +++ b/purchase_line_budget/models/__init__.py @@ -0,0 +1,2 @@ +from . import analytic_plan +from . import purchase_order_line diff --git a/purchase_line_budget/models/analytic_plan.py b/purchase_line_budget/models/analytic_plan.py new file mode 100644 index 0000000..cf8e76c --- /dev/null +++ b/purchase_line_budget/models/analytic_plan.py @@ -0,0 +1,30 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class AccountAnalyticPlan(models.Model): + _inherit = "account.analytic.plan" + + is_budget = fields.Boolean( + string="Use for Purchase Order Lines Budget", + ) + + @api.constrains("is_budget") + def _check_unique_pol_analytic_plan(self): + for plan in self: + if plan.is_budget: + existing = self.search( + [("is_budget", "=", True), ("id", "!=", plan.id)], + limit=1, + ) + if existing: + raise ValidationError( + _( + "Only one analytic plan can be set for purchase order " + "lines. Please disable the existing plan '%(plan)s' first.", + plan=existing.name, + ) + ) diff --git a/purchase_line_budget/models/purchase_order_line.py b/purchase_line_budget/models/purchase_order_line.py new file mode 100644 index 0000000..87bf89f --- /dev/null +++ b/purchase_line_budget/models/purchase_order_line.py @@ -0,0 +1,27 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class PurchaseOrderLine(models.Model): + _inherit = "purchase.order.line" + + analytic_budget_id = fields.Many2one( + "account.analytic.account", + compute="_compute_analytic_budget_id", + store=True, + ) + + @api.depends("analytic_distribution") + def _compute_analytic_budget_id(self): + plan = self.env["account.analytic.plan"].search( + [("is_budget", "=", True)], limit=1 + ) + if not plan: + self.analytic_budget_id = False + return + for line in self: + line.analytic_budget_id = line.distribution_analytic_account_ids.filtered( + lambda a: a.plan_id == plan + )[:1] diff --git a/purchase_line_budget/pyproject.toml b/purchase_line_budget/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/purchase_line_budget/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/purchase_line_budget/readme/CONFIGURE.md b/purchase_line_budget/readme/CONFIGURE.md new file mode 100644 index 0000000..9ef2747 --- /dev/null +++ b/purchase_line_budget/readme/CONFIGURE.md @@ -0,0 +1,3 @@ +Go to *Invoicing > Configuration > Analytic Accounting > Analytic Plans*, open +the analytic plan to use for purchase order lines, and enable +*Use for Purchase Order Lines Budget*. diff --git a/purchase_line_budget/readme/CONTRIBUTORS.md b/purchase_line_budget/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..04192ea --- /dev/null +++ b/purchase_line_budget/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [Quartile](https://www.quartile.co): + - Toshikimi Shigenobu diff --git a/purchase_line_budget/readme/DESCRIPTION.md b/purchase_line_budget/readme/DESCRIPTION.md new file mode 100644 index 0000000..33e529c --- /dev/null +++ b/purchase_line_budget/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +This module adds a stored computed `Many2one` field (`analytic_budget_id`) to purchase order +lines. The field extracts the analytic account belonging to the analytic plan marked for + purchase order lines, enabling grouping and filtering by that account directly on + purchase order lines. diff --git a/purchase_line_budget/readme/USAGE.md b/purchase_line_budget/readme/USAGE.md new file mode 100644 index 0000000..762ca29 --- /dev/null +++ b/purchase_line_budget/readme/USAGE.md @@ -0,0 +1,7 @@ +To recompute the budget account on existing purchase order lines: + +1. Go to *Settings > Technical > Actions > Server Actions*, find + *Recompute Purchase Line Budget*, and click *Add Context Action*. +2. Go to *Purchase > Orders > Purchase Order Lines*, select the target + lines, and choose *Recompute Purchase Line Budget* from the *Action* + menu. diff --git a/purchase_line_budget/static/description/index.html b/purchase_line_budget/static/description/index.html new file mode 100644 index 0000000..f406891 --- /dev/null +++ b/purchase_line_budget/static/description/index.html @@ -0,0 +1,442 @@ + + + + + +Purchase Line Budget + + + +
+

Purchase Line Budget

+ + +

Beta License: AGPL-3 qrtl/rbkk-custom

+

This module adds a stored computed Many2one field +(analytic_budget_id) to purchase order lines. The field extracts the +analytic account belonging to the analytic plan marked for purchase +order lines, enabling grouping and filtering by that account directly on +purchase order lines.

+

Table of contents

+ +
+

Configuration

+

Go to Invoicing > Configuration > Analytic Accounting > Analytic +Plans, open the analytic plan to use for purchase order lines, and +enable Use for Purchase Order Lines Budget.

+
+
+

Usage

+

To recompute the budget account on existing purchase order lines:

+
    +
  1. Go to Settings > Technical > Actions > Server Actions, find +Recompute Purchase Line Budget, and click Add Context Action.
  2. +
  3. Go to Purchase > Orders > Purchase Order Lines, select the target +lines, and choose Recompute Purchase Line Budget from the Action +menu.
  4. +
+
+
+

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
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the qrtl/rbkk-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/purchase_line_budget/tests/__init__.py b/purchase_line_budget/tests/__init__.py new file mode 100644 index 0000000..9a506f4 --- /dev/null +++ b/purchase_line_budget/tests/__init__.py @@ -0,0 +1 @@ +from . import test_purchase_order_line diff --git a/purchase_line_budget/tests/test_purchase_order_line.py b/purchase_line_budget/tests/test_purchase_order_line.py new file mode 100644 index 0000000..7c05c21 --- /dev/null +++ b/purchase_line_budget/tests/test_purchase_order_line.py @@ -0,0 +1,47 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.exceptions import ValidationError +from odoo.tests.common import TransactionCase + + +class TestPurchaseOrderLine(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.plan_a = cls.env["account.analytic.plan"].create( + {"name": "Plan A", "is_budget": True} + ) + cls.plan_b = cls.env["account.analytic.plan"].create({"name": "Plan B"}) + cls.account_a = cls.env["account.analytic.account"].create( + {"name": "Account A", "plan_id": cls.plan_a.id, "company_id": False} + ) + cls.account_b = cls.env["account.analytic.account"].create( + {"name": "Account B", "plan_id": cls.plan_b.id, "company_id": False} + ) + partner = cls.env["res.partner"].create({"name": "Vendor"}) + product = cls.env["product.product"].create( + {"name": "Product", "type": "consu"} + ) + cls.order = cls.env["purchase.order"].create({"partner_id": partner.id}) + cls._line_defaults = { + "order_id": cls.order.id, + "product_id": product.id, + "product_qty": 1.0, + "price_unit": 100.0, + } + + def _create_line(self, dist=None): + return self.env["purchase.order.line"].create( + {**self._line_defaults, **({"analytic_distribution": dist} if dist else {})} + ) + + def test_multiple_accounts_picks_plan_account(self): + line = self._create_line( + {str(self.account_a.id): 60.0, str(self.account_b.id): 40.0} + ) + self.assertEqual(line.analytic_budget_id, self.account_a) + + def test_duplicate_pol_plan_raises(self): + with self.assertRaises(ValidationError): + self.plan_b.is_budget = True diff --git a/purchase_line_budget/views/analytic_plan_views.xml b/purchase_line_budget/views/analytic_plan_views.xml new file mode 100644 index 0000000..c52d99e --- /dev/null +++ b/purchase_line_budget/views/analytic_plan_views.xml @@ -0,0 +1,13 @@ + + + + account.analytic.plan.form + account.analytic.plan + + + + + + + + diff --git a/purchase_line_budget/views/purchase_order_line_views.xml b/purchase_line_budget/views/purchase_order_line_views.xml new file mode 100644 index 0000000..cb51555 --- /dev/null +++ b/purchase_line_budget/views/purchase_order_line_views.xml @@ -0,0 +1,31 @@ + + + + purchase.order.line.list + purchase.order.line + + + + + + + + + purchase.order.line.search + purchase.order.line + + + + + + + + + + + diff --git a/stock_location_report_manager_layout/README.rst b/stock_location_report_manager_layout/README.rst new file mode 100644 index 0000000..2bc02d0 --- /dev/null +++ b/stock_location_report_manager_layout/README.rst @@ -0,0 +1,96 @@ +==================================== +Stock Location Report Manager Layout +==================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:3c519dae8c0bb3c90bc5f11d688db658db73f033007036878bd5ff768a4200a0 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Frbkk--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/rbkk-custom/tree/18.0/stock_location_report_manager_layout + :alt: qrtl/rbkk-custom + +|badge1| |badge2| |badge3| + +This module changes the Locations report (*Inventory > Reporting > +Locations*) so that non-managers see a read-only copy of the manager +layout. + +Depending on the user's groups, the Locations report list view resolves +to: + +- Stock managers: the existing editable manager layout (unchanged). +- All other users: a read-only copy of the manager layout, so they see + the richer manager column set (and its extension columns, such as + expiration date) without being able to create, edit or delete + records. + +A module such as ``stock_reporting_access`` should be installed to let +non-manager users access the *Inventory > Reporting* menu item. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +1. Log in as a stock user who is not a stock manager. +2. Go to *Inventory > Reporting > Locations*. +3. The list shows the manager layout columns, but records cannot be + created, edited or deleted. + +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 + +Contributors +------------ + +- `Quartile `__: + + - Toshikimi Shigenobu + - Aung Ko Ko Lin + +Maintainers +----------- + +.. |maintainer-nobuQuartile| image:: https://github.com/nobuQuartile.png?size=40px + :target: https://github.com/nobuQuartile + :alt: nobuQuartile +.. |maintainer-AungKoKoLin1997| image:: https://github.com/AungKoKoLin1997.png?size=40px + :target: https://github.com/AungKoKoLin1997 + :alt: AungKoKoLin1997 + +Current maintainers: + +|maintainer-nobuQuartile| |maintainer-AungKoKoLin1997| + +This module is part of the `qrtl/rbkk-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/stock_location_report_manager_layout/__init__.py b/stock_location_report_manager_layout/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/stock_location_report_manager_layout/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/stock_location_report_manager_layout/__manifest__.py b/stock_location_report_manager_layout/__manifest__.py new file mode 100644 index 0000000..57ed817 --- /dev/null +++ b/stock_location_report_manager_layout/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Stock Location Report Manager Layout", + "version": "18.0.1.0.0", + "category": "Inventory/Inventory", + "summary": "Add a readonly manager layout option to the locations report", + "author": "Quartile", + "website": "https://www.quartile.co", + "license": "AGPL-3", + "maintainers": ["nobuQuartile", "AungKoKoLin1997"], + "depends": ["stock"], + "data": [ + "views/stock_quant_views.xml", + ], + "installable": True, +} diff --git a/stock_location_report_manager_layout/i18n/ja.po b/stock_location_report_manager_layout/i18n/ja.po new file mode 100644 index 0000000..daaa9d8 --- /dev/null +++ b/stock_location_report_manager_layout/i18n/ja.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_location_report_manager_layout +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-06-26 06:41+0000\n" +"PO-Revision-Date: 2026-06-26 06:41+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: stock_location_report_manager_layout +#: model_terms:ir.ui.view,arch_db:stock_location_report_manager_layout.view_stock_quant_tree_readonly_manager_layout +msgid "On Hand Quantity" +msgstr "手持在庫数" + +#. module: stock_location_report_manager_layout +#: model:ir.model,name:stock_location_report_manager_layout.model_stock_quant +msgid "Quants" +msgstr "保管ロット" + +#. module: stock_location_report_manager_layout +#: model_terms:ir.ui.view,arch_db:stock_location_report_manager_layout.view_stock_quant_tree_readonly_manager_layout +msgid "Total On Hand" +msgstr "手持在庫合計" diff --git a/stock_location_report_manager_layout/models/__init__.py b/stock_location_report_manager_layout/models/__init__.py new file mode 100644 index 0000000..70f8e6c --- /dev/null +++ b/stock_location_report_manager_layout/models/__init__.py @@ -0,0 +1 @@ +from . import stock_quant diff --git a/stock_location_report_manager_layout/models/stock_quant.py b/stock_location_report_manager_layout/models/stock_quant.py new file mode 100644 index 0000000..5756e76 --- /dev/null +++ b/stock_location_report_manager_layout/models/stock_quant.py @@ -0,0 +1,23 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class StockQuant(models.Model): + _inherit = "stock.quant" + + def _get_quants_action(self, domain=None, extend=False): + action = super()._get_quants_action(domain=domain, extend=extend) + if self.env.user.has_group("stock.group_stock_manager"): + return action + readonly_view = self.env.ref( + "stock_location_report_manager_layout.view_stock_quant_tree_readonly_manager_layout" + ) + action["view_id"] = readonly_view.id + action["views"] = [(readonly_view.id, "list")] + [ + (view_id, view_type) + for view_id, view_type in action.get("views", []) + if view_type != "list" + ] + return action diff --git a/stock_location_report_manager_layout/pyproject.toml b/stock_location_report_manager_layout/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/stock_location_report_manager_layout/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_location_report_manager_layout/readme/CONTRIBUTORS.md b/stock_location_report_manager_layout/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..3318a65 --- /dev/null +++ b/stock_location_report_manager_layout/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Quartile](https://www.quartile.co): + - Toshikimi Shigenobu + - Aung Ko Ko Lin diff --git a/stock_location_report_manager_layout/readme/DESCRIPTION.md b/stock_location_report_manager_layout/readme/DESCRIPTION.md new file mode 100644 index 0000000..1ef4099 --- /dev/null +++ b/stock_location_report_manager_layout/readme/DESCRIPTION.md @@ -0,0 +1,12 @@ +This module changes the Locations report (*Inventory > Reporting > +Locations*) so that non-managers see a read-only copy of the manager layout. + +Depending on the user's groups, the Locations report list view resolves to: + +- Stock managers: the existing editable manager layout (unchanged). +- All other users: a read-only copy of the manager layout, so they see the + richer manager column set (and its extension columns, such as expiration + date) without being able to create, edit or delete records. + +A module such as `stock_reporting_access` should be installed to let non-manager +users access the *Inventory > Reporting* menu item. diff --git a/stock_location_report_manager_layout/readme/USAGE.md b/stock_location_report_manager_layout/readme/USAGE.md new file mode 100644 index 0000000..5c9385b --- /dev/null +++ b/stock_location_report_manager_layout/readme/USAGE.md @@ -0,0 +1,4 @@ +1. Log in as a stock user who is not a stock manager. +2. Go to *Inventory > Reporting > Locations*. +3. The list shows the manager layout columns, but records cannot be created, + edited or deleted. diff --git a/stock_location_report_manager_layout/static/description/index.html b/stock_location_report_manager_layout/static/description/index.html new file mode 100644 index 0000000..3fd3541 --- /dev/null +++ b/stock_location_report_manager_layout/static/description/index.html @@ -0,0 +1,445 @@ + + + + + +Stock Location Report Manager Layout + + + +
+

Stock Location Report Manager Layout

+ + +

Beta License: AGPL-3 qrtl/rbkk-custom

+

This module changes the Locations report (Inventory > Reporting > +Locations) so that non-managers see a read-only copy of the manager +layout.

+

Depending on the user’s groups, the Locations report list view resolves +to:

+
    +
  • Stock managers: the existing editable manager layout (unchanged).
  • +
  • All other users: a read-only copy of the manager layout, so they see +the richer manager column set (and its extension columns, such as +expiration date) without being able to create, edit or delete +records.
  • +
+

A module such as stock_reporting_access should be installed to let +non-manager users access the Inventory > Reporting menu item.

+

Table of contents

+ +
+

Usage

+
    +
  1. Log in as a stock user who is not a stock manager.
  2. +
  3. Go to Inventory > Reporting > Locations.
  4. +
  5. The list shows the manager layout columns, but records cannot be +created, edited or deleted.
  6. +
+
+
+

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
  • +
+
+
+

Contributors

+
    +
  • Quartile:
      +
    • Toshikimi Shigenobu
    • +
    • Aung Ko Ko Lin
    • +
    +
  • +
+
+
+

Maintainers

+

Current maintainers:

+

nobuQuartile AungKoKoLin1997

+

This module is part of the qrtl/rbkk-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/stock_location_report_manager_layout/tests/__init__.py b/stock_location_report_manager_layout/tests/__init__.py new file mode 100644 index 0000000..ca7a2b3 --- /dev/null +++ b/stock_location_report_manager_layout/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_location_report_manager_layout diff --git a/stock_location_report_manager_layout/tests/test_stock_location_report_manager_layout.py b/stock_location_report_manager_layout/tests/test_stock_location_report_manager_layout.py new file mode 100644 index 0000000..239d597 --- /dev/null +++ b/stock_location_report_manager_layout/tests/test_stock_location_report_manager_layout.py @@ -0,0 +1,45 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo.tests import new_test_user, tagged + +from odoo.addons.base.tests.common import BaseCommon + + +@tagged("post_install", "-at_install") +class TestStockLocationReportManagerLayout(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.standard_view = cls.env.ref("stock.view_stock_quant_tree") + cls.editable_view = cls.env.ref("stock.view_stock_quant_tree_editable") + cls.readonly_view = cls.env.ref( + "stock_location_report_manager_layout." + "view_stock_quant_tree_readonly_manager_layout" + ) + cls.user_plain = new_test_user( + cls.env, "srml_plain_user", groups="stock.group_stock_user" + ) + cls.user_manager = new_test_user( + cls.env, "srml_manager", groups="stock.group_stock_manager" + ) + + def _list_view_id(self, user, **ctx): + action = ( + self.env["stock.quant"] + .with_user(user) + .with_context(**ctx) + ._get_quants_action() + ) + return action["view_id"] + + def test_non_manager_gets_readonly_manager_layout(self): + self.assertEqual(self._list_view_id(self.user_plain), self.readonly_view.id) + + def test_manager_is_unaffected(self): + # Manager keeps the standard report view, and gets the editable layout in + # inventory mode -- never the read-only manager layout. + self.assertEqual(self._list_view_id(self.user_manager), self.standard_view.id) + self.assertEqual( + self._list_view_id(self.user_manager, inventory_mode=True), + self.editable_view.id, + ) diff --git a/stock_location_report_manager_layout/views/stock_quant_views.xml b/stock_location_report_manager_layout/views/stock_quant_views.xml new file mode 100644 index 0000000..b51bb1f --- /dev/null +++ b/stock_location_report_manager_layout/views/stock_quant_views.xml @@ -0,0 +1,24 @@ + + + + stock.quant.list.readonly.manager + stock.quant + + primary + 99 + + + 0 + 0 + 0 + + + + + + + + From 72f61be35c604da0033fb13911659f71240720a6 Mon Sep 17 00:00:00 2001 From: Morita Shinnosuke Date: Wed, 15 Jul 2026 05:48:21 +0000 Subject: [PATCH 03/12] [FIX] restore test-requirements.txt and purchase_security_adjust description Also dropped by the ours-merge c2fe042: test-requirements.txt (test dep stock_reporting_access needed by stock_location_report_manager_layout) and the regenerated purchase_security_adjust static description. Recover from 54185f3. --- purchase_security_adjust/static/description/index.html | 7 ++++--- test-requirements.txt | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 test-requirements.txt diff --git a/purchase_security_adjust/static/description/index.html b/purchase_security_adjust/static/description/index.html index b3d2d8b..6adec19 100644 --- a/purchase_security_adjust/static/description/index.html +++ b/purchase_security_adjust/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..5c4607a --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-stock_reporting_access @ git+https://github.com/qrtl/rbkk-oca@18.0#subdirectory=stock_reporting_access From 66565d6f4fca4923e726a13d4f14a16729c73de9 Mon Sep 17 00:00:00 2001 From: Morita Shinnosuke Date: Thu, 16 Jul 2026 00:38:35 +0000 Subject: [PATCH 04/12] fixup! --- .../__manifest__.py | 1 + maintenance_additional_attributes/i18n/ja.po | 20 +++++++---- .../models/__init__.py | 1 + .../models/maintenance_equipment.py | 5 ++- .../maintenance_equipment_department.py | 13 +++++++ .../models/maintenance_request.py | 9 ++++- .../security/ir.model.access.csv | 2 ++ .../static/description/index.html | 36 +++++++++---------- ...maintenance_equipment_department_views.xml | 15 ++++++++ .../views/maintenance_equipment_views.xml | 2 +- .../views/maintenance_request_views.xml | 7 ++-- 11 files changed, 81 insertions(+), 30 deletions(-) create mode 100644 maintenance_additional_attributes/models/maintenance_equipment_department.py create mode 100644 maintenance_additional_attributes/views/maintenance_equipment_department_views.xml diff --git a/maintenance_additional_attributes/__manifest__.py b/maintenance_additional_attributes/__manifest__.py index c0231d3..7e8df5d 100644 --- a/maintenance_additional_attributes/__manifest__.py +++ b/maintenance_additional_attributes/__manifest__.py @@ -12,6 +12,7 @@ "depends": ["maintenance", "stock"], "data": [ "security/ir.model.access.csv", + "views/maintenance_equipment_department_views.xml", "views/maintenance_equipment_generic_name_views.xml", "views/maintenance_equipment_views.xml", "views/maintenance_request_views.xml", diff --git a/maintenance_additional_attributes/i18n/ja.po b/maintenance_additional_attributes/i18n/ja.po index bc6909c..bbc652f 100644 --- a/maintenance_additional_attributes/i18n/ja.po +++ b/maintenance_additional_attributes/i18n/ja.po @@ -25,11 +25,6 @@ msgstr "取得年月日" msgid "Active" msgstr "有効" -#. module: maintenance_additional_attributes -#: model:ir.model.fields,field_description:maintenance_additional_attributes.field_maintenance_request__alert_period_months -msgid "Alert Period Months" -msgstr "アラート期間(月)" - #. module: maintenance_additional_attributes #: model:ir.model.fields,field_description:maintenance_additional_attributes.field_maintenance_equipment_generic_name__create_uid msgid "Created by" @@ -40,15 +35,21 @@ msgstr "作成者" msgid "Created on" msgstr "作成日" +#. module: maintenance_additional_attributes +#: model:ir.actions.act_window,name:maintenance_additional_attributes.maintenance_equipment_department_action +#: model:ir.ui.menu,name:maintenance_additional_attributes.menu_maintenance_equipment_department +msgid "Departments" +msgstr "部門" + #. module: maintenance_additional_attributes #: model:ir.model.fields,field_description:maintenance_additional_attributes.field_maintenance_equipment_generic_name__display_name msgid "Display Name" msgstr "表示名" #. module: maintenance_additional_attributes -#: model:ir.model.fields,field_description:maintenance_additional_attributes.field_maintenance_equipment__equipment_department +#: model:ir.model.fields,field_description:maintenance_additional_attributes.field_maintenance_equipment__equipment_department_id msgid "Equipment Department" -msgstr "部門" +msgstr "設備部門" #. module: maintenance_additional_attributes #: model:ir.model.fields,field_description:maintenance_additional_attributes.field_maintenance_equipment__is_fixed_asset @@ -96,6 +97,11 @@ msgstr "最終更新日" msgid "Maintenance Equipment" msgstr "整備設備" +#. module: maintenance_additional_attributes +#: model:ir.model,name:maintenance_additional_attributes.model_maintenance_equipment_department +msgid "Maintenance Equipment Department" +msgstr "整備設備部門" + #. module: maintenance_additional_attributes #: model:ir.model,name:maintenance_additional_attributes.model_maintenance_equipment_generic_name msgid "Maintenance Equipment General Name" diff --git a/maintenance_additional_attributes/models/__init__.py b/maintenance_additional_attributes/models/__init__.py index d303d69..70b2e46 100644 --- a/maintenance_additional_attributes/models/__init__.py +++ b/maintenance_additional_attributes/models/__init__.py @@ -1,3 +1,4 @@ +from . import maintenance_equipment_department from . import maintenance_equipment_generic_name from . import maintenance_equipment from . import maintenance_request diff --git a/maintenance_additional_attributes/models/maintenance_equipment.py b/maintenance_additional_attributes/models/maintenance_equipment.py index a1eac42..89353d8 100644 --- a/maintenance_additional_attributes/models/maintenance_equipment.py +++ b/maintenance_additional_attributes/models/maintenance_equipment.py @@ -27,4 +27,7 @@ class MaintenanceEquipment(models.Model): manufacturer = fields.Char() manufacturer_serial_no = fields.Char() acquisition_date = fields.Date() - equipment_department = fields.Char() + equipment_department_id = fields.Many2one( + comodel_name="maintenance.equipment.department", + string="Equipment Department", + ) diff --git a/maintenance_additional_attributes/models/maintenance_equipment_department.py b/maintenance_additional_attributes/models/maintenance_equipment_department.py new file mode 100644 index 0000000..a9587dc --- /dev/null +++ b/maintenance_additional_attributes/models/maintenance_equipment_department.py @@ -0,0 +1,13 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class MaintenanceEquipmentDepartment(models.Model): + _name = "maintenance.equipment.department" + _description = "Maintenance Equipment Department" + _order = "name" + + name = fields.Char(required=True) + active = fields.Boolean(default=True) diff --git a/maintenance_additional_attributes/models/maintenance_request.py b/maintenance_additional_attributes/models/maintenance_request.py index a27d5ac..07a58ae 100644 --- a/maintenance_additional_attributes/models/maintenance_request.py +++ b/maintenance_additional_attributes/models/maintenance_request.py @@ -7,4 +7,11 @@ class MaintenanceRequest(models.Model): _inherit = "maintenance.request" - alert_period_months = fields.Integer() + alert_period_months = fields.Integer( + string="Alert Period (Months)", + help="Number of months before the scheduled date at which the " + "responsible user should be alerted about this maintenance.", + ) + alert_sent = fields.Boolean( + copy=False, + ) diff --git a/maintenance_additional_attributes/security/ir.model.access.csv b/maintenance_additional_attributes/security/ir.model.access.csv index 141946c..56c80d5 100644 --- a/maintenance_additional_attributes/security/ir.model.access.csv +++ b/maintenance_additional_attributes/security/ir.model.access.csv @@ -1,3 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_maintenance_equipment_generic_name_user,maintenance.equipment.generic.name user,model_maintenance_equipment_generic_name,base.group_user,1,0,0,0 access_maintenance_equipment_generic_name_manager,maintenance.equipment.generic.name manager,model_maintenance_equipment_generic_name,maintenance.group_equipment_manager,1,1,1,1 +access_maintenance_equipment_department_user,maintenance.equipment.department user,model_maintenance_equipment_department,base.group_user,1,0,0,0 +access_maintenance_equipment_department_manager,maintenance.equipment.department manager,model_maintenance_equipment_department,maintenance.group_equipment_manager,1,1,1,1 diff --git a/maintenance_additional_attributes/static/description/index.html b/maintenance_additional_attributes/static/description/index.html index 1f69fc0..9c32a68 100644 --- a/maintenance_additional_attributes/static/description/index.html +++ b/maintenance_additional_attributes/static/description/index.html @@ -1,20 +1,20 @@ - - + Maintenance Additional Attributes