summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorsvs-odoo <svs@odoo.com>2020-07-31 14:15:47 +0000
committersvs-odoo <svs@odoo.com>2020-08-27 08:19:51 +0000
commitd6b0c3dcfb2f9f926cef1d22c96e4f09afe0d6c8 (patch)
treef893ec32f796c9fd2c6a2c7870e176e8acea7b3f /addons
parentff2d4d77019a137008a7af5b0742c9ababeb5df9 (diff)
[IMP] mrp: demo data
- Adds a MO for Table Top (2 units) to have a link between a consuming and a replenishing MO in the new product forecast report. - Generates finished moves for the demo data MO, so they can be retrived by the forecast report. - Changes date planned for the Table MO, so it will be planned after the Table Top MO. - Calls the `action_confirm` on the MOs in batch. task-2058495
Diffstat (limited to 'addons')
-rw-r--r--addons/mrp/data/mrp_demo.xml50
1 files changed, 33 insertions, 17 deletions
diff --git a/addons/mrp/data/mrp_demo.xml b/addons/mrp/data/mrp_demo.xml
index 89e433b68da..712e27962ec 100644
--- a/addons/mrp/data/mrp_demo.xml
+++ b/addons/mrp/data/mrp_demo.xml
@@ -79,7 +79,9 @@
</record>
<function model="stock.move" name="create">
- <value model="stock.move" eval="obj().env.ref('mrp.mrp_production_1')._get_moves_raw_values()"/>
+ <value model="stock.move" eval="
+ obj().env.ref('mrp.mrp_production_1')._get_moves_raw_values() +
+ obj().env.ref('mrp.mrp_production_1')._get_moves_finished_values()"/>
</function>
<!-- Table -->
@@ -272,18 +274,19 @@
<field name="operation_id" ref="mrp.mrp_routing_workcenter_5"/>
</record>
+ <!-- Table MO -->
<record id="mrp_production_3" model="mrp.production">
<field name="product_id" ref="product_product_computer_desk"/>
<field name="product_uom_id" ref="uom.product_uom_unit"/>
<field name="product_qty">1</field>
+ <field name="date_planned_start" eval="(DateTime.today() + relativedelta(days=1)).strftime('%Y-%m-%d %H:%M')"/>
<field name="bom_id" ref="mrp_bom_desk"/>
</record>
<function model="stock.move" name="create">
- <value model="stock.move" eval="obj().env.ref('mrp.mrp_production_3')._get_moves_raw_values()"/>
- </function>
- <function model="stock.move" name="create">
- <value model="stock.move" eval="obj().env.ref('mrp.mrp_production_3')._get_moves_finished_values()"/>
+ <value model="stock.move" eval="
+ obj().env.ref('mrp.mrp_production_3')._get_moves_raw_values() +
+ obj().env.ref('mrp.mrp_production_3')._get_moves_finished_values()"/>
</function>
<record id="mrp_bom_table_top" model="mrp.bom">
@@ -374,6 +377,23 @@
<field name="bom_id" ref="mrp_bom_wood_panel"/>
</record>
+ <!-- Table Top MO -->
+ <record id="mrp_production_4" model="mrp.production">
+ <field name="product_id" ref="product_product_computer_desk_head"/>
+ <field name="product_uom_id" ref="uom.product_uom_unit"/>
+ <field name="product_qty">2</field>
+ <field name="location_src_id" ref="stock.stock_location_stock"/>
+ <field name="location_dest_id" ref="stock.stock_location_stock"/>
+ <field name="bom_id" ref="mrp_bom_table_top"/>
+ </record>
+
+ <!-- Generate Table & Table Top MO's moves -->
+ <function model="stock.move" name="create">
+ <value model="stock.move" eval="
+ obj().env.ref('mrp.mrp_production_4')._get_moves_raw_values() +
+ obj().env.ref('mrp.mrp_production_4')._get_moves_finished_values()"/>
+ </function>
+
<!-- Table Kit -->
<record id="product_product_table_kit" model="product.product">
@@ -625,11 +645,9 @@
</record>
<function model="stock.move" name="create">
- <value model="stock.move" eval="obj().env.ref('mrp.mrp_production_laptop_cust')._get_moves_raw_values()"/>
- </function>
-
- <function model="stock.move" name="create">
- <value model="stock.move" eval="obj().env.ref('mrp.mrp_production_laptop_cust')._get_moves_finished_values()"/>
+ <value model="stock.move" eval="
+ obj().env.ref('mrp.mrp_production_laptop_cust')._get_moves_raw_values() +
+ obj().env.ref('mrp.mrp_production_laptop_cust')._get_moves_finished_values()"/>
</function>
<!-- Run Scheduler -->
@@ -683,18 +701,16 @@
<value eval="[ref('mrp.mrp_production_3')]"/>
</function>
- <function model="mrp.production" name="action_confirm">
- <value eval="[ref('mrp.mrp_production_3')]"/>
- </function>
+ <function model="mrp.production" name="action_confirm" eval="[[
+ ref('mrp.mrp_production_3'),
+ ref('mrp.mrp_production_4'),
+ ref('mrp.mrp_production_laptop_cust'),
+ ]]"/>
<function model="mrp.production" name="button_plan">
<value eval="[ref('mrp.mrp_production_3')]"/>
</function>
- <function model="mrp.production" name="action_confirm">
- <value eval="[ref('mrp.mrp_production_laptop_cust')]"/>
- </function>
-
<function model="mrp.production" name="write">
<value eval="[ref('mrp.mrp_production_laptop_cust')]"/>
<value eval="{'qty_producing': 5, 'lot_producing_id': ref('mrp.lot_product_27_0')}"/>