diff --git a/product_state/README.rst b/product_state/README.rst new file mode 100644 index 00000000..f87b7a2f --- /dev/null +++ b/product_state/README.rst @@ -0,0 +1,55 @@ +============= +Product State +============= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:baf2a9dff99e5691c0454547a9d63db195f68eeede8f3be093691a5c0ef8bf9e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Frmm--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/rmm-custom/tree/15.0/product_state + :alt: qrtl/rmm-custom + +|badge1| |badge2| |badge3| + +This module adds product_state_id in product. + +**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 Limited + +Maintainers +----------- + +This module is part of the `qrtl/rmm-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/product_state/__init__.py b/product_state/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/product_state/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py new file mode 100644 index 00000000..678a2a78 --- /dev/null +++ b/product_state/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2017-2018 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +{ + "name": "Product State", + "version": "15.0.1.0.0", + "author": "Quartile Limited", + "website": "https://www.quartile.co", + "category": "Product", + "license": "LGPL-3", + "depends": ["sale"], + "data": [ + "security/ir.model.access.csv", + "views/product_state_views.xml", + "views/product_template_views.xml", + ], + "installable": True, +} diff --git a/product_state/i18n/ja.po b/product_state/i18n/ja.po new file mode 100644 index 00000000..0b53cdad --- /dev/null +++ b/product_state/i18n/ja.po @@ -0,0 +1,100 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-02-05 09:25+0000\n" +"PO-Revision-Date: 2024-02-05 09:25+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: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "有効" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__company_id +msgid "Company" +msgstr "会社" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "作成者" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "作成日" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +msgid "Description" +msgstr "説明" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "表示名" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state____last_update +msgid "Last Modified on" +msgstr "最終更新日" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "最終更新者" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "最終更新日" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model:ir.ui.menu,name:product_state.menu_product_state +#: model_terms:ir.ui.view,arch_db:product_state.form_view_product_state +msgid "Product State" +msgstr "商品状態" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +msgid "Product States" +msgstr "商品状態" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "プロダクトテンプレート" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__rank +msgid "Rank" +msgstr "商品状態" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_view +msgid "Search State" +msgstr "商品状態検索" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "付番" diff --git a/product_state/models/__init__.py b/product_state/models/__init__.py new file mode 100644 index 00000000..3e93acc6 --- /dev/null +++ b/product_state/models/__init__.py @@ -0,0 +1,2 @@ +from . import product_state +from . import product_template diff --git a/product_state/models/product_state.py b/product_state/models/product_state.py new file mode 100644 index 00000000..aaa3cef5 --- /dev/null +++ b/product_state/models/product_state.py @@ -0,0 +1,41 @@ +# Copyright 2017-2018 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import api, fields, models +from odoo.osv import expression + + +class ProductState(models.Model): + _name = "product.state" + _description = "Product State" + _order = "sequence, rank" + + rank = fields.Char(required=True) + description = fields.Char(required=True) + sequence = fields.Integer(default=10) + active = fields.Boolean(default=True) + company_id = fields.Many2one( + "res.company", + default=lambda self: self.env["res.company"]._company_default_get( + "product.state" + ), + ) + + def name_get(self): + res = [] + for record in self: + res.append((record.id, record.rank + ":" + record.description)) + return res + + @api.model + def _name_search( + self, name, args=None, operator="ilike", limit=100, name_get_uid=None + ): + args = args or [] + domain = [] + if name: + domain = ["|", ("rank", operator, name), ("description", operator, name)] + product_states = self._search( + expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid + ) + return product_states diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py new file mode 100644 index 00000000..1dc0b18a --- /dev/null +++ b/product_state/models/product_template.py @@ -0,0 +1,11 @@ +# Copyright 2017-2018 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + product_state_id = fields.Many2one("product.state") diff --git a/product_state/readme/DESCRIPTION.md b/product_state/readme/DESCRIPTION.md new file mode 100644 index 00000000..75f31444 --- /dev/null +++ b/product_state/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module adds product_state_id in product. diff --git a/product_state/security/ir.model.access.csv b/product_state/security/ir.model.access.csv new file mode 100644 index 00000000..affed044 --- /dev/null +++ b/product_state/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_product_state_user,product_state_user,model_product_state,base.group_user,1,0,0,0 +access_product_state_public,product_state_public,model_product_state,base.group_public,1,0,0,0 +access_product_state_portal,product_state_portal,model_product_state,base.group_portal,1,0,0,0 +access_product_state_manager,product_state_manager,model_product_state,sales_team.group_sale_manager,1,1,1,1 diff --git a/product_state/static/description/index.html b/product_state/static/description/index.html new file mode 100644 index 00000000..d1729464 --- /dev/null +++ b/product_state/static/description/index.html @@ -0,0 +1,409 @@ + + + + + + +Product State + + + +
+

Product State

+ + +

Beta License: LGPL-3 qrtl/rmm-custom

+

This module adds product_state_id in product.

+

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

Maintainers

+

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

+

You are welcome to contribute.

+
+
+
+ + diff --git a/product_state/views/product_state_views.xml b/product_state/views/product_state_views.xml new file mode 100644 index 00000000..74ae1628 --- /dev/null +++ b/product_state/views/product_state_views.xml @@ -0,0 +1,60 @@ + + + + form.view.product.state + product.state + +
+ + + + + + + + + + + + + +
+
+
+ + tree.view.product.state + product.state + + + + + + + + + + + + product.state.search + product.state + + + + + + + + + Product States + product.state + tree,form + + + +
diff --git a/product_state/views/product_template_views.xml b/product_state/views/product_template_views.xml new file mode 100644 index 00000000..e20d7237 --- /dev/null +++ b/product_state/views/product_template_views.xml @@ -0,0 +1,25 @@ + + + + product.template.common.form + product.template + + + + + + + + + + + product.template.product.tree + product.template + + + + + + + + diff --git a/setup/product_state/odoo/addons/product_state b/setup/product_state/odoo/addons/product_state new file mode 120000 index 00000000..037006a4 --- /dev/null +++ b/setup/product_state/odoo/addons/product_state @@ -0,0 +1 @@ +../../../../product_state \ No newline at end of file diff --git a/setup/product_state/setup.py b/setup/product_state/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/product_state/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)