odoo-addon-stock-request 17.0.1.0.1__py3-none-any.whl → 17.0.1.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/stock_request/README.rst +1 -1
- odoo/addons/stock_request/__manifest__.py +1 -1
- odoo/addons/stock_request/models/stock_request.py +9 -2
- odoo/addons/stock_request/models/stock_request_abstract.py +3 -1
- odoo/addons/stock_request/models/stock_request_allocation.py +3 -1
- odoo/addons/stock_request/static/description/index.html +1 -1
- odoo/addons/stock_request/tests/test_stock_request.py +42 -0
- {odoo_addon_stock_request-17.0.1.0.1.dist-info → odoo_addon_stock_request-17.0.1.0.2.dist-info}/METADATA +2 -2
- {odoo_addon_stock_request-17.0.1.0.1.dist-info → odoo_addon_stock_request-17.0.1.0.2.dist-info}/RECORD +11 -11
- {odoo_addon_stock_request-17.0.1.0.1.dist-info → odoo_addon_stock_request-17.0.1.0.2.dist-info}/WHEEL +0 -0
- {odoo_addon_stock_request-17.0.1.0.1.dist-info → odoo_addon_stock_request-17.0.1.0.2.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ Stock Request
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
8
8
|
!! changes will be overwritten. !!
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
10
|
-
!! source digest: sha256:
|
10
|
+
!! source digest: sha256:a86cc4bdbce29feccc163145dbd137fb52c2ebdc67529dc75c7505d8ca8c7d65
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
12
12
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
@@ -4,7 +4,7 @@
|
|
4
4
|
{
|
5
5
|
"name": "Stock Request",
|
6
6
|
"summary": "Internal request for stock",
|
7
|
-
"version": "17.0.1.0.
|
7
|
+
"version": "17.0.1.0.2",
|
8
8
|
"license": "LGPL-3",
|
9
9
|
"website": "https://github.com/OCA/stock-logistics-request",
|
10
10
|
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
@@ -148,9 +148,15 @@ class StockRequest(models.Model):
|
|
148
148
|
done_qty = abs(other_qty - incoming_qty)
|
149
149
|
open_qty = sum(request.allocation_ids.mapped("open_product_qty"))
|
150
150
|
uom = request.product_id.uom_id
|
151
|
-
request.qty_done = uom._compute_quantity(
|
151
|
+
request.qty_done = uom._compute_quantity(
|
152
|
+
done_qty,
|
153
|
+
request.product_uom_id,
|
154
|
+
rounding_method="HALF-UP",
|
155
|
+
)
|
152
156
|
request.qty_in_progress = uom._compute_quantity(
|
153
|
-
open_qty,
|
157
|
+
open_qty,
|
158
|
+
request.product_uom_id,
|
159
|
+
rounding_method="HALF-UP",
|
154
160
|
)
|
155
161
|
request.qty_cancelled = (
|
156
162
|
max(
|
@@ -158,6 +164,7 @@ class StockRequest(models.Model):
|
|
158
164
|
uom._compute_quantity(
|
159
165
|
request.product_qty - done_qty - open_qty,
|
160
166
|
request.product_uom_id,
|
167
|
+
rounding_method="HALF-UP",
|
161
168
|
),
|
162
169
|
)
|
163
170
|
if request.allocation_ids
|
@@ -32,7 +32,9 @@ class StockRequest(models.AbstractModel):
|
|
32
32
|
def _compute_product_qty(self):
|
33
33
|
for rec in self:
|
34
34
|
rec.product_qty = rec.product_uom_id._compute_quantity(
|
35
|
-
rec.product_uom_qty,
|
35
|
+
rec.product_uom_qty,
|
36
|
+
rec.product_id.product_tmpl_id.uom_id,
|
37
|
+
rounding_method="HALF-UP",
|
36
38
|
)
|
37
39
|
|
38
40
|
name = fields.Char(copy=False, required=True, readonly=True, default="/")
|
@@ -69,7 +69,9 @@ class StockRequestAllocation(models.Model):
|
|
69
69
|
def _compute_requested_product_qty(self):
|
70
70
|
for rec in self:
|
71
71
|
rec.requested_product_qty = rec.product_uom_id._compute_quantity(
|
72
|
-
rec.requested_product_uom_qty,
|
72
|
+
rec.requested_product_uom_qty,
|
73
|
+
rec.product_id.uom_id,
|
74
|
+
rounding_method="HALF-UP",
|
73
75
|
)
|
74
76
|
|
75
77
|
@api.depends(
|
@@ -366,7 +366,7 @@ ul.auto-toc {
|
|
366
366
|
!! This file is generated by oca-gen-addon-readme !!
|
367
367
|
!! changes will be overwritten. !!
|
368
368
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
369
|
-
!! source digest: sha256:
|
369
|
+
!! source digest: sha256:a86cc4bdbce29feccc163145dbd137fb52c2ebdc67529dc75c7505d8ca8c7d65
|
370
370
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
371
371
|
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-request/tree/17.0/stock_request"><img alt="OCA/stock-logistics-request" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--request-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-request-17-0/stock-logistics-request-17-0-stock_request"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-request&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
372
372
|
<p>This module was written to allow users to request products that are
|
@@ -1341,3 +1341,45 @@ class TestStockRequestOrderState(TestStockRequest):
|
|
1341
1341
|
self.assertEqual(self.request_a.state, "cancel")
|
1342
1342
|
self.assertEqual(self.request_b.state, "done")
|
1343
1343
|
self.assertEqual(self.order.state, "done")
|
1344
|
+
|
1345
|
+
def test_rounding_half_up_in_progress_01(self):
|
1346
|
+
product_half_up = self._create_product(
|
1347
|
+
"HALFUP", "HalfUp Product", self.main_company.id
|
1348
|
+
)
|
1349
|
+
product_half_up.uom_id.rounding = 1.0
|
1350
|
+
vals = {
|
1351
|
+
"product_id": product_half_up.id,
|
1352
|
+
"product_uom_id": product_half_up.uom_id.id,
|
1353
|
+
"product_uom_qty": 0.5,
|
1354
|
+
"company_id": self.main_company.id,
|
1355
|
+
"warehouse_id": self.warehouse.id,
|
1356
|
+
"location_id": self.virtual_loc.id,
|
1357
|
+
}
|
1358
|
+
stock_request = self.stock_request.create(vals)
|
1359
|
+
stock_request.action_confirm()
|
1360
|
+
self.assertEqual(
|
1361
|
+
stock_request.qty_in_progress,
|
1362
|
+
1,
|
1363
|
+
"Quantity in progress should be the rounded up after confirmation",
|
1364
|
+
)
|
1365
|
+
|
1366
|
+
def test_rounding_half_up_in_progress_02(self):
|
1367
|
+
product_half_up = self._create_product(
|
1368
|
+
"HALFUP", "HalfUp Product", self.main_company.id
|
1369
|
+
)
|
1370
|
+
product_half_up.uom_id.rounding = 1.0
|
1371
|
+
vals = {
|
1372
|
+
"product_id": product_half_up.id,
|
1373
|
+
"product_uom_id": product_half_up.uom_id.id,
|
1374
|
+
"product_uom_qty": 1.49,
|
1375
|
+
"company_id": self.main_company.id,
|
1376
|
+
"warehouse_id": self.warehouse.id,
|
1377
|
+
"location_id": self.virtual_loc.id,
|
1378
|
+
}
|
1379
|
+
stock_request = self.stock_request.create(vals)
|
1380
|
+
stock_request.action_confirm()
|
1381
|
+
self.assertEqual(
|
1382
|
+
stock_request.qty_in_progress,
|
1383
|
+
1,
|
1384
|
+
"Quantity in progress should be the rounded down after confirmation",
|
1385
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: odoo-addon-stock_request
|
3
|
-
Version: 17.0.1.0.
|
3
|
+
Version: 17.0.1.0.2
|
4
4
|
Requires-Python: >=3.10
|
5
5
|
Requires-Dist: odoo>=17.0a,<17.1dev
|
6
6
|
Summary: Internal request for stock
|
@@ -22,7 +22,7 @@ Stock Request
|
|
22
22
|
!! This file is generated by oca-gen-addon-readme !!
|
23
23
|
!! changes will be overwritten. !!
|
24
24
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
25
|
-
!! source digest: sha256:
|
25
|
+
!! source digest: sha256:a86cc4bdbce29feccc163145dbd137fb52c2ebdc67529dc75c7505d8ca8c7d65
|
26
26
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
27
27
|
|
28
28
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
@@ -1,6 +1,6 @@
|
|
1
|
-
odoo/addons/stock_request/README.rst,sha256=
|
1
|
+
odoo/addons/stock_request/README.rst,sha256=pg8wo7Tw9nEMtp01V-yTP8W6GobfbRjVNBnQscZrRXE,4877
|
2
2
|
odoo/addons/stock_request/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
|
3
|
-
odoo/addons/stock_request/__manifest__.py,sha256=
|
3
|
+
odoo/addons/stock_request/__manifest__.py,sha256=VrXUIaOTsIdEVHzPYvdXd6XvoDrGD4TxadUFzSpt5vA,949
|
4
4
|
odoo/addons/stock_request/data/stock_request_sequence_data.xml,sha256=MKvzK__cH1gecmyqWK6Vj7yJ0o1-oKbqy2ydNoTUhs0,683
|
5
5
|
odoo/addons/stock_request/i18n/ca.po,sha256=-zMtmik3AlceFY1A7YnyEctmHyyGdXyP5Ggzicy6MJU,43954
|
6
6
|
odoo/addons/stock_request/i18n/de.po,sha256=ByNVbp_DfoNWUt27O6Gqd975ocZ6OGYpUP8_Pil6GIo,49181
|
@@ -38,9 +38,9 @@ odoo/addons/stock_request/models/stock_location.py,sha256=ckie9pUiJ2r_pU_-ojYZie
|
|
38
38
|
odoo/addons/stock_request/models/stock_move.py,sha256=Pu8aIo3ydPuoUbUuBcKjCND_VRilp5Uh6AKnzQmbOhs,2782
|
39
39
|
odoo/addons/stock_request/models/stock_move_line.py,sha256=75R5LJjHZtU-fTHcC_vhnoMhgDEG-S9fYuUsD_vmzQ4,2765
|
40
40
|
odoo/addons/stock_request/models/stock_picking.py,sha256=XmdxMG-GNKJjF6RE8inj45TBy1eEhmRh4nzb-0bMQs0,1339
|
41
|
-
odoo/addons/stock_request/models/stock_request.py,sha256=
|
42
|
-
odoo/addons/stock_request/models/stock_request_abstract.py,sha256=
|
43
|
-
odoo/addons/stock_request/models/stock_request_allocation.py,sha256=
|
41
|
+
odoo/addons/stock_request/models/stock_request.py,sha256=yO1yTRN-92TV14gSum2QOuwx0go2fqt0mef1vzjeiww,16270
|
42
|
+
odoo/addons/stock_request/models/stock_request_abstract.py,sha256=6U0dh2NWcIndDSKYfwMLMJREZc1pPfS_sUoTwjweAh0,9505
|
43
|
+
odoo/addons/stock_request/models/stock_request_allocation.py,sha256=Kqq6VcZgYSbw2OSooeWgzVLBlWyiVJbR71dyKciPzUg,2927
|
44
44
|
odoo/addons/stock_request/models/stock_request_order.py,sha256=7JxEWcjjZY5oyJlg-m8dZvf1AfPGE82WoZTL4cViYr4,12192
|
45
45
|
odoo/addons/stock_request/models/stock_route.py,sha256=VFATxVyY7QGHjX3R83wSrST-EgXstJZY1QS0uALgbQw,853
|
46
46
|
odoo/addons/stock_request/models/stock_rule.py,sha256=BQSN-HB1snD0ex-pGwcVwxZHmxXDSb4aI1VNDkIjYKM,1033
|
@@ -54,9 +54,9 @@ odoo/addons/stock_request/security/ir.model.access.csv,sha256=dsUwAR79-qQNVwCZhv
|
|
54
54
|
odoo/addons/stock_request/security/stock_request_security.xml,sha256=VP0gCObFyM2wl0jcsO_J0vt2_jV0BQWtj4UMSqPellA,5978
|
55
55
|
odoo/addons/stock_request/static/description/icon.png,sha256=HZGM_z7Ta3zNQ2924BUiMfDuVSCWqrEwUQMWXBnK7yk,15218
|
56
56
|
odoo/addons/stock_request/static/description/icon.svg,sha256=e3qo4KGYRy7Mfzhb_bCfVA-73Rk2Lx1z9_kz7tTjdO0,9771
|
57
|
-
odoo/addons/stock_request/static/description/index.html,sha256=
|
57
|
+
odoo/addons/stock_request/static/description/index.html,sha256=JRZJDbYgLo6n_YxuY6nsv20zoh-Ogm0GRRYL91rrYGQ,15995
|
58
58
|
odoo/addons/stock_request/tests/__init__.py,sha256=3NQ2fafGprBbsMjR2Y__yzyvFX5Vio1r0j6tT3FTbas,33
|
59
|
-
odoo/addons/stock_request/tests/test_stock_request.py,sha256=
|
59
|
+
odoo/addons/stock_request/tests/test_stock_request.py,sha256=r-C8CMaeDomAq3trC95e_DA78h-QocY2DYYPpcmMSp4,56479
|
60
60
|
odoo/addons/stock_request/views/product.xml,sha256=CJ6RE5uGQLlIMDCPKxw8nhodb_rR3jaj-mF5ozCFUKI,1517
|
61
61
|
odoo/addons/stock_request/views/res_config_settings_views.xml,sha256=kE05fmV2drjepSISURc67R7Uk_62zayWtncGSxzKTBo,6260
|
62
62
|
odoo/addons/stock_request/views/stock_move_views.xml,sha256=Z5pNG0WfYz-CTlxgB-rma0BoT08VQDHnm3J_Ksu9BxA,1072
|
@@ -65,7 +65,7 @@ odoo/addons/stock_request/views/stock_request_allocation_views.xml,sha256=NhoVR2
|
|
65
65
|
odoo/addons/stock_request/views/stock_request_menu.xml,sha256=S_3HPkmYcHC_xtPjusHiZX7RUW5CGrJW3w52ScnJFNw,1308
|
66
66
|
odoo/addons/stock_request/views/stock_request_order_views.xml,sha256=nEFtoyX7dnytFmT1uZ2GBphAKpN1IEnvnuA_IJSWGRk,10938
|
67
67
|
odoo/addons/stock_request/views/stock_request_views.xml,sha256=o_9aY_EOfHymmrg79uQJcVi4snCTUMt3CWacxmnIrxY,12136
|
68
|
-
odoo_addon_stock_request-17.0.1.0.
|
69
|
-
odoo_addon_stock_request-17.0.1.0.
|
70
|
-
odoo_addon_stock_request-17.0.1.0.
|
71
|
-
odoo_addon_stock_request-17.0.1.0.
|
68
|
+
odoo_addon_stock_request-17.0.1.0.2.dist-info/METADATA,sha256=h4yKph1k2bz9qYi98Hz-AT5ckIQs8vVQVOZLNoCOTTU,5410
|
69
|
+
odoo_addon_stock_request-17.0.1.0.2.dist-info/WHEEL,sha256=8Rd4enx1PCuyDWP4SABqO5Fv8rpaknqp3VzjoFFLa6c,83
|
70
|
+
odoo_addon_stock_request-17.0.1.0.2.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
71
|
+
odoo_addon_stock_request-17.0.1.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|