[MIG] mrp_multi_level: Migration to 18.0

This commit is contained in:
JasminSForgeFlow
2024-12-03 18:04:49 +05:30
parent 1fae464717
commit 86bf57b348
20 changed files with 224 additions and 220 deletions

View File

@@ -17,13 +17,13 @@ MRP Multi Level
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
:target: https://github.com/OCA/manufacture/tree/17.0/mrp_multi_level
:target: https://github.com/OCA/manufacture/tree/18.0/mrp_multi_level
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-17-0/manufacture-17-0-mrp_multi_level
:target: https://translation.odoo-community.org/projects/manufacture-18-0/manufacture-18-0-mrp_multi_level
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -38,16 +38,16 @@ and explodes this down to the lowest level.
Key Features
------------
- MRP parameters set by product variant MRP area pairs.
- Cron job to calculate the MRP demand.
- Manually calculate the MRP demand.
- Confirm the calculated MRP demand and create PO's, or MO's.
- Able to see the products for which action is needed throught Planned
Orders.
- Integration with `Stock Demand
Estimates <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_demand_estimate>`__
system. Note: You need to install `mrp_multi_level_estimate
module <https://github.com/OCA/manufacture/tree/12.0/mrp_multi_level_estimate>`__.
- MRP parameters set by product variant MRP area pairs.
- Cron job to calculate the MRP demand.
- Manually calculate the MRP demand.
- Confirm the calculated MRP demand and create PO's, or MO's.
- Able to see the products for which action is needed throught Planned
Orders.
- Integration with `Stock Demand
Estimates <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_demand_estimate>`__
system. Note: You need to install `mrp_multi_level_estimate
module <https://github.com/OCA/manufacture/tree/12.0/mrp_multi_level_estimate>`__.
**Table of contents**
@@ -58,28 +58,28 @@ Configuration
=============
MRP Areas
---------
~~~~~~~~~
- Go to *Manufacturing > Configuration > MRP Areas* and define or edit
any existing area. You can specify the working hours for every area.
- Go to *Manufacturing > Configuration > MRP Areas* and define or edit
any existing area. You can specify the working hours for every area.
Product MRP Area Parameters
---------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Go to *Manufacturing > Master Data > Product MRP Area Parameters* and
set the MRP parameters for a given product and area.
- Go to *Manufacturing > Products > Product MRP Area Parameters* and
set the MRP parameters for a given product and area.
Usage
=====
To manually run the MRP scheduler:
1. Go to *Manufacturing > Operations > Run MRP Multi Level*.
1. Go to *Manufacturing > Planning > Run MRP Multi Level*.
2. On the wizard click *Run MRP*.
To launch replenishment orders (moves, purchases, production orders...):
1. Go to *Manufacturing > Operations > MRP Inventory*.
1. Go to *Manufacturing > Planning > MRP Inventory*.
2. Filter with *To procure*.
3. Select multiple records and click on *Action > Procure* or click the
right hand side gears in any record.
@@ -93,123 +93,124 @@ Changelog
**Features**
- Show *Run MRP Multi Level* menu only to a specific new security group
*Run MRP Manually*.
(`#492 <https://github.com/OCA/manufacture/issues/492>`__)
- Show *Run MRP Multi Level* menu only to a specific new security group
*Run MRP Manually*.
(`#492 <https://github.com/OCA/manufacture/issues/492>`__)
13.0.1.4.0 (2020-03-26)
-----------------------
- Add menu entry for planned orders
- Add button to navigate from planned orders to linked manufacturing
orders
- Add action to convert planned orders to fixed
- When changing the due date in a planned order the release date is
recomputed
- Add menu entry for planned orders
- Add button to navigate from planned orders to linked manufacturing
orders
- Add action to convert planned orders to fixed
- When changing the due date in a planned order the release date is
recomputed
13.0.1.3.0 (2020-03-02)
-----------------------
- [IMP] Minor changes"
(`#470 <https://github.com/OCA/manufacture/pull/470>`__).
- [IMP] Minor changes"
(`#470 <https://github.com/OCA/manufacture/pull/470>`__).
- Planned Order release and due date become required.
- Add button to Product MRP Area to update MOQ from Supplier Info.
- Link Manufacturing Orders with Planned Orders.
- Allow Mrp Inventory Procure Wizard to be used from other models.
- Make MRP Inventory creation more extensible.
- Main Supplier computation (v13 requires explicit False definitions)
- Planned Order release and due date become required.
- Add button to Product MRP Area to update MOQ from Supplier Info.
- Link Manufacturing Orders with Planned Orders.
- Allow Mrp Inventory Procure Wizard to be used from other models.
- Make MRP Inventory creation more extensible.
- Main Supplier computation (v13 requires explicit False
definitions)
13.0.1.2.0 (2020-02-20)
-----------------------
- [IMP] Minor changes
(`#468 <https://github.com/OCA/manufacture/pull/468>`__).
- [IMP] Minor changes
(`#468 <https://github.com/OCA/manufacture/pull/468>`__).
- Planned Orders become fixed on manual creation by default
- Released Quantity becomes readonly
- Add product reference if Planned Order name is not defined on bom
explosion
- Planned Orders become fixed on manual creation by default
- Released Quantity becomes readonly
- Add product reference if Planned Order name is not defined on bom
explosion
13.0.1.1.0 (2020-02-21)
-----------------------
- [FIX] Minor changes
(`#469 <https://github.com/OCA/manufacture/pull/469>`__).
- [FIX] Minor changes
(`#469 <https://github.com/OCA/manufacture/pull/469>`__).
- Fix Main supplier computation in multi company
- Drop Triplicated field in search view
- Fix Main supplier computation in multi company
- Drop Triplicated field in search view
- [IMP] Minor changes
(`#463 <https://github.com/OCA/manufacture/pull/463>`__).
- [IMP] Minor changes
(`#463 <https://github.com/OCA/manufacture/pull/463>`__).
- Show supply method on MRP Inventory
- Allow no-MRP users to look into Products
- Show supply method on MRP Inventory
- Allow no-MRP users to look into Products
13.0.1.0.0 (2019-12-18)
-----------------------
- [MIG] Migration to v13.
- [MIG] Migration to v13.
12.0.1.0.0 (2019-08-05)
-----------------------
- [MIG] Migration to v12:
- [MIG] Migration to v12:
- Estimates as a forecasting mechanism is moved to a new module
(mrp_multi_level_estimate).
- Estimates as a forecasting mechanism is moved to a new module
(mrp_multi_level_estimate).
11.0.3.0.0 (2019-05-22)
-----------------------
- [REW/IMP] Rework to include Planned Orders.
(`#365 <https://github.com/OCA/manufacture/pull/365>`__).
- [IMP] Able to procure from a different location than the area's
location.
- [REW/IMP] Rework to include Planned Orders.
(`#365 <https://github.com/OCA/manufacture/pull/365>`__).
- [IMP] Able to procure from a different location than the area's
location.
11.0.2.2.0 (2019-05-02)
-----------------------
- [IMP] Able to run MRP only for selected areas.
(`#360 <https://github.com/OCA/manufacture/pull/360>`__).
- [IMP] Able to run MRP only for selected areas.
(`#360 <https://github.com/OCA/manufacture/pull/360>`__).
11.0.2.1.0 (2019-04-02)
-----------------------
- [IMP] Implement *Nbr. Days* functionality to be able to group demand
when generating supply proposals.
(`#345 <https://github.com/OCA/manufacture/pull/345>`__).
- [IMP] Implement *Nbr. Days* functionality to be able to group demand
when generating supply proposals.
(`#345 <https://github.com/OCA/manufacture/pull/345>`__).
11.0.2.0.0 (2018-11-20)
-----------------------
- [REW] Refactor MRP Area.
(`#322 <https://github.com/OCA/manufacture/pull/322>`__):
- [REW] Refactor MRP Area.
(`#322 <https://github.com/OCA/manufacture/pull/322>`__):
- MRP product concept dropped in favor of *Product MRP Area
Parameters*. This allow to set different MRP parameters for the same
product in different areas.
- Menu items reordering.
- MRP product concept dropped in favor of *Product MRP Area
Parameters*. This allow to set different MRP parameters for the
same product in different areas.
- Menu items reordering.
11.0.1.1.0 (2018-08-30)
-----------------------
- [FIX] Consider *Qty Multiple* on product to propose the quantity to
procure. (`#297 <https://github.com/OCA/manufacture/pull/297>`__)
- [FIX] Consider *Qty Multiple* on product to propose the quantity to
procure. (`#297 <https://github.com/OCA/manufacture/pull/297>`__)
11.0.1.0.1 (2018-08-03)
-----------------------
- [FIX] User and system locales doesn't break MRP calculation.
(`#290 <https://github.com/OCA/manufacture/pull/290>`__)
- [FIX] Working Hours are now defined only at Warehouse level and
displayed as a related on MRP Areas.
(`#290 <https://github.com/OCA/manufacture/pull/290>`__)
- [FIX] User and system locales doesn't break MRP calculation.
(`#290 <https://github.com/OCA/manufacture/pull/290>`__)
- [FIX] Working Hours are now defined only at Warehouse level and
displayed as a related on MRP Areas.
(`#290 <https://github.com/OCA/manufacture/pull/290>`__)
11.0.1.0.0 (2018-07-09)
-----------------------
- Start of the history.
- Start of the history.
Bug Tracker
===========
@@ -217,7 +218,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_multi_level%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_multi_level%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -233,13 +234,13 @@ Authors
Contributors
------------
- Wim Audenaert <wim.audenaert@ucamco.com>
- Jordi Ballester <jordi.ballester@forgeflow.com>
- Lois Rilo <lois.rilo@forgeflow.com>
- Héctor Villarreal <hector.villarreal@forgeflow.com>
- Christopher Ormaza <chris.ormaza@forgeflow.com>
- Joan Sisquella <joan.sisquella@forgeflow.com>
- Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
- Wim Audenaert <wim.audenaert@ucamco.com>
- Jordi Ballester <jordi.ballester@forgeflow.com>
- Lois Rilo <lois.rilo@forgeflow.com>
- Héctor Villarreal <hector.villarreal@forgeflow.com>
- Christopher Ormaza <chris.ormaza@forgeflow.com>
- Joan Sisquella <joan.sisquella@forgeflow.com>
- Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
Maintainers
-----------
@@ -265,6 +266,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-JordiBForgeFlow| |maintainer-LoisRForgeFlow|
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/17.0/mrp_multi_level>`_ project on GitHub.
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/18.0/mrp_multi_level>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -4,7 +4,7 @@
{
"name": "MRP Multi Level",
"version": "17.0.1.2.5",
"version": "18.0.1.0.0",
"development_status": "Production/Stable",
"license": "LGPL-3",
"author": "Ucamco, ForgeFlow, Odoo Community Association (OCA)",

View File

@@ -6,8 +6,6 @@
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
<field name="state">code</field>
<field name="code">model.run_mrp_multi_level()</field>
</record>

View File

@@ -82,7 +82,7 @@
<field name="bom_id" ref="mrp_bom_product_4" />
<field
name="bom_product_template_attribute_value_ids"
eval="[(6, 0, [ref('product.product_attribute_value_1')])]"
eval="[(6, 0, [ref('product.product_4_attribute_1_value_1')])]"
/>
</record>
<record id="mrp_bom_product_4_line_av_12" model="mrp.bom.line">
@@ -93,7 +93,7 @@
<field name="bom_id" ref="mrp_bom_product_4" />
<field
name="bom_product_template_attribute_value_ids"
eval="[(6, 0, [ref('product.product_attribute_value_2')])]"
eval="[(6, 0, [ref('product.product_4_attribute_1_value_2')])]"
/>
</record>
<record id="mrp_bom_product_4_line_av_21" model="mrp.bom.line">
@@ -104,7 +104,7 @@
<field name="bom_id" ref="mrp_bom_product_4" />
<field
name="bom_product_template_attribute_value_ids"
eval="[(6, 0, [ref('product.product_attribute_value_3')])]"
eval="[(6, 0, [ref('product.product_4_attribute_2_value_1')])]"
/>
</record>
<record id="mrp_bom_product_4_line_av_22" model="mrp.bom.line">
@@ -115,7 +115,7 @@
<field name="bom_id" ref="mrp_bom_product_4" />
<field
name="bom_product_template_attribute_value_ids"
eval="[(6, 0, [ref('product.product_attribute_value_4')])]"
eval="[(6, 0, [ref('product.product_4_attribute_2_value_2')])]"
/>
</record>
<!-- SF-1 -->

View File

@@ -3,7 +3,7 @@
<record id="product_product_fp_1" model="product.product">
<field name="name">FP-1</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -14,7 +14,7 @@
<record id="product_product_fp_2" model="product.product">
<field name="name">FP-2</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -25,7 +25,7 @@
<record id="product_product_fp_3" model="product.product">
<field name="name">FP-3</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -36,7 +36,7 @@
<record id="product_product_fp_4" model="product.product">
<field name="name">FP-4</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
</record>
@@ -51,7 +51,7 @@
<record id="product_product_sf_1" model="product.product">
<field name="name">SF-1</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -62,7 +62,7 @@
<record id="product_product_sf_2" model="product.product">
<field name="name">SF-2</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -73,7 +73,7 @@
<record id="product_product_sf_3" model="product.product">
<field name="name">SF-3</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -85,7 +85,7 @@
<record id="product_product_pp_1" model="product.product">
<field name="name">PP-1</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -96,7 +96,7 @@
<record id="product_product_pp_2" model="product.product">
<field name="name">PP-2</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -108,7 +108,7 @@
<record id="product_product_pp_3" model="product.product">
<field name="name">PP-3</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -120,7 +120,7 @@
<record id="product_product_pp_4" model="product.product">
<field name="name">PP-4</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -132,7 +132,7 @@
<record id="product_product_av_11" model="product.product">
<field name="name">AV-11 steel</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -143,7 +143,7 @@
<record id="product_product_av_12" model="product.product">
<field name="name">AV-12 aluminium</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -154,7 +154,7 @@
<record id="product_product_av_21" model="product.product">
<field name="name">AV-21 white</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field
@@ -165,7 +165,7 @@
<record id="product_product_av_22" model="product.product">
<field name="name">AV-22 black</field>
<field name="categ_id" ref="product_category_mrp" />
<field name="type">product</field>
<field name="is_storable" eval="True" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field

View File

@@ -48,16 +48,12 @@ class MrpInventory(models.Model):
date = fields.Date()
demand_qty = fields.Float(string="Demand")
supply_qty = fields.Float(string="Supply")
initial_on_hand_qty = fields.Float(
string="Starting Inventory", group_operator="avg"
)
final_on_hand_qty = fields.Float(
string="Forecasted Inventory", group_operator="avg"
)
initial_on_hand_qty = fields.Float(string="Starting Inventory", aggregator="avg")
final_on_hand_qty = fields.Float(string="Forecasted Inventory", aggregator="avg")
to_procure = fields.Float(compute="_compute_to_procure", store=True)
running_availability = fields.Float(
string="Planned Availability",
group_operator="avg",
aggregator="avg",
help="Theoretical inventory level if all planned orders were released.",
)
order_release_date = fields.Date(compute="_compute_order_release_date", store=True)
@@ -134,6 +130,6 @@ class MrpInventory(models.Model):
"name": _("Planned Orders"),
"type": "ir.actions.act_window",
"res_model": "mrp.planned.order",
"view_mode": "tree,form",
"view_mode": "list,form",
"domain": domain,
}

View File

@@ -111,5 +111,5 @@ class MrpPlannedOrder(models.Model):
action = self.env.ref("mrp.mrp_production_action")
result = action.read()[0]
result["context"] = {}
result["domain"] = "[('id','in',%s)]" % self.mrp_production_ids.ids
result["domain"] = f"[('id','in',{self.mrp_production_ids.ids})]"
return result

View File

@@ -7,7 +7,6 @@ from math import ceil
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.osv import expression
class ProductMRPArea(models.Model):
@@ -142,21 +141,18 @@ class ProductMRPArea(models.Model):
)
@api.model
def _name_search(self, name, domain=None, operator="ilike", limit=None, order=None):
def _search_display_name(self, operator, value):
domain = super()._search_display_name(operator, value)
if operator in ("ilike", "like", "=", "=like", "=ilike"):
domain = expression.AND(
[
domain or [],
[
"|",
"|",
("product_id.name", operator, name),
("product_id.default_code", operator, name),
("mrp_area_id.name", operator, name),
],
]
)
return super()._name_search(name, domain, operator, limit, order)
domain = [
"|",
"|",
("product_id.name", operator, value),
("product_id.default_code", operator, value),
("mrp_area_id.name", operator, value),
]
return domain
return domain
def _compute_mrp_lead_time(self):
produced = self.filtered(lambda r: r.supply_method == "manufacture")

View File

@@ -1,9 +1,9 @@
## MRP Areas
### MRP Areas
- Go to *Manufacturing \> Configuration \> MRP Areas* and define or edit
any existing area. You can specify the working hours for every area.
## Product MRP Area Parameters
### Product MRP Area Parameters
- Go to *Manufacturing \> Master Data \> Product MRP Area Parameters*
- Go to *Manufacturing \> Products \> Product MRP Area Parameters*
and set the MRP parameters for a given product and area.

View File

@@ -1,11 +1,11 @@
To manually run the MRP scheduler:
1. Go to *Manufacturing \> Operations \> Run MRP Multi Level*.
1. Go to *Manufacturing \> Planning \> Run MRP Multi Level*.
2. On the wizard click *Run MRP*.
To launch replenishment orders (moves, purchases, production orders...):
1. Go to *Manufacturing \> Operations \> MRP Inventory*.
1. Go to *Manufacturing \> Planning \> MRP Inventory*.
2. Filter with *To procure*.
3. Select multiple records and click on *Action \> Procure* or click
the right hand side gears in any record.

View File

@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:afddaf576893642eae579ee762efefb3c3ecc9f84445b23b43ab6fc448975fce
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/17.0/mrp_multi_level"><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-17-0/manufacture-17-0-mrp_multi_level"><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=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<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/18.0/mrp_multi_level"><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-18-0/manufacture-18-0-mrp_multi_level"><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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows you to calculate, based in known inventory, demand,
and supply, and based on parameters set at product variant level, the
new procurements for each product.</p>
@@ -392,36 +392,42 @@ module</a>.</li>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a><ul>
<li><a class="reference internal" href="#mrp-areas" id="toc-entry-2">MRP Areas</a></li>
<li><a class="reference internal" href="#product-mrp-area-parameters" id="toc-entry-3">Product MRP Area Parameters</a></li>
</ul>
</li>
<li><a class="reference internal" href="#usage" id="toc-entry-4">Usage</a></li>
<li><a class="reference internal" href="#changelog" id="toc-entry-5">Changelog</a></li>
</ul>
</div>
<div class="section" id="configuration">
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
</div>
</div>
<div class="section" id="mrp-areas">
<h1>MRP Areas</h1>
<h3><a class="toc-backref" href="#toc-entry-2">MRP Areas</a></h3>
<ul class="simple">
<li>Go to <em>Manufacturing &gt; Configuration &gt; MRP Areas</em> and define or edit
any existing area. You can specify the working hours for every area.</li>
</ul>
</div>
<div class="section" id="product-mrp-area-parameters">
<h1>Product MRP Area Parameters</h1>
<h3><a class="toc-backref" href="#toc-entry-3">Product MRP Area Parameters</a></h3>
<ul class="simple">
<li>Go to <em>Manufacturing &gt; Master Data &gt; Product MRP Area Parameters</em> and
<li>Go to <em>Manufacturing &gt; Products &gt; Product MRP Area Parameters</em> and
set the MRP parameters for a given product and area.</li>
</ul>
</div>
</div>
<div class="section" id="usage">
<h2>Usage</h2>
<h2><a class="toc-backref" href="#toc-entry-4">Usage</a></h2>
<p>To manually run the MRP scheduler:</p>
<ol class="arabic simple">
<li>Go to <em>Manufacturing &gt; Operations &gt; Run MRP Multi Level</em>.</li>
<li>Go to <em>Manufacturing &gt; Planning &gt; Run MRP Multi Level</em>.</li>
<li>On the wizard click <em>Run MRP</em>.</li>
</ol>
<p>To launch replenishment orders (moves, purchases, production orders…):</p>
<ol class="arabic simple">
<li>Go to <em>Manufacturing &gt; Operations &gt; MRP Inventory</em>.</li>
<li>Go to <em>Manufacturing &gt; Planning &gt; MRP Inventory</em>.</li>
<li>Filter with <em>To procure</em>.</li>
<li>Select multiple records and click on <em>Action &gt; Procure</em> or click the
right hand side gears in any record.</li>
@@ -429,7 +435,7 @@ right hand side gears in any record.</li>
</ol>
</div>
<div class="section" id="changelog">
<h2>Changelog</h2>
<h2><a class="toc-backref" href="#toc-entry-5">Changelog</a></h2>
</div>
</div>
<div class="section" id="section-1">
@@ -464,7 +470,8 @@ recomputed</li>
<li>Link Manufacturing Orders with Planned Orders.</li>
<li>Allow Mrp Inventory Procure Wizard to be used from other models.</li>
<li>Make MRP Inventory creation more extensible.</li>
<li>Main Supplier computation (v13 requires explicit False definitions)</li>
<li>Main Supplier computation (v13 requires explicit False
definitions)</li>
</ul>
</li>
</ul>
@@ -545,8 +552,8 @@ when generating supply proposals.
<li>[REW] Refactor MRP Area.
(<a class="reference external" href="https://github.com/OCA/manufacture/pull/322">#322</a>):<ul>
<li>MRP product concept dropped in favor of <em>Product MRP Area
Parameters</em>. This allow to set different MRP parameters for the same
product in different areas.</li>
Parameters</em>. This allow to set different MRP parameters for the
same product in different areas.</li>
<li>Menu items reordering.</li>
</ul>
</li>
@@ -579,7 +586,7 @@ displayed as a related on MRP Areas.
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_multi_level%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_multi_level%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -616,7 +623,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/JordiBForgeFlow"><img alt="JordiBForgeFlow" src="https://github.com/JordiBForgeFlow.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/LoisRForgeFlow"><img alt="LoisRForgeFlow" src="https://github.com/LoisRForgeFlow.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/17.0/mrp_multi_level">OCA/manufacture</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/18.0/mrp_multi_level">OCA/manufacture</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@@ -104,7 +104,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
cls.prod_test = cls.product_obj.create(
{
"name": "Test Top Seller",
"type": "product",
"is_storable": True,
"list_price": 150.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
@@ -124,7 +124,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
cls.prod_min = cls.product_obj.create(
{
"name": "Product with minimum order qty",
"type": "product",
"is_storable": True,
"list_price": 50.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 10.0})],
@@ -143,7 +143,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
cls.prod_max = cls.product_obj.create(
{
"name": "Product with maximum order qty",
"type": "product",
"is_storable": True,
"list_price": 50.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 10.0})],
@@ -161,7 +161,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
cls.prod_multiple = cls.product_obj.create(
{
"name": "Product with qty multiple",
"type": "product",
"is_storable": True,
"list_price": 50.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 10.0})],
@@ -180,7 +180,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
cls.product_scenario_1 = cls.product_obj.create(
{
"name": "Product Special Scenario 1",
"type": "product",
"is_storable": True,
"list_price": 100.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
@@ -198,7 +198,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
cls.product_tz = cls.product_obj.create(
{
"name": "Product Timezone",
"type": "product",
"is_storable": True,
"list_price": 100.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
@@ -211,7 +211,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
cls.prod_uom_test = cls.product_obj.create(
{
"name": "Product Uom Test",
"type": "product",
"is_storable": True,
"uom_id": cls.env.ref("uom.product_uom_unit").id,
"uom_po_id": cls.env.ref("uom.product_uom_dozen").id,
"list_price": 150.0,
@@ -226,7 +226,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
cls.product_lots = cls.product_obj.create(
{
"name": "Product Tracked by Lots",
"type": "product",
"is_storable": True,
"tracking": "lot",
"uom_id": cls.env.ref("uom.product_uom_unit").id,
"list_price": 100.0,

View File

@@ -298,7 +298,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
)
self.assertNotEqual(this.create_uid, prev.create_uid)
def test_11_special_scenario_1(self):
def test_10_special_scenario_1(self):
"""When grouping demand supply and demand are in the same day but
supply goes first."""
moves = self.mrp_move_obj.search(
@@ -314,7 +314,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
# Net needs = 18, available on-hand = 3 -> 15
self.assertEqual(mrp_invs[1].to_procure, 15)
def test_12_bom_line_attribute_value_skip(self):
def test_11_bom_line_attribute_value_skip(self):
"""Check for the correct demand on components of a product with
multiple variants"""
product_4b_demand = self.mrp_inventory_obj.search(
@@ -348,7 +348,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
)
self.assertTrue(av_22_supply.to_procure, 100.0)
def test_13_timezone_handling(self):
def test_12_timezone_handling(self):
self.calendar.tz = "Australia/Sydney" # Oct-Apr/Apr-Oct: UTC+11/UTC+10
date_move = datetime(2090, 4, 19, 20, 00) # Apr 20 6/7 am in Sidney
sidney_date = date(2090, 4, 20)
@@ -367,7 +367,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
self.assertEqual(len(inventory), 1)
self.assertEqual(inventory.date, sidney_date)
def test_14_timezone_not_set(self):
def test_13_timezone_not_set(self):
self.wh.calendar_id = False
date_move = datetime(2090, 4, 19, 20, 00)
self._create_picking_in(
@@ -385,7 +385,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
self.assertEqual(len(inventory), 1)
self.assertEqual(inventory.date, date_move.date())
def test_15_units_case(self):
def test_14_units_case(self):
"""When a product has a different purchase unit of measure than
the general unit of measure and the supply is coming from an RFQ"""
prod_uom_test_inventory_lines = self.mrp_inventory_obj.search(
@@ -395,7 +395,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
self.assertEqual(prod_uom_test_inventory_lines.supply_qty, 12.0)
# Supply qty has to be 12 has a dozen of units are in a RFQ.
def test_16_phantom_comp_planning(self):
def test_15_phantom_comp_planning(self):
"""
Phantom components will not appear in MRP Inventory or Planned Orders.
MRP Parameter will have 'phantom' supply method.
@@ -431,7 +431,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
)
self.assertEqual(len(pp_4_planned_orders), 1)
def test_17_supply_method(self):
def test_16_supply_method(self):
"""Test supply method computation."""
self.fp_4.route_ids = [(5, 0, 0)]
product_mrp_area = self.product_mrp_area_obj.search(
@@ -470,7 +470,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
self.assertEqual(product_mrp_area.supply_method, "phantom")
self.assertEqual(product_mrp_area.supply_bom_id, kit_bom)
def test_18_priorize_safety_stock(self):
def test_17_priorize_safety_stock(self):
now = datetime.now()
product = self.prod_test # has Buy route
product.seller_ids[0].delay = 2 # set a purchase lead time
@@ -549,7 +549,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
f"(expected {test_vals[key]} on {inv.date})",
)
def test_19_on_hand_with_lots(self):
def test_18_on_hand_with_lots(self):
"""Check that on-hand is correctly computed when tracking by lots."""
lots_line_1 = self.mrp_inventory_obj.search(
[("product_mrp_area_id.product_id", "=", self.product_lots.id)]
@@ -558,7 +558,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
self.assertEqual(lots_line_1.initial_on_hand_qty, 210)
self.assertEqual(lots_line_1.final_on_hand_qty, 185)
def test_20_prioritize_safety_stock_grouped_1(self):
def test_19_prioritize_safety_stock_grouped_1(self):
"""Test grouped demand MRP but with a short nbr days.
Safety stock should be ordered."""
now = datetime.now()
@@ -639,7 +639,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
f"(expected {test_vals[key]} on {inv.date})",
)
def test_21_prioritize_safety_stock_grouped_2(self):
def test_20_prioritize_safety_stock_grouped_2(self):
"""Test grouped demand MRP but with a longer nbr days.
Safety stock should be ordered."""
now = datetime.now()
@@ -720,7 +720,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
f"(expected {test_vals[key]} on {inv.date})",
)
def test_22_prioritize_safety_stock_grouped_3(self):
def test_21_prioritize_safety_stock_grouped_3(self):
"""Test grouped demand MRP but with an existing incoming supply
Safety stock should NOT be ordered."""
now = datetime.now()
@@ -792,7 +792,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
f"(expected {test_vals[key]} on {inv.date})",
)
def test_23_prioritize_safety_stock_with_mrp_moves_today(self):
def test_22_prioritize_safety_stock_with_mrp_moves_today(self):
"""Test MRP but with moves today. Safety stock should not be ordered."""
now = datetime.now()
product = self.prod_test # has Buy route
@@ -834,7 +834,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
f"(expected {test_vals[key]} on {inv.date})",
)
def test_24_prioritize_safety_stock_with_mrp_moves_today_grouped(self):
def test_23_prioritize_safety_stock_with_mrp_moves_today_grouped(self):
"""Test grouped demand MRP but with moves today. Safety stock should not be
ordered.
"""
@@ -879,7 +879,7 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
f"(expected {test_vals[key]} on {inv.date})",
)
def test_25_phantom_comp_on_hand(self):
def test_24_phantom_comp_on_hand(self):
"""
A phantom product with positive qty_available (which is computed from the
availability of its components) should not satisfy demand, because this leads

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="mrp_area_tree">
<field name="name">mrp.area.tree</field>
<record model="ir.ui.view" id="mrp_area_list">
<field name="name">mrp.area.list</field>
<field name="model">mrp.area</field>
<field name="type">tree</field>
<field name="type">list</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name" />
<field name="warehouse_id" />
<field name="company_id" groups="base.group_multi_company" />
<field name="location_id" />
<field name="calendar_id" />
</tree>
</list>
</field>
</record>
<record model="ir.ui.view" id="mrp_area_form">
@@ -54,7 +54,7 @@
<field name="name">MRP Area</field>
<field name="res_model">mrp.area</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="mrp_area_tree" />
<field name="view_mode">list,form</field>
<field name="view_id" ref="mrp_area_list" />
</record>
</odoo>

View File

@@ -36,12 +36,12 @@
</form>
</field>
</record>
<record id="mrp_inventory_tree" model="ir.ui.view">
<field name="name">mrp.inventory.tree</field>
<record id="mrp_inventory_list" model="ir.ui.view">
<field name="name">mrp.inventory.list</field>
<field name="model">mrp.inventory</field>
<field name="type">tree</field>
<field name="type">list</field>
<field name="arch" type="xml">
<tree create="false">
<list create="false">
<field name="mrp_area_id" />
<field name="company_id" groups="base.group_multi_company" />
<field name="product_id" />
@@ -71,7 +71,7 @@
<field name="supply_method" />
<field name="main_supplier_id" optional="hide" />
<field name="running_availability" />
</tree>
</list>
</field>
</record>
<record id="view_mrp_inventory_pivot" model="ir.ui.view">
@@ -160,8 +160,8 @@
<field name="name">MRP Inventory</field>
<field name="res_model">mrp.inventory</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form,pivot,graph</field>
<field name="view_id" ref="mrp_inventory_tree" />
<field name="view_mode">list,form,pivot,graph</field>
<field name="view_id" ref="mrp_inventory_list" />
<field name="search_view_id" ref="mrp_inventory_search" />
</record>
</odoo>

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="mrp_move_view_tree" model="ir.ui.view">
<field name="name">mrp.move.tree</field>
<record id="mrp_move_view_list" model="ir.ui.view">
<field name="name">mrp.move.list</field>
<field name="model">mrp.move</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="mrp_date" />
<field name="current_date" />
<field name="mrp_origin" />
@@ -16,7 +16,7 @@
<field name="current_qty" />
<field name="mrp_type" />
<field name="planned_order_up_ids" />
</tree>
</list>
</field>
</record>
@@ -87,6 +87,6 @@
<field name="name">MRP Moves</field>
<field name="res_model">mrp.move</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
</odoo>

View File

@@ -2,11 +2,11 @@
<!-- Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
Part of ForgeFlow. See LICENSE file for full copyright and licensing details. -->
<odoo>
<record id="mrp_planned_order_view_tree" model="ir.ui.view">
<field name="name">mrp.planned.order.tree</field>
<record id="mrp_planned_order_view_list" model="ir.ui.view">
<field name="name">mrp.planned.order.list</field>
<field name="model">mrp.planned.order</field>
<field name="arch" type="xml">
<tree
<list
decoration-info="fixed != True and mrp_action != 'phantom'"
decoration-muted="mrp_action == 'phantom'"
>
@@ -21,7 +21,7 @@
<field name="mrp_qty" />
<field name="fixed" />
<field name="mrp_action" optional="hide" />
</tree>
</list>
</field>
</record>
<record id="mrp_planned_order_view_form" model="ir.ui.view">
@@ -112,7 +112,7 @@
<field name="name">Planned Orders</field>
<field name="res_model">mrp.planned.order</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form,pivot</field>
<field name="view_mode">list,form,pivot</field>
<field name="context">{'search_default_fixed': 1}</field>
</record>
<menuitem

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="product_mrp_area_tree">
<field name="name">product.mrp.area.tree</field>
<record model="ir.ui.view" id="product_mrp_area_list">
<field name="name">product.mrp.area.list</field>
<field name="model">product.mrp.area</field>
<field name="type">tree</field>
<field name="type">list</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="mrp_area_id" />
<field name="company_id" groups="base.group_multi_company" />
<field name="product_tmpl_id" />
@@ -21,7 +21,7 @@
<field name="mrp_qty_multiple" />
<field name="supply_method" />
<field name="main_supplierinfo_id" />
</tree>
</list>
</field>
</record>
<record model="ir.ui.view" id="product_mrp_area_form">
@@ -112,7 +112,7 @@
groups="base.group_no_one"
>
<field name="mrp_move_ids" nolabel="1">
<tree>
<list>
<field name="mrp_date" />
<field name="current_date" />
<field name="mrp_origin" />
@@ -124,7 +124,7 @@
<field name="current_qty" />
<field name="mrp_type" />
<field name="planned_order_up_ids" />
</tree>
</list>
</field>
</page>
<page
@@ -133,7 +133,7 @@
groups="base.group_no_one"
>
<field name="planned_order_ids" nolabel="1">
<tree>
<list>
<field name="order_release_date" />
<field name="due_date" />
<field name="name" />
@@ -141,7 +141,7 @@
<field name="mrp_action" />
<field name="qty_released" />
<field name="fixed" />
</tree>
</list>
</field>
</page>
</notebook>
@@ -176,8 +176,8 @@
<field name="name">Product MRP Area Parameters</field>
<field name="res_model">product.mrp.area</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="product_mrp_area_tree" />
<field name="view_mode">list,form</field>
<field name="view_id" ref="product_mrp_area_list" />
<field name="search_view_id" ref="product_mrp_area_search" />
</record>
</odoo>

View File

@@ -14,7 +14,7 @@
</p>
<group name="items" string="Items" />
<field name="item_ids" nolabel="1">
<tree nocreate="1" editable="top">
<list nocreate="1" editable="top">
<field name="mrp_inventory_id" column_invisible="True" />
<field
name="warehouse_id"
@@ -31,7 +31,7 @@
<field name="uom_id" groups="uom.group_uom" />
<field name="date_planned" />
<field name="supply_method" />
</tree>
</list>
</field>
<footer>
<button

View File

@@ -196,7 +196,7 @@ class MultiLevelMrp(models.TransientModel):
for bomline in bom.bom_line_ids:
if (
float_is_zero(bomline.product_qty, precision_digits=pd)
or bomline.product_id.type != "product"
or bomline.product_id.type != "consu"
):
continue
if self.with_context(mrp_explosion=True)._exclude_from_mrp(
@@ -335,7 +335,7 @@ class MultiLevelMrp(models.TransientModel):
products = self.env["product.product"].search([("llc", "=", llc)])
if products:
counter = len(products)
log_msg = "Low level code 0 finished - Nbr. products: %s" % counter
log_msg = f"Low level code 0 finished - Nbr. products: {counter}"
logger.info(log_msg)
while counter:
@@ -370,14 +370,17 @@ class MultiLevelMrp(models.TransientModel):
if mrp_areas:
domain += [("mrp_area_id", "in", mrp_areas.ids)]
self.env["product.mrp.area"].search(domain).write({"mrp_applicable": False})
domain += [("product_id.type", "=", "product")]
domain += [
("product_id.type", "=", "consu"),
("product_id.is_storable", "=", True),
]
self.env["product.mrp.area"].search(domain).write({"mrp_applicable": True})
self._adjust_mrp_applicable(mrp_areas)
count_domain = [("mrp_applicable", "=", True)]
if mrp_areas:
count_domain += [("mrp_area_id", "in", mrp_areas.ids)]
counter = self.env["product.mrp.area"].search_count(count_domain)
log_msg = "End Calculate MRP Applicable: %s" % counter
log_msg = f"End Calculate MRP Applicable: {counter}"
logger.info(log_msg)
return True
@@ -750,7 +753,10 @@ class MultiLevelMrp(models.TransientModel):
self._init_mrp_move_grouped_demand(product_mrp_area)
counter += 1
log_msg = f"MRP Calculation LLC {llc} at {mrp_area.name} Finished - Nbr. products: {counter}"
log_msg = (
f"MRP Calculation LLC {llc} at {mrp_area.name} Finished "
"- Nbr. products: {counter}"
)
logger.info(log_msg)
logger.info("End MRP calculation")