Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][3937][MIG] product_state: Migration to 15.0 #102

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions product_state/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/qrtl/rmm-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/rmm-custom/issues/new?body=module:%20product_state%0Aversion:%2015.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 Limited

Maintainers
-----------

This module is part of the `qrtl/rmm-custom <https://github.com/qrtl/rmm-custom/tree/15.0/product_state>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions product_state/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions product_state/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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,
}
100 changes: 100 additions & 0 deletions product_state/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -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 "付番"
2 changes: 2 additions & 0 deletions product_state/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import product_state
from . import product_template
41 changes: 41 additions & 0 deletions product_state/models/product_state.py
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions product_state/models/product_template.py
Original file line number Diff line number Diff line change
@@ -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")
1 change: 1 addition & 0 deletions product_state/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds product_state_id in product.
5 changes: 5 additions & 0 deletions product_state/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading