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",
|
||||
"summary": "Adds sale information to Manufacturing models",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "14.0.1.0.0",
|
||||
"category": "Manufacturing",
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
"author": "AvanzOSC, " "Tecnativa, " "Odoo Community Association (OCA)",
|
||||
|
||||
@@ -16,11 +16,20 @@ class StockRule(models.Model):
|
||||
location_id,
|
||||
name,
|
||||
origin,
|
||||
company_id,
|
||||
values,
|
||||
bom,
|
||||
):
|
||||
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"] = (
|
||||
values.get("group_id").id if values.get("group_id", False) else False
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
* Rafael Blasco
|
||||
* Pedro M. Baeza
|
||||
* Rubén Bravo <rubenred18@gmail.com>
|
||||
* Kevin Khao <kevin.khao@akretion.com>
|
||||
|
||||
@@ -8,13 +8,16 @@ class TestMrpSaleInfo(common.SavepointCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
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(
|
||||
{
|
||||
"name": "Test mrp_sale_info product",
|
||||
"type": "product",
|
||||
"route_ids": [
|
||||
(4, cls.env.ref("mrp.route_warehouse0_manufacture").id),
|
||||
(4, cls.env.ref("stock.route_warehouse0_mto").id),
|
||||
(4, route_manufacture_1.id),
|
||||
(4, route_manufacture_2.id),
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="availability" position="after">
|
||||
<field name="sale_id" />
|
||||
<field name="partner_id" />
|
||||
<field name="commitment_date" />
|
||||
</field>
|
||||
<page name="miscellaneous" position="inside">
|
||||
<group>
|
||||
<field name="sale_id" />
|
||||
<field name="partner_id" />
|
||||
<field name="commitment_date" />
|
||||
</group>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
<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="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="date_planned_start" position="after">
|
||||
<field name="sale_id" />
|
||||
@@ -18,11 +21,20 @@
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="production_id" position="after">
|
||||
<field name="sale_id" />
|
||||
<field name="partner_id" />
|
||||
<field name="commitment_date" />
|
||||
</field>
|
||||
<page name="time_tracking" position="after">
|
||||
<!-- "miscellaneous" doesn't exist in base view -->
|
||||
<!-- and seems too easy to overwrite accidentally -->
|
||||
<!-- thus, create new sale_info tab -->
|
||||
<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>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user