mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
102
stock_removal_location_by_priority/README.rst
Normal file
102
stock_removal_location_by_priority/README.rst
Normal file
@@ -0,0 +1,102 @@
|
||||
==================================
|
||||
Stock Removal Location by Priority
|
||||
==================================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |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-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_removal_location_by_priority
|
||||
:alt: OCA/stock-logistics-warehouse
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_removal_location_by_priority
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/153/13.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module adds a removal priority field on stock locations.
|
||||
This priority applies when removing a product from different stock locations
|
||||
and the incoming dates are equal in both locations.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
You can activate the removal priority as follows:
|
||||
|
||||
#. Go to "Inventory > Configuration > Settings"
|
||||
#. In 'Operations' section, mark the "Removal Priority" option.
|
||||
#. You also need to activate the following settings in the section *Warehouse* if they are not yet:
|
||||
|
||||
#. Manage several locations using *Storage Locations* option.
|
||||
#. Advanced routing using "Multi-Step Routes" option.
|
||||
|
||||
Then, set the *Removal Priority* in the desired locations. Remember that a
|
||||
lower number means more priority:
|
||||
|
||||
#. Go to "Inventory > Configuration > Warehouse Management > Locations"
|
||||
#. In each Location form, in the Logistics section, put a Removal Priority.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
After configure your locations properly, the system will select the quant
|
||||
at the location with more priority in case of equal date, no matter if you
|
||||
use FIFO or LIFO removal strategy.
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_removal_location_by_priority%0Aversion:%2013.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
|
||||
~~~~~~~
|
||||
|
||||
* Eficent
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Miquel Raïch <miquel.raich@eficent.com>
|
||||
* Lois Rilo <lois.rilo@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-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_removal_location_by_priority>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
4
stock_removal_location_by_priority/__init__.py
Normal file
4
stock_removal_location_by_priority/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import models
|
||||
from .init_hook import pre_init_hook
|
||||
21
stock_removal_location_by_priority/__manifest__.py
Normal file
21
stock_removal_location_by_priority/__manifest__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# (http://www.eficent.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
"name": "Stock Removal Location by Priority",
|
||||
"summary": "Establish a removal priority on stock locations.",
|
||||
"version": "13.0.1.0.0",
|
||||
"author": "Eficent, " "Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
"category": "Warehouse",
|
||||
"depends": ["stock"],
|
||||
"data": [
|
||||
"security/stock_security.xml",
|
||||
"views/res_config_settings_views.xml",
|
||||
"views/stock_location_view.xml",
|
||||
],
|
||||
"license": "AGPL-3",
|
||||
"installable": True,
|
||||
"application": False,
|
||||
"pre_init_hook": "pre_init_hook",
|
||||
}
|
||||
67
stock_removal_location_by_priority/i18n/de.po
Normal file
67
stock_removal_location_by_priority/i18n/de.po
Normal file
@@ -0,0 +1,67 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
# Rudolf Schnapka <rs@techno-flex.de>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
|
||||
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
|
||||
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>, 2017\n"
|
||||
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
|
||||
"Language: de\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"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr "Bestandslagerorte"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr "Quants"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid ""
|
||||
"Removal priority that applies when the incoming dates are equal in both "
|
||||
"locations."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr ""
|
||||
67
stock_removal_location_by_priority/i18n/es.po
Normal file
67
stock_removal_location_by_priority/i18n/es.po
Normal file
@@ -0,0 +1,67 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
# Antonio Trueba <atgayol@gmail.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
|
||||
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
|
||||
"Last-Translator: Antonio Trueba <atgayol@gmail.com>, 2017\n"
|
||||
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
|
||||
"Language: es\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"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr "Ubicaciones de inventario"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr "Quants"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid ""
|
||||
"Removal priority that applies when the incoming dates are equal in both "
|
||||
"locations."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr ""
|
||||
66
stock_removal_location_by_priority/i18n/fi.po
Normal file
66
stock_removal_location_by_priority/i18n/fi.po
Normal file
@@ -0,0 +1,66 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
|
||||
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
|
||||
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||
"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n"
|
||||
"Language: fi\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"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr "Määrät"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid ""
|
||||
"Removal priority that applies when the incoming dates are equal in both "
|
||||
"locations."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr ""
|
||||
70
stock_removal_location_by_priority/i18n/fr.po
Normal file
70
stock_removal_location_by_priority/i18n/fr.po
Normal file
@@ -0,0 +1,70 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
|
||||
"PO-Revision-Date: 2019-08-06 14:44+0000\n"
|
||||
"Last-Translator: Alexandre Fayolle <alexandre.fayolle@camptocamp.com>\n"
|
||||
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
|
||||
"Language: fr\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 3.7.1\n"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr "Configuration"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr "Emplacements de stock"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr "Quants"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr "Priorité pour les sorties de stock"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid ""
|
||||
"Removal priority that applies when the incoming dates are equal in both "
|
||||
"locations."
|
||||
msgstr ""
|
||||
"Priorité appliquée lors des dates d'entrée sont égales pour 2 emplacements."
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr "La stratégie d'enlèvement %s n'est pas codée."
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr ""
|
||||
"Cette priorité s'applique lors de sorties de stock, lorsque les dates "
|
||||
"d'entrées des articles sont égales."
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr "Utiliser une <i>Priorité de sortie</i> sur les emplacements"
|
||||
66
stock_removal_location_by_priority/i18n/it.po
Normal file
66
stock_removal_location_by_priority/i18n/it.po
Normal file
@@ -0,0 +1,66 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
# Translators:
|
||||
# Paolo Valier <paolo.valier@hotmail.it>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
|
||||
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
|
||||
"Last-Translator: Paolo Valier <paolo.valier@hotmail.it>, 2017\n"
|
||||
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\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"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr "Quantità"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid ""
|
||||
"Removal priority that applies when the incoming dates are equal in both "
|
||||
"locations."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr ""
|
||||
67
stock_removal_location_by_priority/i18n/pt_BR.po
Normal file
67
stock_removal_location_by_priority/i18n/pt_BR.po
Normal file
@@ -0,0 +1,67 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
|
||||
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
|
||||
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/"
|
||||
"teams/23907/pt_BR/)\n"
|
||||
"Language: pt_BR\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"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr "Quants"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid ""
|
||||
"Removal priority that applies when the incoming dates are equal in both "
|
||||
"locations."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr ""
|
||||
67
stock_removal_location_by_priority/i18n/ro.po
Normal file
67
stock_removal_location_by_priority/i18n/ro.po
Normal file
@@ -0,0 +1,67 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
# Translators:
|
||||
# Dorin Hongu <dhongu@gmail.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
|
||||
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
|
||||
"Last-Translator: Dorin Hongu <dhongu@gmail.com>, 2017\n"
|
||||
"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n"
|
||||
"Language: ro\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?"
|
||||
"2:1));\n"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr "Poziții de stoc"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid ""
|
||||
"Removal priority that applies when the incoming dates are equal in both "
|
||||
"locations."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr ""
|
||||
68
stock_removal_location_by_priority/i18n/sl.po
Normal file
68
stock_removal_location_by_priority/i18n/sl.po
Normal file
@@ -0,0 +1,68 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
|
||||
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
|
||||
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>, 2017\n"
|
||||
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
|
||||
"Language: sl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
|
||||
"%100==4 ? 2 : 3);\n"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr "Lokacije inventarja"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr "Kvant"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid ""
|
||||
"Removal priority that applies when the incoming dates are equal in both "
|
||||
"locations."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr ""
|
||||
@@ -0,0 +1,60 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.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_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid "Removal priority that applies when the incoming dates are equal in both locations."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr ""
|
||||
|
||||
68
stock_removal_location_by_priority/i18n/zh_CN.po
Normal file
68
stock_removal_location_by_priority/i18n/zh_CN.po
Normal file
@@ -0,0 +1,68 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_removal_location_by_priority
|
||||
#
|
||||
# Translators:
|
||||
# liAnGjiA <liangjia@qq.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
|
||||
"PO-Revision-Date: 2019-10-16 16:05+0000\n"
|
||||
"Last-Translator: 黎伟杰 <674416404@qq.com>\n"
|
||||
"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/"
|
||||
"zh_CN/)\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_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr "配置设定"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
|
||||
msgid "Inventory Locations"
|
||||
msgstr "库存位置"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
|
||||
msgid "Quants"
|
||||
msgstr "数量分析"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
|
||||
msgid "Removal Priority"
|
||||
msgstr "移除优先级"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings__group_removal_priority
|
||||
msgid ""
|
||||
"Removal priority that applies when the incoming dates are equal in both "
|
||||
"locations."
|
||||
msgstr "当两个位置的传入日期相等时,将应用删除优先级。"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
|
||||
#, python-format
|
||||
msgid "Removal strategy %s not implemented."
|
||||
msgstr "未执行删除策略%s。"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location__removal_priority
|
||||
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant__removal_priority
|
||||
msgid "This priority applies when removing stock and incoming dates are equal."
|
||||
msgstr "当删除库存且输入日期相等时,将应用此优先级。"
|
||||
|
||||
#. module: stock_removal_location_by_priority
|
||||
#: model_terms:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
|
||||
msgid "Use <i>Removal Priority</i> in Locations"
|
||||
msgstr "使用 <i>移除优先级</i> 位置"
|
||||
54
stock_removal_location_by_priority/init_hook.py
Normal file
54
stock_removal_location_by_priority/init_hook.py
Normal file
@@ -0,0 +1,54 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def pre_init_hook(cr):
|
||||
"""
|
||||
The objective of this hook is to speed up the installation
|
||||
of the module on an existing Odoo instance.
|
||||
|
||||
Without this script, big databases can take a long time to install this
|
||||
module.
|
||||
"""
|
||||
set_stock_location_removal_priority_default(cr)
|
||||
set_stock_quant_removal_priority_default(cr)
|
||||
|
||||
|
||||
def set_stock_location_removal_priority_default(cr):
|
||||
cr.execute(
|
||||
"""SELECT column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name='stock_location' AND
|
||||
column_name='removal_priority'"""
|
||||
)
|
||||
if not cr.fetchone():
|
||||
logger.info("Creating field removal_priority on stock_location")
|
||||
cr.execute(
|
||||
"""
|
||||
ALTER TABLE stock_location
|
||||
ADD COLUMN removal_priority integer
|
||||
DEFAULT 10;
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def set_stock_quant_removal_priority_default(cr):
|
||||
cr.execute(
|
||||
"""SELECT column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name='stock_quant' AND
|
||||
column_name='removal_priority'"""
|
||||
)
|
||||
if not cr.fetchone():
|
||||
logger.info("Creating field removal_priority on stock_quant")
|
||||
cr.execute(
|
||||
"""
|
||||
ALTER TABLE stock_quant
|
||||
ADD COLUMN removal_priority integer
|
||||
DEFAULT 10;
|
||||
"""
|
||||
)
|
||||
5
stock_removal_location_by_priority/models/__init__.py
Normal file
5
stock_removal_location_by_priority/models/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import res_config_settings
|
||||
from . import stock_location
|
||||
from . import stock_quant
|
||||
@@ -0,0 +1,16 @@
|
||||
# Copyright 2017-18 Eficent Business and IT Consulting Services S.L.
|
||||
# (http://www.eficent.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
group_removal_priority = fields.Boolean(
|
||||
string="Removal Priority",
|
||||
implied_group="stock_removal_location_by_priority.group_removal_priority",
|
||||
help="Removal priority that applies when the incoming dates "
|
||||
"are equal in both locations.",
|
||||
)
|
||||
15
stock_removal_location_by_priority/models/stock_location.py
Normal file
15
stock_removal_location_by_priority/models/stock_location.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# (http://www.eficent.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class StockLocation(models.Model):
|
||||
_inherit = "stock.location"
|
||||
|
||||
removal_priority = fields.Integer(
|
||||
string="Removal Priority",
|
||||
default=10,
|
||||
help="This priority applies when removing stock and incoming dates are equal.",
|
||||
)
|
||||
28
stock_removal_location_by_priority/models/stock_quant.py
Normal file
28
stock_removal_location_by_priority/models/stock_quant.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Copyright 2017-18 Eficent Business and IT Consulting Services S.L.
|
||||
# (http://www.eficent.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class StockQuant(models.Model):
|
||||
_inherit = "stock.quant"
|
||||
|
||||
removal_priority = fields.Integer(
|
||||
related="location_id.removal_priority", store=True
|
||||
)
|
||||
|
||||
@api.model
|
||||
def _get_removal_strategy_order(self, removal_strategy):
|
||||
if self.user_has_groups(
|
||||
"stock_removal_location_by_priority.group_removal_priority"
|
||||
):
|
||||
if removal_strategy == "fifo":
|
||||
return "in_date ASC NULLS FIRST, removal_priority ASC, id"
|
||||
elif removal_strategy == "lifo":
|
||||
return "in_date DESC NULLS LAST, removal_priority ASC, id desc"
|
||||
raise UserError(
|
||||
_("Removal strategy %s not implemented.") % (removal_strategy,)
|
||||
)
|
||||
return super(StockQuant, self)._get_removal_strategy_order(removal_strategy)
|
||||
14
stock_removal_location_by_priority/readme/CONFIGURE.rst
Normal file
14
stock_removal_location_by_priority/readme/CONFIGURE.rst
Normal file
@@ -0,0 +1,14 @@
|
||||
You can activate the removal priority as follows:
|
||||
|
||||
#. Go to "Inventory > Configuration > Settings"
|
||||
#. In 'Operations' section, mark the "Removal Priority" option.
|
||||
#. You also need to activate the following settings in the section *Warehouse* if they are not yet:
|
||||
|
||||
#. Manage several locations using *Storage Locations* option.
|
||||
#. Advanced routing using "Multi-Step Routes" option.
|
||||
|
||||
Then, set the *Removal Priority* in the desired locations. Remember that a
|
||||
lower number means more priority:
|
||||
|
||||
#. Go to "Inventory > Configuration > Warehouse Management > Locations"
|
||||
#. In each Location form, in the Logistics section, put a Removal Priority.
|
||||
@@ -0,0 +1,3 @@
|
||||
* Miquel Raïch <miquel.raich@eficent.com>
|
||||
* Lois Rilo <lois.rilo@eficent.com>
|
||||
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
|
||||
@@ -0,0 +1,3 @@
|
||||
This module adds a removal priority field on stock locations.
|
||||
This priority applies when removing a product from different stock locations
|
||||
and the incoming dates are equal in both locations.
|
||||
3
stock_removal_location_by_priority/readme/USAGE.rst
Normal file
3
stock_removal_location_by_priority/readme/USAGE.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
After configure your locations properly, the system will select the quant
|
||||
at the location with more priority in case of equal date, no matter if you
|
||||
use FIFO or LIFO removal strategy.
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017-18 Eficent Business and IT Consulting Services S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="group_removal_priority" model="res.groups">
|
||||
<field name="name">Removal Priority</field>
|
||||
<field name="category_id" ref="base.module_category_hidden"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
BIN
stock_removal_location_by_priority/static/description/icon.png
Normal file
BIN
stock_removal_location_by_priority/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
450
stock_removal_location_by_priority/static/description/index.html
Normal file
450
stock_removal_location_by_priority/static/description/index.html
Normal file
@@ -0,0 +1,450 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Stock Removal Location by Priority</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="stock-removal-location-by-priority">
|
||||
<h1 class="title">Stock Removal Location by Priority</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_removal_location_by_priority"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_removal_location_by_priority"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module adds a removal priority field on stock locations.
|
||||
This priority applies when removing a product from different stock locations
|
||||
and the incoming dates are equal in both locations.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="configuration">
|
||||
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
|
||||
<p>You can activate the removal priority as follows:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Go to “Inventory > Configuration > Settings”</li>
|
||||
<li>In ‘Operations’ section, mark the “Removal Priority” option.</li>
|
||||
<li>You also need to activate the following settings in the section <em>Warehouse</em> if they are not yet:<ol class="arabic">
|
||||
<li>Manage several locations using <em>Storage Locations</em> option.</li>
|
||||
<li>Advanced routing using “Multi-Step Routes” option.</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
<p>Then, set the <em>Removal Priority</em> in the desired locations. Remember that a
|
||||
lower number means more priority:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Go to “Inventory > Configuration > Warehouse Management > Locations”</li>
|
||||
<li>In each Location form, in the Logistics section, put a Removal Priority.</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
|
||||
<p>After configure your locations properly, the system will select the quant
|
||||
at the location with more priority in case of equal date, no matter if you
|
||||
use FIFO or LIFO removal strategy.</p>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_removal_location_by_priority%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Eficent</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Miquel Raïch <<a class="reference external" href="mailto:miquel.raich@eficent.com">miquel.raich@eficent.com</a>></li>
|
||||
<li>Lois Rilo <<a class="reference external" href="mailto:lois.rilo@eficent.com">lois.rilo@eficent.com</a>></li>
|
||||
<li>Pimolnat Suntian <<a class="reference external" href="mailto:pimolnats@ecosoft.co.th">pimolnats@ecosoft.co.th</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||
<p>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.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_removal_location_by_priority">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
3
stock_removal_location_by_priority/tests/__init__.py
Normal file
3
stock_removal_location_by_priority/tests/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import test_stock_removal_location_by_priority
|
||||
@@ -0,0 +1,163 @@
|
||||
# Copyright 2017-18 Eficent Business and IT Consulting Services S.L.
|
||||
# (http://www.eficent.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from datetime import date
|
||||
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
class TestStockRemovalLocationByPriority(TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestStockRemovalLocationByPriority, self).setUp()
|
||||
self.res_users_model = self.env["res.users"]
|
||||
self.stock_location_model = self.env["stock.location"]
|
||||
self.stock_warehouse_model = self.env["stock.warehouse"]
|
||||
self.stock_picking_model = self.env["stock.picking"]
|
||||
self.stock_change_model = self.env["stock.change.product.qty"]
|
||||
self.product_model = self.env["product.product"]
|
||||
self.quant_model = self.env["stock.quant"]
|
||||
|
||||
self.picking_internal = self.env.ref("stock.picking_type_internal")
|
||||
self.picking_out = self.env.ref("stock.picking_type_out")
|
||||
self.location_supplier = self.env.ref("stock.stock_location_suppliers")
|
||||
|
||||
self.company = self.env.ref("base.main_company")
|
||||
grp_rem_priority = self.env.ref(
|
||||
"stock_removal_location_by_priority.group_removal_priority"
|
||||
)
|
||||
|
||||
# We assign the group to admin, as the _get_removal_strategy_order
|
||||
# method is going to be always executed as sudo.
|
||||
user_admin = self.env.ref("base.user_root")
|
||||
user_admin.groups_id = [(4, grp_rem_priority.id, 0)]
|
||||
|
||||
self.wh1 = self.stock_warehouse_model.create({"name": "WH1", "code": "WH1"})
|
||||
|
||||
# Removal strategies:
|
||||
self.fifo = self.env.ref("stock.removal_fifo")
|
||||
self.lifo = self.env.ref("stock.removal_lifo")
|
||||
|
||||
# Create locations:
|
||||
self.stock = self.stock_location_model.create(
|
||||
{"name": "Stock Base", "usage": "internal"}
|
||||
)
|
||||
self.shelf_A = self.stock_location_model.create(
|
||||
{
|
||||
"name": "Shelf_A",
|
||||
"usage": "internal",
|
||||
"location_id": self.stock.id,
|
||||
"removal_priority": 10,
|
||||
}
|
||||
)
|
||||
self.shelf_B = self.stock_location_model.create(
|
||||
{
|
||||
"name": "Shelf_B",
|
||||
"usage": "internal",
|
||||
"location_id": self.stock.id,
|
||||
"removal_priority": 5,
|
||||
}
|
||||
)
|
||||
self.stock_2 = self.stock_location_model.create(
|
||||
{"name": "Another Stock Location", "usage": "internal"}
|
||||
)
|
||||
|
||||
# Create a product:
|
||||
self.product_1 = self.product_model.create(
|
||||
{"name": "Test Product 1", "type": "product"}
|
||||
)
|
||||
|
||||
# Create quants:
|
||||
today = date.today()
|
||||
q1 = self.quant_model.create(
|
||||
{
|
||||
"product_id": self.product_1.id,
|
||||
"location_id": self.shelf_A.id,
|
||||
"quantity": 5.0,
|
||||
"in_date": today,
|
||||
}
|
||||
)
|
||||
q2 = self.quant_model.create(
|
||||
{
|
||||
"product_id": self.product_1.id,
|
||||
"location_id": self.shelf_B.id,
|
||||
"quantity": 5.0,
|
||||
"in_date": today,
|
||||
}
|
||||
)
|
||||
self.quants = q1 + q2
|
||||
|
||||
def _create_picking(self, picking_type, location, location_dest, qty):
|
||||
picking = self.stock_picking_model.create(
|
||||
{
|
||||
"picking_type_id": picking_type.id,
|
||||
"location_id": location.id,
|
||||
"location_dest_id": location_dest.id,
|
||||
"move_lines": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"name": "Test move",
|
||||
"product_id": self.product_1.id,
|
||||
"product_uom": self.product_1.uom_id.id,
|
||||
"product_uom_qty": qty,
|
||||
"location_id": location.id,
|
||||
"location_dest_id": location_dest.id,
|
||||
"price_unit": 2,
|
||||
},
|
||||
)
|
||||
],
|
||||
}
|
||||
)
|
||||
return picking
|
||||
|
||||
def test_01_stock_removal_location_by_priority_fifo(self):
|
||||
"""Tests removal priority with FIFO strategy."""
|
||||
self.stock.removal_strategy_id = self.fifo
|
||||
# quants must start unreserved
|
||||
for q in self.quants:
|
||||
self.assertEqual(q.reserved_quantity, 0.0)
|
||||
if q.location_id == self.shelf_A:
|
||||
self.assertEqual(q.removal_priority, 10)
|
||||
if q.location_id == self.shelf_B:
|
||||
self.assertEqual(q.removal_priority, 5)
|
||||
self.assertEqual(self.quants[0].in_date, self.quants[1].in_date)
|
||||
picking_1 = self._create_picking(
|
||||
self.picking_internal, self.stock, self.stock_2, 5
|
||||
)
|
||||
picking_1.flush()
|
||||
picking_1.action_confirm()
|
||||
picking_1.action_assign()
|
||||
|
||||
# quants must be reserved in Shelf B (lower removal_priority value).
|
||||
for q in self.quants:
|
||||
if q.location_id == self.shelf_A:
|
||||
self.assertEqual(q.reserved_quantity, 0.0)
|
||||
if q.location_id == self.shelf_B:
|
||||
self.assertEqual(q.reserved_quantity, 5.0)
|
||||
|
||||
def test_02_stock_removal_location_by_priority_lifo(self):
|
||||
"""Tests removal priority with LIFO strategy."""
|
||||
self.stock.removal_strategy_id = self.lifo
|
||||
# quants must start unreserved
|
||||
for q in self.quants:
|
||||
self.assertEqual(q.reserved_quantity, 0.0)
|
||||
if q.location_id == self.shelf_A:
|
||||
self.assertEqual(q.removal_priority, 10)
|
||||
if q.location_id == self.shelf_B:
|
||||
self.assertEqual(q.removal_priority, 5)
|
||||
self.assertEqual(self.quants[0].in_date, self.quants[1].in_date)
|
||||
picking_1 = self._create_picking(
|
||||
self.picking_internal, self.stock, self.stock_2, 5
|
||||
)
|
||||
picking_1.flush()
|
||||
picking_1.action_confirm()
|
||||
picking_1.action_assign()
|
||||
|
||||
# quants must be reserved in Shelf B (lower removal_priority value).
|
||||
for q in self.quants:
|
||||
if q.location_id == self.shelf_A:
|
||||
self.assertEqual(q.reserved_quantity, 0.0)
|
||||
if q.location_id == self.shelf_B:
|
||||
self.assertEqual(q.reserved_quantity, 5.0)
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017-18 Eficent Business and IT Consulting Services S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
|
||||
<record id="view_stock_config_settings" model="ir.ui.view">
|
||||
<field name="name">res.config.settings - removal_priority</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="stock.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@id='warning_info']" position="after">
|
||||
<div class="col-12 col-lg-6 o_setting_box" id="removal_priority">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_removal_priority"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_removal_priority"/>
|
||||
<div class="text-muted">
|
||||
Use <i>Removal Priority</i> in Locations
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_location_form" model="ir.ui.view">
|
||||
<field name="name">Location form - removal priority extension</field>
|
||||
<field name="model">stock.location</field>
|
||||
<field name="inherit_id" ref="stock.view_location_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="removal_strategy_id" position="after">
|
||||
<field name="removal_priority" groups="stock_removal_location_by_priority.group_removal_priority"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user