diff --git a/setup/stock_quality_check_category/odoo/addons/stock_quality_check_category b/setup/stock_quality_check_category/odoo/addons/stock_quality_check_category new file mode 120000 index 0000000..2a2c07e --- /dev/null +++ b/setup/stock_quality_check_category/odoo/addons/stock_quality_check_category @@ -0,0 +1 @@ +../../../../stock_quality_check_category \ No newline at end of file diff --git a/setup/stock_quality_check_category/setup.py b/setup/stock_quality_check_category/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/stock_quality_check_category/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_quality_check_category/README.rst b/stock_quality_check_category/README.rst new file mode 100644 index 0000000..9f89404 --- /dev/null +++ b/stock_quality_check_category/README.rst @@ -0,0 +1,60 @@ +============================ +Stock Quality Check Category +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:cc22b8454088a4cea335d18111ceec50acfd0449698975522994fbabeaae7684 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Faxls--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/axls-custom/tree/16.0/stock_quality_check_category + :alt: qrtl/axls-custom + +|badge1| |badge2| |badge3| + +This module does the following: + +- Adds a new model Quality Check Category (quality.check.category) +- Adds the Quality Check Category field in the product +- Shows the Quality Check Category in the 'Operations' tab of the + incoming receipt form. + +**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/axls-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/stock_quality_check_category/__init__.py b/stock_quality_check_category/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/stock_quality_check_category/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/stock_quality_check_category/__manifest__.py b/stock_quality_check_category/__manifest__.py new file mode 100644 index 0000000..2976018 --- /dev/null +++ b/stock_quality_check_category/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2024 Quartile +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Stock Quality Check Category", + "version": "16.0.1.0.0", + "author": "Quartile", + "website": "https://www.quartile.co", + "category": "Stock", + "license": "AGPL-3", + "depends": ["stock"], + "data": [ + "security/ir.model.access.csv", + "views/product_template_views.xml", + "views/quality_check_category_views.xml", + "views/stock_picking_views.xml", + ], + "installable": True, +} diff --git a/stock_quality_check_category/i18n/ja.po b/stock_quality_check_category/i18n/ja.po new file mode 100644 index 0000000..cbc0a9b --- /dev/null +++ b/stock_quality_check_category/i18n/ja.po @@ -0,0 +1,113 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quality_check_category +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-10-29 09:54+0000\n" +"PO-Revision-Date: 2024-10-29 09: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: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category__active +msgid "Active" +msgstr "有効" + +#. module: stock_quality_check_category +#: model_terms:ir.ui.view,arch_db:stock_quality_check_category.view_quality_check_category_search +msgid "Archived" +msgstr "アーカイブ" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category__code +msgid "Code" +msgstr "コード" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category__create_uid +msgid "Created by" +msgstr "作成者" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category__create_date +msgid "Created on" +msgstr "作成日" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category__display_name +msgid "Display Name" +msgstr "表示名" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category__id +msgid "ID" +msgstr "" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category____last_update +msgid "Last Modified on" +msgstr "最終更新日" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category__write_uid +msgid "Last Updated by" +msgstr "最終更新者" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category__write_date +msgid "Last Updated on" +msgstr "最終更新日" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_quality_check_category__name +msgid "Name" +msgstr "名称" + +#. module: stock_quality_check_category +#: model:ir.model,name:stock_quality_check_category.model_product_template +msgid "Product" +msgstr "プロダクト" + +#. module: stock_quality_check_category +#: model_terms:ir.ui.view,arch_db:stock_quality_check_category.product_template_form_view +msgid "Quality Check" +msgstr "受入検査" + +#. module: stock_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_stock_move__quality_check_categ_code +msgid "Quality Check Categ. Code" +msgstr "受入検査カテゴリコード" + +#. module: stock_quality_check_category +#: model:ir.actions.act_window,name:stock_quality_check_category.action_quality_check_category_view +#: model:ir.ui.menu,name:stock_quality_check_category.menu_quality_check_category_config +msgid "Quality Check Categories" +msgstr "受入検査カテゴリ" + +#. module: stock_quality_check_category +#: model:ir.model,name:stock_quality_check_category.model_quality_check_category +#: model:ir.model.fields,field_description:stock_quality_check_category.field_product_product__quality_check_categ_id +#: model:ir.model.fields,field_description:stock_quality_check_category.field_product_template__quality_check_categ_id +#: model_terms:ir.ui.view,arch_db:stock_quality_check_category.view_quality_check_category_search +msgid "Quality Check Category" +msgstr "受入検査カテゴリ" + +#. module: stock_quality_check_category +#: model:ir.model.fields,help:stock_quality_check_category.field_product_product__quality_check_categ_id +#: model:ir.model.fields,help:stock_quality_check_category.field_product_template__quality_check_categ_id +msgid "" +"Selected category will show in the incoming receipt form (in the " +"'Operations' tab) for information purpose." +msgstr "" + +#. module: stock_quality_check_category +#: model:ir.model,name:stock_quality_check_category.model_stock_move +msgid "Stock Move" +msgstr "在庫移動" diff --git a/stock_quality_check_category/models/__init__.py b/stock_quality_check_category/models/__init__.py new file mode 100644 index 0000000..a637e58 --- /dev/null +++ b/stock_quality_check_category/models/__init__.py @@ -0,0 +1,3 @@ +from . import product_template +from . import quality_check_category +from . import stock_move diff --git a/stock_quality_check_category/models/product_template.py b/stock_quality_check_category/models/product_template.py new file mode 100644 index 0000000..7980b00 --- /dev/null +++ b/stock_quality_check_category/models/product_template.py @@ -0,0 +1,15 @@ +# Copyright 2024 Quartile +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + quality_check_categ_id = fields.Many2one( + "quality.check.category", + string="Quality Check Category", + help="Selected category will show in the incoming receipt form (in the " + "'Operations' tab) for information purpose.", + ) diff --git a/stock_quality_check_category/models/quality_check_category.py b/stock_quality_check_category/models/quality_check_category.py new file mode 100644 index 0000000..c5004cb --- /dev/null +++ b/stock_quality_check_category/models/quality_check_category.py @@ -0,0 +1,23 @@ +# Copyright 2024 Quartile +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class QualityCheckCategory(models.Model): + _name = "quality.check.category" + _description = "Quality Check Category" + _order = "code" + _rec_names_search = ["code", "description"] + + code = fields.Char(required=True) + name = fields.Char(required=True, translate=True) + active = fields.Boolean(default=True) + + def name_get(self): + res = super().name_get() + name_mapping = dict(res) + for rec in self: + if rec.code: + name_mapping[rec.id] = "[" + rec.code + "] " + name_mapping[rec.id] + return list(name_mapping.items()) diff --git a/stock_quality_check_category/models/stock_move.py b/stock_quality_check_category/models/stock_move.py new file mode 100644 index 0000000..9776a3f --- /dev/null +++ b/stock_quality_check_category/models/stock_move.py @@ -0,0 +1,22 @@ +# Copyright 2024 Quartile +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class StockMove(models.Model): + _inherit = "stock.move" + + quality_check_categ_code = fields.Char( + string="Quality Check Categ. Code", + compute="_compute_quality_check_category", + ) + + @api.depends("product_id", "picking_type_id") + def _compute_quality_check_category(self): + for move in self: + move.quality_check_categ_code = False + if move.picking_type_id.code == "incoming": + move.quality_check_categ_code = ( + move.product_id.quality_check_categ_id.code + ) diff --git a/stock_quality_check_category/readme/DESCRIPTION.md b/stock_quality_check_category/readme/DESCRIPTION.md new file mode 100644 index 0000000..5451327 --- /dev/null +++ b/stock_quality_check_category/readme/DESCRIPTION.md @@ -0,0 +1,5 @@ +This module does the following: + +- Adds a new model Quality Check Category (quality.check.category) +- Adds the Quality Check Category field in the product +- Shows the Quality Check Category in the 'Operations' tab of the incoming receipt form. diff --git a/stock_quality_check_category/security/ir.model.access.csv b/stock_quality_check_category/security/ir.model.access.csv new file mode 100644 index 0000000..4ac351e --- /dev/null +++ b/stock_quality_check_category/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_quality_check_category_user,access.quality.check.category.user,model_quality_check_category,base.group_user,1,0,0,0 +access_quality_check_category_manager,access.quality.check.category.manager,model_quality_check_category,stock.group_stock_manager,1,1,1,1 diff --git a/stock_quality_check_category/static/description/index.html b/stock_quality_check_category/static/description/index.html new file mode 100644 index 0000000..c1d986d --- /dev/null +++ b/stock_quality_check_category/static/description/index.html @@ -0,0 +1,414 @@ + + + + + +Stock Quality Check Category + + + +
+

Stock Quality Check Category

+ + +

Beta License: AGPL-3 qrtl/axls-custom

+

This module does the following:

+
    +
  • Adds a new model Quality Check Category (quality.check.category)
  • +
  • Adds the Quality Check Category field in the product
  • +
  • Shows the Quality Check Category in the ‘Operations’ tab of the +incoming receipt form.
  • +
+

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

Maintainers

+

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

+

You are welcome to contribute.

+
+
+
+ + diff --git a/stock_quality_check_category/views/product_template_views.xml b/stock_quality_check_category/views/product_template_views.xml new file mode 100644 index 0000000..27692c6 --- /dev/null +++ b/stock_quality_check_category/views/product_template_views.xml @@ -0,0 +1,15 @@ + + + + product.template.common.form + product.template + + + + + + + + + + diff --git a/stock_quality_check_category/views/quality_check_category_views.xml b/stock_quality_check_category/views/quality_check_category_views.xml new file mode 100644 index 0000000..67ad26b --- /dev/null +++ b/stock_quality_check_category/views/quality_check_category_views.xml @@ -0,0 +1,38 @@ + + + + quality.check.category.tree + quality.check.category + tree + + + + + + + + + quality.check.category.search + quality.check.category + + + + + + + + Quality Check Categories + quality.check.category + tree + + + diff --git a/stock_quality_check_category/views/stock_picking_views.xml b/stock_quality_check_category/views/stock_picking_views.xml new file mode 100644 index 0000000..46749bd --- /dev/null +++ b/stock_quality_check_category/views/stock_picking_views.xml @@ -0,0 +1,20 @@ + + + + stock.picking.form + stock.picking + + + + + + + +