diff --git a/setup/stock_orderpoint_manual_procurement/odoo/addons/stock_orderpoint_manual_procurement b/setup/stock_orderpoint_manual_procurement/odoo/addons/stock_orderpoint_manual_procurement new file mode 120000 index 000000000..e0db4e52a --- /dev/null +++ b/setup/stock_orderpoint_manual_procurement/odoo/addons/stock_orderpoint_manual_procurement @@ -0,0 +1 @@ +../../../../stock_orderpoint_manual_procurement \ No newline at end of file diff --git a/setup/stock_orderpoint_manual_procurement/setup.py b/setup/stock_orderpoint_manual_procurement/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/stock_orderpoint_manual_procurement/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_orderpoint_manual_procurement/README.rst b/stock_orderpoint_manual_procurement/README.rst new file mode 100644 index 000000000..709a8938c --- /dev/null +++ b/stock_orderpoint_manual_procurement/README.rst @@ -0,0 +1,104 @@ +=================================== +Stock Orderpoint Manual Procurement +=================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/14.0/stock_orderpoint_manual_procurement + :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-14-0/stock-logistics-warehouse-14-0-stock_orderpoint_manual_procurement + :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/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows users to manually start procurements from the list of reordering rules, +based on the quantity that is recommended to be procured. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +If you want users to be able to change the recommended quantity to procure, +you should assign them to the security group +'Change quantity in manual procurements from reordering rules', +under 'Settings / Users / Users'. + +Usage +===== + +Go to 'Inventory > Master Data > Reordering Rules' and review the quantity recommended to be procured. +You can now start the procurement for a single or a list of reordering rules. + +The recommended quantity to procure is adjusted to the +procurement unit of measure indicated in the reordering rule. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ForgeFlow + +Contributors +~~~~~~~~~~~~ + +* Jordi Ballester Alomar +* Lois Rilo Antelo +* Bhavesh Odedra +* Kitti Upariphutthiphong +* Joan Sisquella Andrés + +* `Trobz `_: + + * Dung Tran + +Other credits +~~~~~~~~~~~~~ + +The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_orderpoint_manual_procurement/__init__.py b/stock_orderpoint_manual_procurement/__init__.py new file mode 100644 index 000000000..e1e144406 --- /dev/null +++ b/stock_orderpoint_manual_procurement/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models +from . import wizards diff --git a/stock_orderpoint_manual_procurement/__manifest__.py b/stock_orderpoint_manual_procurement/__manifest__.py new file mode 100644 index 000000000..015582ed5 --- /dev/null +++ b/stock_orderpoint_manual_procurement/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2016-20 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Stock Orderpoint Manual Procurement", + "summary": "Allows to create procurement orders from orderpoints instead " + "of relying only on the scheduler.", + "version": "14.0.1.0.0", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-logistics-warehouse", + "category": "Warehouse Management", + "depends": ["purchase_stock"], + "demo": ["demo/product.xml"], + "data": [ + "security/ir.model.access.csv", + "security/stock_orderpoint_manual_procurement_security.xml", + "wizards/make_procurement_orderpoint_view.xml", + "views/stock_warehouse_orderpoint_view.xml", + ], + "license": "AGPL-3", + "installable": True, + "application": False, +} diff --git a/stock_orderpoint_manual_procurement/demo/product.xml b/stock_orderpoint_manual_procurement/demo/product.xml new file mode 100644 index 000000000..bd9a8997f --- /dev/null +++ b/stock_orderpoint_manual_procurement/demo/product.xml @@ -0,0 +1,10 @@ + + + + + + 3 + 1 + 72 + + diff --git a/stock_orderpoint_manual_procurement/i18n/stock_orderpoint_manual_procurement.pot b/stock_orderpoint_manual_procurement/i18n/stock_orderpoint_manual_procurement.pot new file mode 100644 index 000000000..a958db69a --- /dev/null +++ b/stock_orderpoint_manual_procurement/i18n/stock_orderpoint_manual_procurement.pot @@ -0,0 +1,190 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_orderpoint_manual_procurement +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.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_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "Cancel" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:res.groups,name:stock_orderpoint_manual_procurement.group_change_orderpoint_procure_qty +msgid "Change quantity in manual procurements from reordering rules" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_warehouse_orderpoint_tree +msgid "Create Procurement" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__create_uid +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__create_uid +msgid "Created by" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__create_date +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__create_date +msgid "Created on" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__display_name +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "Execute" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__id +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__id +msgid "ID" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__item_ids +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "Items" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint____last_update +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__write_uid +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__write_date +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__write_date +msgid "Last Updated on" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__location_id +msgid "Location" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model,name:stock_orderpoint_manual_procurement.model_make_procurement_orderpoint_item +msgid "Make Procurements from Orderpoint Item" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model,name:stock_orderpoint_manual_procurement.model_make_procurement_orderpoint +msgid "Make Procurements from Orderpoints" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model,name:stock_orderpoint_manual_procurement.model_stock_warehouse_orderpoint +msgid "Minimum Inventory Rule" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: code:addons/stock_orderpoint_manual_procurement/wizards/make_procurement_orderpoint.py:0 +#, python-format +msgid "No reordering rule found!" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__date_planned +msgid "Planned Date" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_stock_warehouse_orderpoint__procure_recommended_qty +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_stock_warehouse_orderpoint_template__procure_recommended_qty +msgid "Procure Recommendation" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "Procurement Request" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__product_id +msgid "Product" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__qty +msgid "Qty" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__qty_without_security +msgid "Quantity" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: code:addons/stock_orderpoint_manual_procurement/wizards/make_procurement_orderpoint.py:0 +#, python-format +msgid "Quantity must be positive." +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_stock_warehouse_orderpoint__procure_recommended_date +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_stock_warehouse_orderpoint_template__procure_recommended_date +msgid "Recommended Request Date" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__orderpoint_id +msgid "Reordering rule" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.actions.act_window,name:stock_orderpoint_manual_procurement.act_make_procurement_from_orderpoint +msgid "Request Procurement" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__uom_id +msgid "Unit of Measure" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "" +"Use this assistant to generate a procurement request for this\n" +" stock buffer. According to the product configuration,\n" +" this may trigger a draft purchase order, a manufacturing\n" +" order or a transfer picking." +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__warehouse_id +msgid "Warehouse" +msgstr "" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__wiz_id +msgid "Wizard" +msgstr "" diff --git a/stock_orderpoint_manual_procurement/i18n/zh_CN.po b/stock_orderpoint_manual_procurement/i18n/zh_CN.po new file mode 100644 index 000000000..e0cfed55b --- /dev/null +++ b/stock_orderpoint_manual_procurement/i18n/zh_CN.po @@ -0,0 +1,196 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_orderpoint_manual_procurement +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-10-12 16:36+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_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "Cancel" +msgstr "取消" + +#. module: stock_orderpoint_manual_procurement +#: model:res.groups,name:stock_orderpoint_manual_procurement.group_change_orderpoint_procure_qty +msgid "Change quantity in manual procurements from reordering rules" +msgstr "从重新订购规则更改手动采购的数量" + +#. module: stock_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_warehouse_orderpoint_tree +msgid "Create Procurement" +msgstr "创建补货" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__create_uid +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__create_uid +msgid "Created by" +msgstr "创建者" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__create_date +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__create_date +msgid "Created on" +msgstr "创建时间" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__display_name +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__display_name +msgid "Display Name" +msgstr "显示名称" + +#. module: stock_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "Execute" +msgstr "执行" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__id +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__id +msgid "ID" +msgstr "ID" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__item_ids +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "Items" +msgstr "项" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint____last_update +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item____last_update +msgid "Last Modified on" +msgstr "最后修改时间" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__write_uid +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__write_uid +msgid "Last Updated by" +msgstr "最后更新者" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint__write_date +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__write_date +msgid "Last Updated on" +msgstr "最后更新时间" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__location_id +msgid "Location" +msgstr "位置" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model,name:stock_orderpoint_manual_procurement.model_make_procurement_orderpoint_item +msgid "Make Procurements from Orderpoint Item" +msgstr "从订单点项进行补货" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model,name:stock_orderpoint_manual_procurement.model_make_procurement_orderpoint +msgid "Make Procurements from Orderpoints" +msgstr "从订单点项进行补货" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model,name:stock_orderpoint_manual_procurement.model_stock_warehouse_orderpoint +msgid "Minimum Inventory Rule" +msgstr "最小库存规则" + +#. module: stock_orderpoint_manual_procurement +#: code:addons/stock_orderpoint_manual_procurement/wizards/make_procurement_orderpoint.py:0 +#, python-format +msgid "No reordering rule found!" +msgstr "找不到重新订购规则!" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__date_planned +msgid "Planned Date" +msgstr "计划日期" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_stock_warehouse_orderpoint__procure_recommended_qty +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_stock_warehouse_orderpoint_template__procure_recommended_qty +msgid "Procure Recommendation" +msgstr "获取推荐" + +#. module: stock_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "Procurement Request" +msgstr "补货请求" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__product_id +msgid "Product" +msgstr "产品" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__qty +msgid "Qty" +msgstr "数量" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__qty_without_security +msgid "Quantity" +msgstr "数量" + +#. module: stock_orderpoint_manual_procurement +#: code:addons/stock_orderpoint_manual_procurement/wizards/make_procurement_orderpoint.py:0 +#, python-format +msgid "Quantity must be positive." +msgstr "数量必须为正数。" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_stock_warehouse_orderpoint__procure_recommended_date +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_stock_warehouse_orderpoint_template__procure_recommended_date +msgid "Recommended Request Date" +msgstr "引用请求日期" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__orderpoint_id +msgid "Reordering rule" +msgstr "重新订购规则" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.actions.act_window,name:stock_orderpoint_manual_procurement.act_make_procurement_from_orderpoint +msgid "Request Procurement" +msgstr "请求补货" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__uom_id +msgid "Unit of Measure" +msgstr "计量单位" + +#. module: stock_orderpoint_manual_procurement +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procure_without_security +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_manual_procurement.view_make_procurment_buffer_wizard +msgid "" +"Use this assistant to generate a procurement request for this\n" +" stock buffer. According to the product configuration,\n" +" this may trigger a draft purchase order, a " +"manufacturing\n" +" order or a transfer picking." +msgstr "" +"使用此助手为此库存缓冲区生成采购请求。根据产品配置,这可能会触发采购订单草" +"案、生产订单或转移领料。" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__warehouse_id +msgid "Warehouse" +msgstr "仓库" + +#. module: stock_orderpoint_manual_procurement +#: model:ir.model.fields,field_description:stock_orderpoint_manual_procurement.field_make_procurement_orderpoint_item__wiz_id +msgid "Wizard" +msgstr "向导" diff --git a/stock_orderpoint_manual_procurement/models/__init__.py b/stock_orderpoint_manual_procurement/models/__init__.py new file mode 100644 index 000000000..14b7c7a48 --- /dev/null +++ b/stock_orderpoint_manual_procurement/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import stock_warehouse_orderpoint diff --git a/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py b/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py new file mode 100644 index 000000000..7385cc89b --- /dev/null +++ b/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py @@ -0,0 +1,59 @@ +# Copyright 2016-20 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + + +from odoo import api, fields, models +from odoo.tools import float_compare, float_round + + +class StockWarehouseOrderpoint(models.Model): + _inherit = "stock.warehouse.orderpoint" + + procure_recommended_qty = fields.Float( + string="Procure Recommendation", + compute="_compute_procure_recommended", + digits="Product Unit of Measure", + ) + procure_recommended_date = fields.Date( + string="Recommended Request Date", compute="_compute_procure_recommended" + ) + + def _get_procure_recommended_qty(self, virtual_qty, op_qtys): + self.ensure_one() + procure_recommended_qty = 0.0 + qty = max(self.product_min_qty, self.product_max_qty) - virtual_qty + remainder = self.qty_multiple > 0 and qty % self.qty_multiple or 0.0 + if ( + float_compare(remainder, 0.0, precision_rounding=self.product_uom.rounding) + > 0 + ): + qty += self.qty_multiple - remainder + + if float_compare(qty, 0.0, precision_rounding=self.product_uom.rounding) <= 0: + return procure_recommended_qty + + qty -= op_qtys[self.id] + qty_rounded = float_round(qty, precision_rounding=self.product_uom.rounding) + if qty_rounded > 0: + procure_recommended_qty = qty_rounded + return procure_recommended_qty + + @api.depends("product_min_qty", "product_id", "qty_multiple") + def _compute_procure_recommended(self): + op_qtys = self._quantity_in_progress() + for op in self: + qty = 0.0 + virtual_qty = op.with_context( + location=op.location_id.id + ).product_id.virtual_available + if ( + float_compare( + virtual_qty, + op.product_min_qty, + precision_rounding=op.product_uom.rounding or 0.01, + ) + < 0 + ): + qty = op._get_procure_recommended_qty(virtual_qty, op_qtys) + op.procure_recommended_qty = qty + op.procure_recommended_date = op.lead_days_date diff --git a/stock_orderpoint_manual_procurement/readme/CONFIGURE.rst b/stock_orderpoint_manual_procurement/readme/CONFIGURE.rst new file mode 100644 index 000000000..138b1bb04 --- /dev/null +++ b/stock_orderpoint_manual_procurement/readme/CONFIGURE.rst @@ -0,0 +1,4 @@ +If you want users to be able to change the recommended quantity to procure, +you should assign them to the security group +'Change quantity in manual procurements from reordering rules', +under 'Settings / Users / Users'. diff --git a/stock_orderpoint_manual_procurement/readme/CONTRIBUTORS.rst b/stock_orderpoint_manual_procurement/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..9ef9ec677 --- /dev/null +++ b/stock_orderpoint_manual_procurement/readme/CONTRIBUTORS.rst @@ -0,0 +1,9 @@ +* Jordi Ballester Alomar +* Lois Rilo Antelo +* Bhavesh Odedra +* Kitti Upariphutthiphong +* Joan Sisquella Andrés + +* `Trobz `_: + + * Dung Tran diff --git a/stock_orderpoint_manual_procurement/readme/CREDITS.rst b/stock_orderpoint_manual_procurement/readme/CREDITS.rst new file mode 100644 index 000000000..f37ebe757 --- /dev/null +++ b/stock_orderpoint_manual_procurement/readme/CREDITS.rst @@ -0,0 +1 @@ +The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp diff --git a/stock_orderpoint_manual_procurement/readme/DESCRIPTION.rst b/stock_orderpoint_manual_procurement/readme/DESCRIPTION.rst new file mode 100644 index 000000000..7134f714c --- /dev/null +++ b/stock_orderpoint_manual_procurement/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows users to manually start procurements from the list of reordering rules, +based on the quantity that is recommended to be procured. diff --git a/stock_orderpoint_manual_procurement/readme/USAGE.rst b/stock_orderpoint_manual_procurement/readme/USAGE.rst new file mode 100644 index 000000000..adebc5c42 --- /dev/null +++ b/stock_orderpoint_manual_procurement/readme/USAGE.rst @@ -0,0 +1,5 @@ +Go to 'Inventory > Master Data > Reordering Rules' and review the quantity recommended to be procured. +You can now start the procurement for a single or a list of reordering rules. + +The recommended quantity to procure is adjusted to the +procurement unit of measure indicated in the reordering rule. diff --git a/stock_orderpoint_manual_procurement/security/ir.model.access.csv b/stock_orderpoint_manual_procurement/security/ir.model.access.csv new file mode 100644 index 000000000..837449207 --- /dev/null +++ b/stock_orderpoint_manual_procurement/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_make_procurement_orderpoint_wizard,make.procurement.orderpoint wizard,model_make_procurement_orderpoint,stock.group_stock_user,1,1,1,1 +access_make_procurement_orderpoint_item_wizard,make.procurement.orderpoint.item wizard,model_make_procurement_orderpoint_item,stock.group_stock_user,1,1,1,1 diff --git a/stock_orderpoint_manual_procurement/security/stock_orderpoint_manual_procurement_security.xml b/stock_orderpoint_manual_procurement/security/stock_orderpoint_manual_procurement_security.xml new file mode 100644 index 000000000..d84251a3f --- /dev/null +++ b/stock_orderpoint_manual_procurement/security/stock_orderpoint_manual_procurement_security.xml @@ -0,0 +1,12 @@ + + + + + Change quantity in manual procurements from reordering rules + + + + + diff --git a/stock_orderpoint_manual_procurement/static/description/icon.png b/stock_orderpoint_manual_procurement/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/stock_orderpoint_manual_procurement/static/description/icon.png differ diff --git a/stock_orderpoint_manual_procurement/static/description/index.html b/stock_orderpoint_manual_procurement/static/description/index.html new file mode 100644 index 000000000..f033615a1 --- /dev/null +++ b/stock_orderpoint_manual_procurement/static/description/index.html @@ -0,0 +1,449 @@ + + + + + + +Stock Orderpoint Manual Procurement + + + +
+

Stock Orderpoint Manual Procurement

+ + +

Beta License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

This module allows users to manually start procurements from the list of reordering rules, +based on the quantity that is recommended to be procured.

+

Table of contents

+ +
+

Configuration

+

If you want users to be able to change the recommended quantity to procure, +you should assign them to the security group +‘Change quantity in manual procurements from reordering rules’, +under ‘Settings / Users / Users’.

+
+
+

Usage

+

Go to ‘Inventory > Master Data > Reordering Rules’ and review the quantity recommended to be procured. +You can now start the procurement for a single or a list of reordering rules.

+

The recommended quantity to procure is adjusted to the +procurement unit of measure indicated in the reordering rule.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ForgeFlow
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp

+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/stock_orderpoint_manual_procurement/tests/__init__.py b/stock_orderpoint_manual_procurement/tests/__init__.py new file mode 100644 index 000000000..7d9283684 --- /dev/null +++ b/stock_orderpoint_manual_procurement/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import test_stock_orderpoint_manual_procurement diff --git a/stock_orderpoint_manual_procurement/tests/test_stock_orderpoint_manual_procurement.py b/stock_orderpoint_manual_procurement/tests/test_stock_orderpoint_manual_procurement.py new file mode 100644 index 000000000..2d500d5db --- /dev/null +++ b/stock_orderpoint_manual_procurement/tests/test_stock_orderpoint_manual_procurement.py @@ -0,0 +1,172 @@ +# Copyright 2016-20 ForgeFlow S.L. (https://www.forgeflow.com) +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from datetime import timedelta + +from odoo import fields +from odoo.tests import common + + +class TestStockWarehouseOrderpoint(common.TransactionCase): + def setUp(self): + super(TestStockWarehouseOrderpoint, self).setUp() + + # Refs + self.group_stock_manager = self.env.ref("stock.group_stock_manager") + self.group_purchase_manager = self.env.ref("purchase.group_purchase_manager") + self.group_change_procure_qty = self.env.ref( + "stock_orderpoint_manual_procurement." "group_change_orderpoint_procure_qty" + ) + self.company1 = self.env.ref("base.main_company") + + # Get required Model + self.reordering_rule_model = self.env["stock.warehouse.orderpoint"] + self.product_model = self.env["product.product"] + self.purchase_model = self.env["purchase.order"] + self.purchase_line_model = self.env["purchase.order.line"] + self.user_model = self.env["res.users"] + self.product_ctg_model = self.env["product.category"] + self.stock_change_model = self.env["stock.change.product.qty"] + self.make_procurement_orderpoint_model = self.env["make.procurement.orderpoint"] + + # Create users + self.user = self._create_user( + "user_1", + [ + self.group_stock_manager, + self.group_change_procure_qty, + self.group_purchase_manager, + ], + self.company1, + ) + # Get required Model data + self.product_uom = self.env.ref("uom.product_uom_unit") + self.location = self.env.ref("stock.stock_location_stock") + self.product = self.env.ref("product.product_product_7") + + # Create vendor and supplier info + test_seller = self.env["res.partner"].create({"name": "Test seller"}) + self.vendor = self.env["product.supplierinfo"].create( + {"name": test_seller.id, "price": 8.0} + ) + + # Create Product category and Product + self.product_ctg = self._create_product_category() + self.product = self._create_product() + + # Add default quantity + quantity = 20.00 + self._update_product_qty(self.product, quantity) + + # Create Reordering Rule + self.reorder = self.create_orderpoint() + + def _create_user(self, login, groups, company): + """ Create a user.""" + group_ids = [group.id for group in groups] + user = self.user_model.with_context({"no_reset_password": True}).create( + { + "name": "Test User", + "login": login, + "password": "demo", + "email": "test@yourcompany.com", + "company_id": company.id, + "company_ids": [(4, company.id)], + "groups_id": [(6, 0, group_ids)], + } + ) + return user + + def _create_product_category(self): + """Create a Product Category.""" + product_ctg = self.product_ctg_model.create({"name": "test_product_ctg"}) + return product_ctg + + def _create_product(self): + """Create a Product.""" + product = self.product_model.create( + { + "name": "Test Product", + "categ_id": self.product_ctg.id, + "type": "product", + "uom_id": self.product_uom.id, + "variant_seller_ids": [(6, 0, [self.vendor.id])], + } + ) + return product + + def _update_product_qty(self, product, quantity): + """Update Product quantity.""" + change_product_qty = self.stock_change_model.create( + { + "product_id": product.id, + "product_tmpl_id": product.product_tmpl_id.id, + "new_quantity": quantity, + } + ) + change_product_qty.change_product_qty() + return change_product_qty + + def create_orderpoint(self): + """Create a Reordering Rule""" + reorder = self.reordering_rule_model.with_user(self.user).create( + { + "name": "Order-point", + "product_id": self.product.id, + "product_min_qty": "100", + "product_max_qty": "500", + "qty_multiple": "1", + } + ) + return reorder + + def create_orderpoint_procurement(self, manual_date=None): + """Make Procurement from Reordering Rule""" + context = { + "active_model": "stock.warehouse.orderpoint", + "active_ids": self.reorder.ids, + "active_id": self.reorder.id, + } + wizard = ( + self.make_procurement_orderpoint_model.with_user(self.user) + .with_context(context) + .create({}) + ) + if manual_date: + wizard.item_ids.write({"date_planned": manual_date}) + wizard.make_procurement() + return wizard + + def test_manual_procurement(self): + """Test Manual Procurement created from Order-Point""" + + # Create Manual Procurement from order-point procured quantity + self.create_orderpoint_procurement() + + # As per route configuration, it will create Purchase order + # Assert that Procurement is created with the desired quantity + purchase = self.purchase_model.search([("origin", "ilike", self.reorder.name)]) + self.assertEquals(len(purchase), 1) + purchase_line = self.purchase_line_model.search( + [("orderpoint_id", "=", self.reorder.id), ("order_id", "=", purchase.id)] + ) + self.assertEquals(len(purchase_line), 1) + self.reorder._compute_procure_recommended() + self.assertNotEqual( + self.reorder.procure_recommended_qty, purchase_line.product_qty + ) + self.assertEqual(purchase_line.product_qty, 480.0) + + def test_manual_procurement_modified_date(self): + """Test manual procurement created from an orderpoint with + modified date.""" + manual_date = fields.Date.from_string(fields.Date.today()) + timedelta(days=30) + self.create_orderpoint_procurement(manual_date) + purchase = self.purchase_model.search([("origin", "ilike", self.reorder.name)]) + purchase_line = self.purchase_line_model.search( + [("orderpoint_id", "=", self.reorder.id), ("order_id", "=", purchase.id)] + ) + self.assertEquals(len(purchase_line), 1) + pol_date = fields.Date.from_string(purchase_line.date_planned) + self.assertEquals(pol_date, manual_date) diff --git a/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml b/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml new file mode 100644 index 000000000..0b9f3a0a4 --- /dev/null +++ b/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml @@ -0,0 +1,22 @@ + + + + stock.warehouse.orderpoint.tree + stock.warehouse.orderpoint + + + + + +