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

[16.0][MIG] stock_request_submit: Migration to 16.0 #15

Merged
merged 19 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
6 changes: 6 additions & 0 deletions setup/stock_request_submit/setup.py
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,
)
86 changes: 86 additions & 0 deletions stock_request_submit/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
====================
Stock Request Submit
====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:58b1fc8b1d2fe13baff1e03ec80605137809dde2e27289418415b3b0f8a0d308
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-OCA%2Fstock--logistics--request-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-request/tree/16.0/stock_request_submit
:alt: OCA/stock-logistics-request
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-request-16-0/stock-logistics-request-16-0-stock_request_submit
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-request&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds a new state 'Submitted' to Stock Request.

The porpose of this state is to allow Supervisors to validate the submitted
request enabling them to correct Routes if required.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-request/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/OCA/stock-logistics-request/issues/new?body=module:%20stock_request_submit%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
~~~~~~~

* Open Source Integrators

Contributors
~~~~~~~~~~~~

* `Open Source Integrators <https://www.opensourceintegrators.com>`_

* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
* Steve Campbell <scampbell@opensourceintegrators.com>
* Urvisha Desai <udesai@opensourceintegrators.com>

* Héctor Villarreal Ortega <hector.villarreal@eficent.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/stock-logistics-request <https://github.com/OCA/stock-logistics-request/tree/16.0/stock_request_submit>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions stock_request_submit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import uninstall_hook
17 changes: 17 additions & 0 deletions stock_request_submit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2019 Open Source Integrators
# Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Stock Request Submit",
"summary": "Add submit state on Stock Requests",
"version": "16.0.1.0.0",
"license": "LGPL-3",
"website": "https://github.com/OCA/stock-logistics-request",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"category": "Warehouse Management",
"depends": ["stock_request"],
"data": ["views/stock_request_order_views.xml", "views/stock_request_views.xml"],
"installable": True,
"uninstall_hook": "uninstall_hook",
}
11 changes: 11 additions & 0 deletions stock_request_submit/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api


def uninstall_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
sr = env["stock.request"].search([("state", "=", "submitted")])
sr.write({"state": "draft"})
sro = env["stock.request.order"].search([("state", "=", "submitted")])
sro.write({"state": "draft"})
55 changes: 55 additions & 0 deletions stock_request_submit/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_request_submit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-26 16:20+0000\n"
"PO-Revision-Date: 2023-01-26 17:20+0100\n"
"Last-Translator: Víctor Martínez <victor.martinez@tecnativa.com>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Poedit 3.0.1\n"

#. module: stock_request_submit
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__route_id
msgid "Route"
msgstr "Ruta"

#. module: stock_request_submit
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__state
msgid "Status"
msgstr "Estado"

#. module: stock_request_submit
#: model:ir.model,name:stock_request_submit.model_stock_request
msgid "Stock Request"
msgstr "Solicitud de existencias"

#. module: stock_request_submit
#: model:ir.model,name:stock_request_submit.model_stock_request_order
msgid "Stock Request Order"
msgstr "Pedido de existencias"

#. module: stock_request_submit
#: model_terms:ir.ui.view,arch_db:stock_request_submit.stock_request_order_form
#: model_terms:ir.ui.view,arch_db:stock_request_submit.view_stock_request_form
msgid "Submit"
msgstr "Enviar"

#. module: stock_request_submit
#: model:ir.model.fields.selection,name:stock_request_submit.selection__stock_request__state__submitted
msgid "Submitted"
msgstr "Enviado"

#. module: stock_request_submit
#: code:addons/stock_request_submit/models/stock_request_order.py:0
#, python-format
msgid "There should be at least one request item for submiting the order."
msgstr "Debe haber al menos un elemento de solicitud para enviar el pedido."
54 changes: 54 additions & 0 deletions stock_request_submit/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_request_submit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-18 09:34+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: stock_request_submit
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__route_id
msgid "Route"
msgstr "Percorso"

#. module: stock_request_submit
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__state
msgid "Status"
msgstr "Stato"

#. module: stock_request_submit
#: model:ir.model,name:stock_request_submit.model_stock_request
msgid "Stock Request"
msgstr "Richiesta di magazzino"

#. module: stock_request_submit
#: model:ir.model,name:stock_request_submit.model_stock_request_order
msgid "Stock Request Order"
msgstr "Ordine richiesta di magazzino"

#. module: stock_request_submit
#: model_terms:ir.ui.view,arch_db:stock_request_submit.stock_request_order_form
#: model_terms:ir.ui.view,arch_db:stock_request_submit.view_stock_request_form
msgid "Submit"
msgstr "Invia"

#. module: stock_request_submit
#: model:ir.model.fields.selection,name:stock_request_submit.selection__stock_request__state__submitted
msgid "Submitted"
msgstr "Inviata"

#. module: stock_request_submit
#: code:addons/stock_request_submit/models/stock_request_order.py:0
#, python-format
msgid "There should be at least one request item for submiting the order."
msgstr "Deve essere presente almeno un elemento richiesta per inviare l'ordine."
51 changes: 51 additions & 0 deletions stock_request_submit/i18n/stock_request_submit.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_request_submit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \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_request_submit
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__route_id
msgid "Route"
msgstr ""

#. module: stock_request_submit
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__state
msgid "Status"
msgstr ""

#. module: stock_request_submit
#: model:ir.model,name:stock_request_submit.model_stock_request
msgid "Stock Request"
msgstr ""

#. module: stock_request_submit
#: model:ir.model,name:stock_request_submit.model_stock_request_order
msgid "Stock Request Order"
msgstr ""

#. module: stock_request_submit
#: model_terms:ir.ui.view,arch_db:stock_request_submit.stock_request_order_form
#: model_terms:ir.ui.view,arch_db:stock_request_submit.view_stock_request_form
msgid "Submit"
msgstr ""

#. module: stock_request_submit
#: model:ir.model.fields.selection,name:stock_request_submit.selection__stock_request__state__submitted
msgid "Submitted"
msgstr ""

#. module: stock_request_submit
#: code:addons/stock_request_submit/models/stock_request_order.py:0
#, python-format
msgid "There should be at least one request item for submiting the order."
msgstr ""
54 changes: 54 additions & 0 deletions stock_request_submit/i18n/zh_CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_request_submit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-10-16 15:58+0000\n"
"Last-Translator: 黎伟杰 <674416404@qq.com>\n"
"Language-Team: none\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 3.8\n"

#. module: stock_request_submit
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__route_id
msgid "Route"
msgstr "路线"

#. module: stock_request_submit
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__state
msgid "Status"
msgstr ""

#. module: stock_request_submit
#: model:ir.model,name:stock_request_submit.model_stock_request
msgid "Stock Request"
msgstr "库存请求"

#. module: stock_request_submit
#: model:ir.model,name:stock_request_submit.model_stock_request_order
msgid "Stock Request Order"
msgstr "库存请求单"

#. module: stock_request_submit
#: model_terms:ir.ui.view,arch_db:stock_request_submit.stock_request_order_form
#: model_terms:ir.ui.view,arch_db:stock_request_submit.view_stock_request_form
msgid "Submit"
msgstr "提交"

#. module: stock_request_submit
#: model:ir.model.fields.selection,name:stock_request_submit.selection__stock_request__state__submitted
msgid "Submitted"
msgstr "已提交"

#. module: stock_request_submit
#: code:addons/stock_request_submit/models/stock_request_order.py:0
#, python-format
msgid "There should be at least one request item for submiting the order."
msgstr ""
2 changes: 2 additions & 0 deletions stock_request_submit/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import stock_request
from . import stock_request_order
28 changes: 28 additions & 0 deletions stock_request_submit/models/stock_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2019 Open Source Integrators
# Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from odoo import fields, models


class StockRequest(models.Model):
_inherit = "stock.request"

state = fields.Selection(selection_add=[("submitted", "Submitted"), ("open",)])

route_id = fields.Many2one(
states={"draft": [("readonly", False)], "submitted": [("readonly", False)]}
)

def action_submit(self):
self._action_submit()

def _action_submit(self):
self.state = "submitted"

def _skip_procurement(self):
return (
super()._skip_procurement()
and self.state != "submitted"
or self.product_id.type not in ("consu", "product")
)
Loading
Loading