odoo-addon-mrp-multi-level-estimate 16.0.1.1.0.6__py3-none-any.whl → 16.0.1.1.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.
Potentially problematic release.
This version of odoo-addon-mrp-multi-level-estimate might be problematic. Click here for more details.
- odoo/addons/mrp_multi_level_estimate/README.rst +1 -1
- odoo/addons/mrp_multi_level_estimate/__manifest__.py +1 -1
- odoo/addons/mrp_multi_level_estimate/static/description/index.html +1 -2
- odoo/addons/mrp_multi_level_estimate/tests/test_mrp_multi_level_estimate.py +109 -0
- odoo/addons/mrp_multi_level_estimate/wizards/mrp_multi_level.py +6 -3
- {odoo_addon_mrp_multi_level_estimate-16.0.1.1.0.6.dist-info → odoo_addon_mrp_multi_level_estimate-16.0.1.1.2.dist-info}/METADATA +2 -2
- {odoo_addon_mrp_multi_level_estimate-16.0.1.1.0.6.dist-info → odoo_addon_mrp_multi_level_estimate-16.0.1.1.2.dist-info}/RECORD +9 -9
- {odoo_addon_mrp_multi_level_estimate-16.0.1.1.0.6.dist-info → odoo_addon_mrp_multi_level_estimate-16.0.1.1.2.dist-info}/WHEEL +1 -1
- {odoo_addon_mrp_multi_level_estimate-16.0.1.1.0.6.dist-info → odoo_addon_mrp_multi_level_estimate-16.0.1.1.2.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ MRP Multi Level Estimate
|
|
|
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:e6d993a40522997f3b0ade9182fb5d90c4d9b889418098456b52fd010f77d5b0
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
3
|
<head>
|
|
@@ -367,7 +366,7 @@ ul.auto-toc {
|
|
|
367
366
|
!! This file is generated by oca-gen-addon-readme !!
|
|
368
367
|
!! changes will be overwritten. !!
|
|
369
368
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
370
|
-
!! source digest: sha256:
|
|
369
|
+
!! source digest: sha256:e6d993a40522997f3b0ade9182fb5d90c4d9b889418098456b52fd010f77d5b0
|
|
371
370
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
372
371
|
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/manufacture/tree/16.0/mrp_multi_level_estimate"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-mrp_multi_level_estimate"><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/manufacture&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
373
372
|
<p>Integration for MRP Multi Level and <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_demand_estimate">Stock Demand Estimates</a> system.</p>
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
from datetime import datetime, timedelta
|
|
5
5
|
|
|
6
|
+
from odoo.tests import Form
|
|
7
|
+
|
|
6
8
|
from odoo.addons.mrp_multi_level.tests.common import TestMrpMultiLevelCommon
|
|
7
9
|
|
|
8
10
|
|
|
@@ -333,3 +335,110 @@ class TestMrpMultiLevelEstimate(TestMrpMultiLevelCommon):
|
|
|
333
335
|
self.assertEqual(
|
|
334
336
|
demand_from_other_sources.mrp_date, self.date_without_ranges.date()
|
|
335
337
|
)
|
|
338
|
+
|
|
339
|
+
def test_06_estimate_and_other_sources_strat_with_mo(self):
|
|
340
|
+
"""
|
|
341
|
+
Tests demand estimates and other sources strategies with MOs.
|
|
342
|
+
Components demand from MOs is always indirect demand, so even if we
|
|
343
|
+
have estimates, we should consider that demand.
|
|
344
|
+
"""
|
|
345
|
+
# Get manufactured product, component and bom
|
|
346
|
+
fp_1 = self.env.ref("mrp_multi_level.product_product_fp_1")
|
|
347
|
+
pp_1 = self.env.ref("mrp_multi_level.product_product_pp_1")
|
|
348
|
+
fp_1_bom = self.env.ref("mrp_multi_level.mrp_bom_fp_1")
|
|
349
|
+
self.product_mrp_area_obj.create(
|
|
350
|
+
{"product_id": fp_1.id, "mrp_area_id": self.estimate_area.id}
|
|
351
|
+
)
|
|
352
|
+
self.product_mrp_area_obj.create(
|
|
353
|
+
{"product_id": pp_1.id, "mrp_area_id": self.estimate_area.id}
|
|
354
|
+
)
|
|
355
|
+
# Create 1 estimate of 1 week length for the component.
|
|
356
|
+
date_start = datetime.today().replace(hour=0)
|
|
357
|
+
date_end = date_start + timedelta(days=6)
|
|
358
|
+
self._create_demand_estimate(pp_1, self.estimate_loc, date_start, date_end, 7)
|
|
359
|
+
date_mo = date_start + timedelta(days=1)
|
|
360
|
+
# Create 1 MO for fp_1 that has two pp_1 in its components
|
|
361
|
+
mo_form = Form(self.mo_obj)
|
|
362
|
+
mo_form.product_id = fp_1
|
|
363
|
+
mo_form.bom_id = fp_1_bom
|
|
364
|
+
mo_form.product_qty = 10
|
|
365
|
+
mo_form.date_planned_start = date_mo
|
|
366
|
+
mo = mo_form.save()
|
|
367
|
+
mo.location_src_id = (
|
|
368
|
+
self.estimate_loc
|
|
369
|
+
) # writing afterward to avoid invisible-field error in Form.
|
|
370
|
+
mo.action_confirm()
|
|
371
|
+
# Create 1 picking out that represents a Delivery Order from a sale
|
|
372
|
+
self._create_picking_out(pp_1, 5, date_mo, location=self.estimate_loc)
|
|
373
|
+
# 1. "all"
|
|
374
|
+
# Expected result: Consider all sources of demand
|
|
375
|
+
self.estimate_area.estimate_demand_and_other_sources_strat = "all"
|
|
376
|
+
self.mrp_multi_level_wiz.create(
|
|
377
|
+
{"mrp_area_ids": [(6, 0, self.estimate_area.ids)]}
|
|
378
|
+
).run_mrp_multi_level()
|
|
379
|
+
moves = self.mrp_move_obj.search(
|
|
380
|
+
[
|
|
381
|
+
("product_id", "=", pp_1.id),
|
|
382
|
+
("mrp_area_id", "=", self.estimate_area.id),
|
|
383
|
+
]
|
|
384
|
+
)
|
|
385
|
+
demand_from_estimates = moves.filtered(
|
|
386
|
+
lambda m: m.mrp_type == "d" and m.mrp_origin == "fc"
|
|
387
|
+
)
|
|
388
|
+
demand_from_other_sources = moves.filtered(
|
|
389
|
+
lambda m: m.mrp_type == "d" and m.mrp_origin != "fc"
|
|
390
|
+
)
|
|
391
|
+
self.assertEqual(len(demand_from_estimates), 7)
|
|
392
|
+
self.assertEqual(sum(demand_from_estimates.mapped("mrp_qty")), -7)
|
|
393
|
+
self.assertEqual(len(demand_from_other_sources), 2)
|
|
394
|
+
self.assertEqual(sum(demand_from_other_sources.mapped("mrp_qty")), -25)
|
|
395
|
+
|
|
396
|
+
# 2. "ignore_others_if_estimates"
|
|
397
|
+
# Expected result: Consider estimates and demand from MO
|
|
398
|
+
self.estimate_area.estimate_demand_and_other_sources_strat = (
|
|
399
|
+
"ignore_others_if_estimates"
|
|
400
|
+
)
|
|
401
|
+
self.mrp_multi_level_wiz.create(
|
|
402
|
+
{"mrp_area_ids": [(6, 0, self.estimate_area.ids)]}
|
|
403
|
+
).run_mrp_multi_level()
|
|
404
|
+
moves = self.mrp_move_obj.search(
|
|
405
|
+
[
|
|
406
|
+
("product_id", "=", pp_1.id),
|
|
407
|
+
("mrp_area_id", "=", self.estimate_area.id),
|
|
408
|
+
]
|
|
409
|
+
)
|
|
410
|
+
demand_from_estimates = moves.filtered(
|
|
411
|
+
lambda m: m.mrp_type == "d" and m.mrp_origin == "fc"
|
|
412
|
+
)
|
|
413
|
+
demand_from_other_sources = moves.filtered(
|
|
414
|
+
lambda m: m.mrp_type == "d" and m.mrp_origin != "fc"
|
|
415
|
+
)
|
|
416
|
+
self.assertEqual(len(demand_from_estimates), 7)
|
|
417
|
+
self.assertEqual(sum(demand_from_estimates.mapped("mrp_qty")), -7)
|
|
418
|
+
self.assertEqual(len(demand_from_other_sources), 1)
|
|
419
|
+
self.assertEqual(sum(demand_from_other_sources.mapped("mrp_qty")), -20)
|
|
420
|
+
|
|
421
|
+
# 3. "ignore_overlapping"
|
|
422
|
+
# Expected result: Consider estimates and demand from MO
|
|
423
|
+
self.estimate_area.estimate_demand_and_other_sources_strat = (
|
|
424
|
+
"ignore_overlapping"
|
|
425
|
+
)
|
|
426
|
+
self.mrp_multi_level_wiz.create(
|
|
427
|
+
{"mrp_area_ids": [(6, 0, self.estimate_area.ids)]}
|
|
428
|
+
).run_mrp_multi_level()
|
|
429
|
+
moves = self.mrp_move_obj.search(
|
|
430
|
+
[
|
|
431
|
+
("product_id", "=", pp_1.id),
|
|
432
|
+
("mrp_area_id", "=", self.estimate_area.id),
|
|
433
|
+
]
|
|
434
|
+
)
|
|
435
|
+
demand_from_estimates = moves.filtered(
|
|
436
|
+
lambda m: m.mrp_type == "d" and m.mrp_origin == "fc"
|
|
437
|
+
)
|
|
438
|
+
demand_from_other_sources = moves.filtered(
|
|
439
|
+
lambda m: m.mrp_type == "d" and m.mrp_origin != "fc"
|
|
440
|
+
)
|
|
441
|
+
self.assertEqual(len(demand_from_estimates), 7)
|
|
442
|
+
self.assertEqual(sum(demand_from_estimates.mapped("mrp_qty")), -7)
|
|
443
|
+
self.assertEqual(len(demand_from_other_sources), 1)
|
|
444
|
+
self.assertEqual(sum(demand_from_other_sources.mapped("mrp_qty")), -20)
|
|
@@ -62,7 +62,7 @@ class MultiLevelMrp(models.TransientModel):
|
|
|
62
62
|
locations = product_mrp_area.mrp_area_id._get_locations()
|
|
63
63
|
return [
|
|
64
64
|
("product_id", "=", product_mrp_area.product_id.id),
|
|
65
|
-
("location_id", "
|
|
65
|
+
("location_id", "child_of", locations.ids),
|
|
66
66
|
("date_to", ">=", fields.Date.today()),
|
|
67
67
|
]
|
|
68
68
|
|
|
@@ -122,8 +122,11 @@ class MultiLevelMrp(models.TransientModel):
|
|
|
122
122
|
)
|
|
123
123
|
if direction == "out":
|
|
124
124
|
mrp_date = res.get("mrp_date")
|
|
125
|
-
if
|
|
126
|
-
|
|
125
|
+
if (
|
|
126
|
+
self._exclude_considering_estimate_demand_and_other_sources_strat(
|
|
127
|
+
product_mrp_area, mrp_date
|
|
128
|
+
)
|
|
129
|
+
and not res["production_id"]
|
|
127
130
|
):
|
|
128
131
|
return False
|
|
129
132
|
return res
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-mrp-multi-level-estimate
|
|
3
|
-
Version: 16.0.1.1.
|
|
3
|
+
Version: 16.0.1.1.2
|
|
4
4
|
Summary: Allows to consider demand estimates using MRP multi level.
|
|
5
5
|
Home-page: https://github.com/OCA/manufacture
|
|
6
6
|
Author: ForgeFlow, Odoo Community Association (OCA)
|
|
@@ -26,7 +26,7 @@ MRP Multi Level Estimate
|
|
|
26
26
|
!! This file is generated by oca-gen-addon-readme !!
|
|
27
27
|
!! changes will be overwritten. !!
|
|
28
28
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
29
|
-
!! source digest: sha256:
|
|
29
|
+
!! source digest: sha256:e6d993a40522997f3b0ade9182fb5d90c4d9b889418098456b52fd010f77d5b0
|
|
30
30
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
31
31
|
|
|
32
32
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
odoo/addons/mrp_multi_level_estimate/README.rst,sha256=
|
|
1
|
+
odoo/addons/mrp_multi_level_estimate/README.rst,sha256=j5fvj-riYdtk0F3hT5f_l8V08mOWJySJ7NriOe4Mh9w,3635
|
|
2
2
|
odoo/addons/mrp_multi_level_estimate/__init__.py,sha256=0XNpxETgFdVxFDEw03O8oL3NtTSk3we-HEZW2sPKzIU,43
|
|
3
|
-
odoo/addons/mrp_multi_level_estimate/__manifest__.py,sha256=
|
|
3
|
+
odoo/addons/mrp_multi_level_estimate/__manifest__.py,sha256=KvTXPz_0ORTEEtTkRcXRUMam2PiIHG33w6TmHb01674,757
|
|
4
4
|
odoo/addons/mrp_multi_level_estimate/i18n/es.po,sha256=_WJlT2IFmbDg-JxTfBk9X0sJqHvDvYuGvrUTbYbjFW8,4802
|
|
5
5
|
odoo/addons/mrp_multi_level_estimate/i18n/it.po,sha256=dxT14-6WogFttASV_zPYngTG0xfQw1VaixMeP5szGyU,5284
|
|
6
6
|
odoo/addons/mrp_multi_level_estimate/i18n/mrp_multi_level_estimate.pot,sha256=vJQmdnDBG_sM3RdJGksw0JUxzdB0d62KHAtrJk3IjKo,3337
|
|
@@ -11,14 +11,14 @@ odoo/addons/mrp_multi_level_estimate/readme/CONFIGURE.rst,sha256=cfe5MFN-OexCeqB
|
|
|
11
11
|
odoo/addons/mrp_multi_level_estimate/readme/CONTRIBUTORS.rst,sha256=uuhnoe--Op896FIKvezjm0m1oI8Qw-ftRIap1prVmPA,82
|
|
12
12
|
odoo/addons/mrp_multi_level_estimate/readme/DESCRIPTION.rst,sha256=qu73JUlYa9EAAHeVGWlGnwuQzcd7oh21YjQpl8i7t_M,153
|
|
13
13
|
odoo/addons/mrp_multi_level_estimate/static/description/icon.png,sha256=aKBaspA4lNhJTS8Wqa0Iybr5xw5yMaSwIbhrGSYxLdc,7222
|
|
14
|
-
odoo/addons/mrp_multi_level_estimate/static/description/index.html,sha256=
|
|
14
|
+
odoo/addons/mrp_multi_level_estimate/static/description/index.html,sha256=wbubMgrLj51g1oJWtvXX7l5EWEfhd6do5MwWRE9wDwA,13224
|
|
15
15
|
odoo/addons/mrp_multi_level_estimate/tests/__init__.py,sha256=jubuKAmd3cSFYv9_4_UTWo0H04EVTT9NK2tAyn6arFw,44
|
|
16
|
-
odoo/addons/mrp_multi_level_estimate/tests/test_mrp_multi_level_estimate.py,sha256=
|
|
16
|
+
odoo/addons/mrp_multi_level_estimate/tests/test_mrp_multi_level_estimate.py,sha256=_FMouzYfmCNtUKjZ1RszOpvMDIVsImCC3X7LmQDlJno,19019
|
|
17
17
|
odoo/addons/mrp_multi_level_estimate/views/mrp_area_views.xml,sha256=oAXwIA8ObQ_AW8pj2i6fDR06UX8tqfds1sGN_jDwEuo,500
|
|
18
18
|
odoo/addons/mrp_multi_level_estimate/views/product_mrp_area_views.xml,sha256=GHZgosx8iiE4tc_L0jHt5iOlTlNlBQUHtT6eCcu5LUs,540
|
|
19
19
|
odoo/addons/mrp_multi_level_estimate/wizards/__init__.py,sha256=7LHDA1MifAAlAnbOClrCiVPeixdWtwqbNQhrt7gElRA,30
|
|
20
|
-
odoo/addons/mrp_multi_level_estimate/wizards/mrp_multi_level.py,sha256=
|
|
21
|
-
odoo_addon_mrp_multi_level_estimate-16.0.1.1.
|
|
22
|
-
odoo_addon_mrp_multi_level_estimate-16.0.1.1.
|
|
23
|
-
odoo_addon_mrp_multi_level_estimate-16.0.1.1.
|
|
24
|
-
odoo_addon_mrp_multi_level_estimate-16.0.1.1.
|
|
20
|
+
odoo/addons/mrp_multi_level_estimate/wizards/mrp_multi_level.py,sha256=ZSrSRdY8YGV1S9OXaE_8t70QaepW6MYyvURI0lQT_9U,4826
|
|
21
|
+
odoo_addon_mrp_multi_level_estimate-16.0.1.1.2.dist-info/METADATA,sha256=blThiMZODZchMyocLOwpHFFakrw41SDchnAICtMKF7Y,4404
|
|
22
|
+
odoo_addon_mrp_multi_level_estimate-16.0.1.1.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
23
|
+
odoo_addon_mrp_multi_level_estimate-16.0.1.1.2.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
|
24
|
+
odoo_addon_mrp_multi_level_estimate-16.0.1.1.2.dist-info/RECORD,,
|