mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] mrp_sale_info: Migration to 14.0
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
{
|
{
|
||||||
"name": "MRP Sale Info",
|
"name": "MRP Sale Info",
|
||||||
"summary": "Adds sale information to Manufacturing models",
|
"summary": "Adds sale information to Manufacturing models",
|
||||||
"version": "12.0.1.0.0",
|
"version": "14.0.1.0.0",
|
||||||
"category": "Manufacturing",
|
"category": "Manufacturing",
|
||||||
"website": "https://github.com/OCA/manufacture",
|
"website": "https://github.com/OCA/manufacture",
|
||||||
"author": "AvanzOSC, " "Tecnativa, " "Odoo Community Association (OCA)",
|
"author": "AvanzOSC, " "Tecnativa, " "Odoo Community Association (OCA)",
|
||||||
|
|||||||
@@ -16,11 +16,20 @@ class StockRule(models.Model):
|
|||||||
location_id,
|
location_id,
|
||||||
name,
|
name,
|
||||||
origin,
|
origin,
|
||||||
|
company_id,
|
||||||
values,
|
values,
|
||||||
bom,
|
bom,
|
||||||
):
|
):
|
||||||
res = super()._prepare_mo_vals(
|
res = super()._prepare_mo_vals(
|
||||||
product_id, product_qty, product_uom, location_id, name, origin, values, bom
|
product_id,
|
||||||
|
product_qty,
|
||||||
|
product_uom,
|
||||||
|
location_id,
|
||||||
|
name,
|
||||||
|
origin,
|
||||||
|
company_id,
|
||||||
|
values,
|
||||||
|
bom,
|
||||||
)
|
)
|
||||||
res["source_procurement_group_id"] = (
|
res["source_procurement_group_id"] = (
|
||||||
values.get("group_id").id if values.get("group_id", False) else False
|
values.get("group_id").id if values.get("group_id", False) else False
|
||||||
|
|||||||
@@ -8,3 +8,4 @@
|
|||||||
* Rafael Blasco
|
* Rafael Blasco
|
||||||
* Pedro M. Baeza
|
* Pedro M. Baeza
|
||||||
* Rubén Bravo <rubenred18@gmail.com>
|
* Rubén Bravo <rubenred18@gmail.com>
|
||||||
|
* Kevin Khao <kevin.khao@akretion.com>
|
||||||
|
|||||||
@@ -8,13 +8,16 @@ class TestMrpSaleInfo(common.SavepointCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super().setUpClass()
|
super().setUpClass()
|
||||||
|
route_manufacture_1 = cls.env.ref("mrp.route_warehouse0_manufacture")
|
||||||
|
route_manufacture_2 = cls.env.ref("stock.route_warehouse0_mto")
|
||||||
|
route_manufacture_2.active = True
|
||||||
cls.product = cls.env["product.product"].create(
|
cls.product = cls.env["product.product"].create(
|
||||||
{
|
{
|
||||||
"name": "Test mrp_sale_info product",
|
"name": "Test mrp_sale_info product",
|
||||||
"type": "product",
|
"type": "product",
|
||||||
"route_ids": [
|
"route_ids": [
|
||||||
(4, cls.env.ref("mrp.route_warehouse0_manufacture").id),
|
(4, route_manufacture_1.id),
|
||||||
(4, cls.env.ref("stock.route_warehouse0_mto").id),
|
(4, route_manufacture_2.id),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,11 +5,13 @@
|
|||||||
<field name="model">mrp.production</field>
|
<field name="model">mrp.production</field>
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
|
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="availability" position="after">
|
<page name="miscellaneous" position="inside">
|
||||||
<field name="sale_id" />
|
<group>
|
||||||
<field name="partner_id" />
|
<field name="sale_id" />
|
||||||
<field name="commitment_date" />
|
<field name="partner_id" />
|
||||||
</field>
|
<field name="commitment_date" />
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,10 @@
|
|||||||
<record id="mrp_production_workorder_tree_view_inherit" model="ir.ui.view">
|
<record id="mrp_production_workorder_tree_view_inherit" model="ir.ui.view">
|
||||||
<field name="name">MRP Work Order Tree with Sale Order</field>
|
<field name="name">MRP Work Order Tree with Sale Order</field>
|
||||||
<field name="model">mrp.workorder</field>
|
<field name="model">mrp.workorder</field>
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_view_inherit" />
|
<field
|
||||||
|
name="inherit_id"
|
||||||
|
ref="mrp.mrp_production_workorder_tree_editable_view"
|
||||||
|
/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="date_planned_start" position="after">
|
<field name="date_planned_start" position="after">
|
||||||
<field name="sale_id" />
|
<field name="sale_id" />
|
||||||
@@ -18,11 +21,20 @@
|
|||||||
<field name="model">mrp.workorder</field>
|
<field name="model">mrp.workorder</field>
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit" />
|
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="production_id" position="after">
|
<page name="time_tracking" position="after">
|
||||||
<field name="sale_id" />
|
<!-- "miscellaneous" doesn't exist in base view -->
|
||||||
<field name="partner_id" />
|
<!-- and seems too easy to overwrite accidentally -->
|
||||||
<field name="commitment_date" />
|
<!-- thus, create new sale_info tab -->
|
||||||
</field>
|
<page
|
||||||
|
string="Sale information"
|
||||||
|
name="sale_info"
|
||||||
|
groups="mrp.group_mrp_manager"
|
||||||
|
>
|
||||||
|
<field name="sale_id" />
|
||||||
|
<field name="partner_id" />
|
||||||
|
<field name="commitment_date" />
|
||||||
|
</page>
|
||||||
|
</page>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user