-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[4613][ADD] stock_quality_check_category (#97)
* [4613][ADD] stock_quality_check_category
- Loading branch information
1 parent
89aa59b
commit 6738ab4
Showing
16 changed files
with
757 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/stock_quality_check_category/odoo/addons/stock_quality_check_category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../stock_quality_check_category |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <https://github.com/qrtl/axls-custom/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/qrtl/axls-custom/issues/new?body=module:%20stock_quality_check_category%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* Quartile | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is part of the `qrtl/axls-custom <https://github.com/qrtl/axls-custom/tree/16.0/stock_quality_check_category>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "在庫移動" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import product_template | ||
from . import quality_check_category | ||
from . import stock_move |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.", | ||
) |
23 changes: 23 additions & 0 deletions
23
stock_quality_check_category/models/quality_check_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.