odoo-addon-mrp-multi-level-estimate 15.0.1.1.0.3__py3-none-any.whl → 15.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.

@@ -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:864f068f6efd1896c5213801908c0aff2896bee8067f1f7c6a775755c56f0a99
10
+ !! source digest: sha256:1e2ffb67e3ef323948993e783642b74f757c85d48497490a8045bdac0fc87e4f
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
@@ -3,7 +3,7 @@
3
3
 
4
4
  {
5
5
  "name": "MRP Multi Level Estimate",
6
- "version": "15.0.1.1.0",
6
+ "version": "15.0.1.1.2",
7
7
  "development_status": "Production/Stable",
8
8
  "license": "LGPL-3",
9
9
  "author": "ForgeFlow, Odoo Community Association (OCA)",
@@ -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:864f068f6efd1896c5213801908c0aff2896bee8067f1f7c6a775755c56f0a99
369
+ !! source digest: sha256:1e2ffb67e3ef323948993e783642b74f757c85d48497490a8045bdac0fc87e4f
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/15.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-15-0/manufacture-15-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&amp;target_branch=15.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,9 +3,12 @@
3
3
 
4
4
  from datetime import datetime, timedelta
5
5
 
6
+ from odoo.tests import Form, tagged
7
+
6
8
  from odoo.addons.mrp_multi_level.tests.common import TestMrpMultiLevelCommon
7
9
 
8
10
 
11
+ @tagged("post_install", "-at_install")
9
12
  class TestMrpMultiLevelEstimate(TestMrpMultiLevelCommon):
10
13
  @classmethod
11
14
  def setUpClass(cls):
@@ -333,3 +336,108 @@ class TestMrpMultiLevelEstimate(TestMrpMultiLevelCommon):
333
336
  self.assertEqual(
334
337
  demand_from_other_sources.mrp_date, self.date_without_ranges.date()
335
338
  )
339
+
340
+ def test_06_estimate_and_other_sources_strat_with_mo(self):
341
+ """
342
+ Tests demand estimates and other sources strategies with MOs.
343
+ Components demand from MOs is always indirect demand, so even if we
344
+ have estimates, we should consider that demand.
345
+ """
346
+ # Get manufactured product, component and bom
347
+ fp_1 = self.env.ref("mrp_multi_level.product_product_fp_1")
348
+ pp_1 = self.env.ref("mrp_multi_level.product_product_pp_1")
349
+ fp_1_bom = self.env.ref("mrp_multi_level.mrp_bom_fp_1")
350
+ self.product_mrp_area_obj.create(
351
+ {"product_id": fp_1.id, "mrp_area_id": self.estimate_area.id}
352
+ )
353
+ self.product_mrp_area_obj.create(
354
+ {"product_id": pp_1.id, "mrp_area_id": self.estimate_area.id}
355
+ )
356
+ # Create 1 estimate of 1 week length for the component.
357
+ date_start = datetime.today().replace(hour=0)
358
+ date_end = date_start + timedelta(days=6)
359
+ self._create_demand_estimate(pp_1, self.estimate_loc, date_start, date_end, 7)
360
+ date_mo = date_start + timedelta(days=1)
361
+ # Create 1 MO for fp_1 that has two pp_1 in its components
362
+ mo_form = Form(self.mo_obj)
363
+ mo_form.product_id = fp_1
364
+ mo_form.bom_id = fp_1_bom
365
+ mo_form.product_qty = 10
366
+ mo_form.date_planned_start = date_mo
367
+ mo_form.location_src_id = self.estimate_loc
368
+ mo = mo_form.save()
369
+ mo.action_confirm()
370
+ # Create 1 picking out that represents a Delivery Order from a sale
371
+ self._create_picking_out(pp_1, 5, date_mo, location=self.estimate_loc)
372
+ # 1. "all"
373
+ # Expected result: Consider all sources of demand
374
+ self.estimate_area.estimate_demand_and_other_sources_strat = "all"
375
+ self.mrp_multi_level_wiz.create(
376
+ {"mrp_area_ids": [(6, 0, self.estimate_area.ids)]}
377
+ ).run_mrp_multi_level()
378
+ moves = self.mrp_move_obj.search(
379
+ [
380
+ ("product_id", "=", pp_1.id),
381
+ ("mrp_area_id", "=", self.estimate_area.id),
382
+ ]
383
+ )
384
+ demand_from_estimates = moves.filtered(
385
+ lambda m: m.mrp_type == "d" and m.mrp_origin == "fc"
386
+ )
387
+ demand_from_other_sources = moves.filtered(
388
+ lambda m: m.mrp_type == "d" and m.mrp_origin != "fc"
389
+ )
390
+ self.assertEqual(len(demand_from_estimates), 7)
391
+ self.assertEqual(sum(demand_from_estimates.mapped("mrp_qty")), -7)
392
+ self.assertEqual(len(demand_from_other_sources), 2)
393
+ self.assertEqual(sum(demand_from_other_sources.mapped("mrp_qty")), -25)
394
+
395
+ # 2. "ignore_others_if_estimates"
396
+ # Expected result: Consider estimates and demand from MO
397
+ self.estimate_area.estimate_demand_and_other_sources_strat = (
398
+ "ignore_others_if_estimates"
399
+ )
400
+ self.mrp_multi_level_wiz.create(
401
+ {"mrp_area_ids": [(6, 0, self.estimate_area.ids)]}
402
+ ).run_mrp_multi_level()
403
+ moves = self.mrp_move_obj.search(
404
+ [
405
+ ("product_id", "=", pp_1.id),
406
+ ("mrp_area_id", "=", self.estimate_area.id),
407
+ ]
408
+ )
409
+ demand_from_estimates = moves.filtered(
410
+ lambda m: m.mrp_type == "d" and m.mrp_origin == "fc"
411
+ )
412
+ demand_from_other_sources = moves.filtered(
413
+ lambda m: m.mrp_type == "d" and m.mrp_origin != "fc"
414
+ )
415
+ self.assertEqual(len(demand_from_estimates), 7)
416
+ self.assertEqual(sum(demand_from_estimates.mapped("mrp_qty")), -7)
417
+ self.assertEqual(len(demand_from_other_sources), 1)
418
+ self.assertEqual(sum(demand_from_other_sources.mapped("mrp_qty")), -20)
419
+
420
+ # 3. "ignore_overlapping"
421
+ # Expected result: Consider estimates and demand from MO
422
+ self.estimate_area.estimate_demand_and_other_sources_strat = (
423
+ "ignore_overlapping"
424
+ )
425
+ self.mrp_multi_level_wiz.create(
426
+ {"mrp_area_ids": [(6, 0, self.estimate_area.ids)]}
427
+ ).run_mrp_multi_level()
428
+ moves = self.mrp_move_obj.search(
429
+ [
430
+ ("product_id", "=", pp_1.id),
431
+ ("mrp_area_id", "=", self.estimate_area.id),
432
+ ]
433
+ )
434
+ demand_from_estimates = moves.filtered(
435
+ lambda m: m.mrp_type == "d" and m.mrp_origin == "fc"
436
+ )
437
+ demand_from_other_sources = moves.filtered(
438
+ lambda m: m.mrp_type == "d" and m.mrp_origin != "fc"
439
+ )
440
+ self.assertEqual(len(demand_from_estimates), 7)
441
+ self.assertEqual(sum(demand_from_estimates.mapped("mrp_qty")), -7)
442
+ self.assertEqual(len(demand_from_other_sources), 1)
443
+ 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", "in", locations.ids),
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 self._exclude_considering_estimate_demand_and_other_sources_strat(
126
- product_mrp_area, mrp_date
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: 15.0.1.1.0.3
3
+ Version: 15.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:864f068f6efd1896c5213801908c0aff2896bee8067f1f7c6a775755c56f0a99
29
+ !! source digest: sha256:1e2ffb67e3ef323948993e783642b74f757c85d48497490a8045bdac0fc87e4f
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=I3MCEL2nS2Zxk669TuP3e5cZ2Znrxrxj_wy0y5S62xQ,3635
1
+ odoo/addons/mrp_multi_level_estimate/README.rst,sha256=9YXDAmXozxwB79Lm2zSoI0Fq89rQ-ltEeBVAMS0-qpg,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=_MFNZ7Jp-J7fFhL-2K02j8bbR7VBIrGjrjVP8Sf5JVw,757
3
+ odoo/addons/mrp_multi_level_estimate/__manifest__.py,sha256=BIrcahI9ICJ_vJpkRAincz01xiL_7QW2SVfo8ft4Y8M,757
4
4
  odoo/addons/mrp_multi_level_estimate/i18n/it.po,sha256=dxT14-6WogFttASV_zPYngTG0xfQw1VaixMeP5szGyU,5284
5
5
  odoo/addons/mrp_multi_level_estimate/i18n/mrp_multi_level_estimate.pot,sha256=GzMU5YwY4nAVIc1gMDm6bBjWNWg-nMY-7dz-AMmPGP4,3337
6
6
  odoo/addons/mrp_multi_level_estimate/models/__init__.py,sha256=W36RIYicwEH-lt-zOvL5yuIcRylYDKMfR8g9jMfZ4i0,54
@@ -10,14 +10,14 @@ odoo/addons/mrp_multi_level_estimate/readme/CONFIGURE.rst,sha256=cfe5MFN-OexCeqB
10
10
  odoo/addons/mrp_multi_level_estimate/readme/CONTRIBUTORS.rst,sha256=uuhnoe--Op896FIKvezjm0m1oI8Qw-ftRIap1prVmPA,82
11
11
  odoo/addons/mrp_multi_level_estimate/readme/DESCRIPTION.rst,sha256=qu73JUlYa9EAAHeVGWlGnwuQzcd7oh21YjQpl8i7t_M,153
12
12
  odoo/addons/mrp_multi_level_estimate/static/description/icon.png,sha256=aKBaspA4lNhJTS8Wqa0Iybr5xw5yMaSwIbhrGSYxLdc,7222
13
- odoo/addons/mrp_multi_level_estimate/static/description/index.html,sha256=KBNUKYpVODd6YsCS6G6XvyYqRpgco_SdyaIBvbE0zL0,13263
13
+ odoo/addons/mrp_multi_level_estimate/static/description/index.html,sha256=7ZoC_eIlCWPiJL44OwW_b8WAL9iECdGW4p0XZy9F0yg,13224
14
14
  odoo/addons/mrp_multi_level_estimate/tests/__init__.py,sha256=jubuKAmd3cSFYv9_4_UTWo0H04EVTT9NK2tAyn6arFw,44
15
- odoo/addons/mrp_multi_level_estimate/tests/test_mrp_multi_level_estimate.py,sha256=O7O-RwJQPKlA4f3XDstUb-ort_AcEnt3HuGI4hwo89Q,14169
15
+ odoo/addons/mrp_multi_level_estimate/tests/test_mrp_multi_level_estimate.py,sha256=kLi7HlCWFdY4dgW5beHM33GiXwsTm8Q0LYQd0wFmbKk,18986
16
16
  odoo/addons/mrp_multi_level_estimate/views/mrp_area_views.xml,sha256=oAXwIA8ObQ_AW8pj2i6fDR06UX8tqfds1sGN_jDwEuo,500
17
17
  odoo/addons/mrp_multi_level_estimate/views/product_mrp_area_views.xml,sha256=GHZgosx8iiE4tc_L0jHt5iOlTlNlBQUHtT6eCcu5LUs,540
18
18
  odoo/addons/mrp_multi_level_estimate/wizards/__init__.py,sha256=7LHDA1MifAAlAnbOClrCiVPeixdWtwqbNQhrt7gElRA,30
19
- odoo/addons/mrp_multi_level_estimate/wizards/mrp_multi_level.py,sha256=UCUajD78PgbDMatNPyVhiiAxRKA8guwikGAEl4376wM,4735
20
- odoo_addon_mrp_multi_level_estimate-15.0.1.1.0.3.dist-info/METADATA,sha256=jMEXgFbhvnR6tC8b4-B3Jxlu0NzHVmQ5aO3zkumeC8I,4405
21
- odoo_addon_mrp_multi_level_estimate-15.0.1.1.0.3.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
22
- odoo_addon_mrp_multi_level_estimate-15.0.1.1.0.3.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
23
- odoo_addon_mrp_multi_level_estimate-15.0.1.1.0.3.dist-info/RECORD,,
19
+ odoo/addons/mrp_multi_level_estimate/wizards/mrp_multi_level.py,sha256=ZSrSRdY8YGV1S9OXaE_8t70QaepW6MYyvURI0lQT_9U,4826
20
+ odoo_addon_mrp_multi_level_estimate-15.0.1.1.2.dist-info/METADATA,sha256=A58RG5Ra0JiDJsCIjFQGtYsI2UQA6k03CGwEkqDhCwA,4403
21
+ odoo_addon_mrp_multi_level_estimate-15.0.1.1.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
22
+ odoo_addon_mrp_multi_level_estimate-15.0.1.1.2.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
23
+ odoo_addon_mrp_multi_level_estimate-15.0.1.1.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5