[MIG] mrp_multi_level: Migration to 16.0

This commit is contained in:
joan
2022-11-14 09:18:46 +01:00
committed by JasminSForgeFlow
parent 84393fbab2
commit caf43f4cc4
11 changed files with 57 additions and 39 deletions

View File

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

View File

@@ -30,13 +30,14 @@
eval="obj().env.ref('stock.warehouse0').lot_stock_id.id"
/>
</record>
<function model="stock.quant" name="action_apply_inventory">
<function
<function model="stock.quant" name="action_apply_inventory">
<function
eval="[[('id', 'in', (ref('stock_inventory_1'),
ref('stock_inventory_2'),
ref('stock_inventory_3'),
))]]"
ref('stock_inventory_2'),
ref('stock_inventory_3'),
))]]"
model="stock.quant"
name="search"
/>
</function></odoo>
</function>
</odoo>

View File

@@ -2,42 +2,42 @@
<odoo noupdate="1">
<record id="product_supplierinfo_av_11" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_av_11_product_template" />
<field name="name" ref="res_partner_lazer_tech" />
<field name="partner_id" ref="res_partner_lazer_tech" />
<field name="delay">4</field>
<field name="min_qty">0</field>
<field name="price">100</field>
</record>
<record id="product_supplierinfo_av_12" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_av_12_product_template" />
<field name="name" ref="res_partner_lazer_tech" />
<field name="partner_id" ref="res_partner_lazer_tech" />
<field name="delay">4</field>
<field name="min_qty">0</field>
<field name="price">100</field>
</record>
<record id="product_supplierinfo_av_21" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_av_21_product_template" />
<field name="name" ref="res_partner_lazer_tech" />
<field name="partner_id" ref="res_partner_lazer_tech" />
<field name="delay">4</field>
<field name="min_qty">0</field>
<field name="price">100</field>
</record>
<record id="product_supplierinfo_av_22" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_av_22_product_template" />
<field name="name" ref="res_partner_lazer_tech" />
<field name="partner_id" ref="res_partner_lazer_tech" />
<field name="delay">4</field>
<field name="min_qty">0</field>
<field name="price">100</field>
</record>
<record id="product_supplierinfo_pp_1" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_pp_1_product_template" />
<field name="name" ref="res_partner_lazer_tech" />
<field name="partner_id" ref="res_partner_lazer_tech" />
<field name="delay">4</field>
<field name="min_qty">0</field>
<field name="price">100</field>
</record>
<record id="product_supplierinfo_pp_2" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_pp_2_product_template" />
<field name="name" ref="res_partner_lazer_tech" />
<field name="partner_id" ref="res_partner_lazer_tech" />
<field name="delay">2</field>
<field name="min_qty">0</field>
<field name="price">100</field>
@@ -45,7 +45,7 @@
<record id="product_supplierinfo_pp_3" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_pp_3_product_template" />
<field name="name" ref="res_partner_lazer_tech" />
<field name="partner_id" ref="res_partner_lazer_tech" />
<field name="delay">2</field>
<field name="min_qty">0</field>
<field name="price">10</field>
@@ -53,7 +53,7 @@
<record id="product_supplierinfo_pp_4" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product_product_pp_4_product_template" />
<field name="name" ref="res_partner_lazer_tech" />
<field name="partner_id" ref="res_partner_lazer_tech" />
<field name="delay">3</field>
<field name="min_qty">0</field>
<field name="price">80</field>

View File

@@ -8,3 +8,4 @@ from . import mrp_inventory
from . import product_mrp_area
from . import stock_rule
from . import mrp_production
from . import stock_quant

View File

@@ -211,7 +211,7 @@ class ProductMRPArea(models.Model):
rec.main_supplier_id = False
continue
rec.main_supplierinfo_id = suppliers[0]
rec.main_supplier_id = suppliers[0].name
rec.main_supplier_id = suppliers[0].partner_id
for rec in self.filtered(lambda r: r.supply_method != "buy"):
rec.main_supplierinfo_id = False
rec.main_supplier_id = False

View File

@@ -0,0 +1,16 @@
# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com)
# - Joan Sisquella Andrés <lois.rilo@forgeflow.com>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import api, models
class StockQuant(models.Model):
_inherit = "stock.quant"
@api.model
def _get_inventory_fields_write(self):
"""
Adding field product_uom_id, inventory_quantity
"""
fields = super(StockQuant, self)._get_inventory_fields_write()
return fields + ["product_uom_id", "inventory_quantity"]

View File

@@ -3,3 +3,4 @@
* 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>

View File

@@ -103,7 +103,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"list_price": 150.0,
"produce_delay": 5.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"name": vendor1.id, "price": 20.0})],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -123,7 +123,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 50.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"name": vendor1.id, "price": 10.0})],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 10.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -142,7 +142,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 50.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"name": vendor1.id, "price": 10.0})],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 10.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -160,7 +160,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 50.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"name": vendor1.id, "price": 10.0})],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 10.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -179,7 +179,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 100.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"name": vendor1.id, "price": 20.0})],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -197,7 +197,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 100.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"name": vendor1.id, "price": 20.0})],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -213,7 +213,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"list_price": 150.0,
"produce_delay": 5.0,
"route_ids": [(6, 0, [route_buy])],
"seller_ids": [(0, 0, {"name": vendor1.id, "price": 20.0})],
"seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -248,7 +248,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": cls.stock_location.id,
"location_dest_id": cls.customer_location.id,
"scheduled_date": date_move,
"move_lines": [
"move_ids": [
(
0,
0,
@@ -313,7 +313,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": cls.stock_location.id,
"location_dest_id": cls.customer_location.id,
"scheduled_date": date_move,
"move_lines": [
"move_ids": [
(
0,
0,
@@ -439,7 +439,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": cls.sec_loc.id,
"location_dest_id": cls.customer_location.id,
"scheduled_date": date_move,
"move_lines": [
"move_ids": [
(
0,
0,
@@ -481,7 +481,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": cls.supplier_location.id,
"location_dest_id": location.id,
"scheduled_date": date_move,
"move_lines": [
"move_ids": [
(
0,
0,
@@ -511,7 +511,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": location.id,
"location_dest_id": cls.customer_location.id,
"scheduled_date": date_move,
"move_lines": [
"move_ids": [
(
0,
0,

View File

@@ -57,6 +57,7 @@
name="action_open_planned_orders"
type="object"
icon="fa-list"
title="Details"
/>
<field name="order_release_date" />
<button

View File

@@ -12,20 +12,20 @@
this may trigger a draft purchase order, a manufacturing
order or a transfer picking.
</p>
<group name="items" string="Items">
<group name="items" string="Items" />
<field name="item_ids" nolabel="1">
<tree nocreate="1" editable="top">
<field name="mrp_inventory_id" invisible="True" />
<field
name="warehouse_id"
groups="stock.group_stock_multi_locations"
readonly="1"
/>
name="warehouse_id"
groups="stock.group_stock_multi_locations"
readonly="1"
/>
<field
name="location_id"
groups="stock.group_stock_multi_locations"
readonly="1"
/>
name="location_id"
groups="stock.group_stock_multi_locations"
readonly="1"
/>
<field name="product_id" readonly="1" />
<field name="qty" />
<field name="uom_id" groups="uom.group_uom" />
@@ -33,7 +33,6 @@
<field name="supply_method" />
</tree>
</field>
</group>
<footer>
<button
string="Execute"

View File

@@ -19,7 +19,6 @@
type="object"
class="oe_highlight"
/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>