From 9ebef685a6dca036fb35c8e097da93a56883cb44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?D=C5=A9ng=20=28Tr=E1=BA=A7n=20=C4=90=C3=ACnh=29?=
Date: Thu, 6 May 2021 12:02:42 +0700
Subject: [PATCH] [MIG] stock_orderpoint_manual_procurement: Migration to 14.0
---
.../README.rst | 19 ++++++++++++++-----
.../__manifest__.py | 3 ++-
.../models/stock_warehouse_orderpoint.py | 5 ++---
.../readme/CONTRIBUTORS.rst | 4 ++++
.../readme/CREDITS.rst | 1 +
.../security/ir.model.access.csv | 3 +++
...orderpoint_manual_procurement_security.xml | 2 ++
.../static/description/index.html | 19 ++++++++++++++-----
.../views/stock_warehouse_orderpoint_view.xml | 8 +++++---
9 files changed, 47 insertions(+), 17 deletions(-)
create mode 100644 stock_orderpoint_manual_procurement/readme/CREDITS.rst
create mode 100644 stock_orderpoint_manual_procurement/security/ir.model.access.csv
diff --git a/stock_orderpoint_manual_procurement/README.rst b/stock_orderpoint_manual_procurement/README.rst
index 1a67e5213..709a8938c 100644
--- a/stock_orderpoint_manual_procurement/README.rst
+++ b/stock_orderpoint_manual_procurement/README.rst
@@ -14,13 +14,13 @@ Stock Orderpoint Manual Procurement
: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_orderpoint_manual_procurement
+ :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-13-0/stock-logistics-warehouse-13-0-stock_orderpoint_manual_procurement
+ :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/13.0
+ :target: https://runbot.odoo-community.org/runbot/153/14.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -56,7 +56,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -77,6 +77,15 @@ Contributors
* 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
~~~~~~~~~~~
@@ -90,6 +99,6 @@ 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.
+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/__manifest__.py b/stock_orderpoint_manual_procurement/__manifest__.py
index 7cb483876..015582ed5 100644
--- a/stock_orderpoint_manual_procurement/__manifest__.py
+++ b/stock_orderpoint_manual_procurement/__manifest__.py
@@ -5,13 +5,14 @@
"name": "Stock Orderpoint Manual Procurement",
"summary": "Allows to create procurement orders from orderpoints instead "
"of relying only on the scheduler.",
- "version": "13.0.1.0.0",
+ "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",
diff --git a/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py b/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py
index 81d8dc5d6..7385cc89b 100644
--- a/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py
+++ b/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py
@@ -1,7 +1,6 @@
# Copyright 2016-20 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-from datetime import datetime
from odoo import api, fields, models
from odoo.tools import float_compare, float_round
@@ -51,10 +50,10 @@ class StockWarehouseOrderpoint(models.Model):
float_compare(
virtual_qty,
op.product_min_qty,
- precision_rounding=op.product_uom.rounding,
+ 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._get_date_planned(qty, datetime.today())
+ op.procure_recommended_date = op.lead_days_date
diff --git a/stock_orderpoint_manual_procurement/readme/CONTRIBUTORS.rst b/stock_orderpoint_manual_procurement/readme/CONTRIBUTORS.rst
index 2f6d749d2..9ef9ec677 100644
--- a/stock_orderpoint_manual_procurement/readme/CONTRIBUTORS.rst
+++ b/stock_orderpoint_manual_procurement/readme/CONTRIBUTORS.rst
@@ -3,3 +3,7 @@
* 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/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
index 56bd905b4..d84251a3f 100644
--- a/stock_orderpoint_manual_procurement/security/stock_orderpoint_manual_procurement_security.xml
+++ b/stock_orderpoint_manual_procurement/security/stock_orderpoint_manual_procurement_security.xml
@@ -1,5 +1,6 @@
+
+
diff --git a/stock_orderpoint_manual_procurement/static/description/index.html b/stock_orderpoint_manual_procurement/static/description/index.html
index daec54b45..f033615a1 100644
--- a/stock_orderpoint_manual_procurement/static/description/index.html
+++ b/stock_orderpoint_manual_procurement/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
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
@@ -379,7 +379,8 @@ based on the quantity that is recommended to be procured.
Credits
@@ -403,7 +404,7 @@ procurement unit of measure indicated in the reordering rule.
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 .
+feedback .
Do not contact contributors directly about support or help with technical issues.
+
+
+
The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp
+
-
+
This module is maintained by the OCA.
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.
+
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/views/stock_warehouse_orderpoint_view.xml b/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml
index 834331ffc..0b9f3a0a4 100644
--- a/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml
+++ b/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml
@@ -3,16 +3,18 @@
stock.warehouse.orderpoint.tree
stock.warehouse.orderpoint
-
+
-
+