summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsvs-odoo <svs@odoo.com>2020-07-31 06:51:39 +0000
committersvs-odoo <svs@odoo.com>2020-08-27 08:19:51 +0000
commit6732619941b9639897c00a3776429f50b38d1f9d (patch)
treecda005764ff506f1b0ad588d18cece098dbfc34b
parente6c2dc3eb19a4e75d78b89529948533007dd8f69 (diff)
[FIX] stock: delivery WH/OUT/00005
The demo data creates a delivery with qty done but who can't be mark as done because this picking has a move which has a move line (with qty. done), but this move line isn't linked to the picking. To fix that, this commit removes the manually created move line, calls `action_assign` on the picking (this will create the move line and correctly link them) then sets the `qty_done` on the move line. Also, applies the same fix to done pickings who have the same issue (but as they are done, it is less visible).
-rw-r--r--addons/stock/data/stock_demo2.xml78
1 files changed, 36 insertions, 42 deletions
diff --git a/addons/stock/data/stock_demo2.xml b/addons/stock/data/stock_demo2.xml
index 39043719ac5..8b6cd5a7c2b 100644
--- a/addons/stock/data/stock_demo2.xml
+++ b/addons/stock/data/stock_demo2.xml
@@ -116,13 +116,6 @@
'picking_type_id': ref('stock.picking_type_out'),
'location_id': ref('stock.stock_location_stock'),
'location_dest_id': ref('stock.stock_location_customers'),
- 'move_line_ids': [(0, 0, {
- 'product_id': ref('product.product_product_6'),
- 'qty_done': 100,
- 'product_uom_id': ref('uom.product_uom_unit'),
- 'location_id': ref('stock.stock_location_stock'),
- 'location_dest_id': ref('stock.stock_location_customers'),
- })],
})]"/>
</record>
@@ -180,13 +173,6 @@
'picking_type_id': ref('stock.picking_type_out'),
'location_id': ref('stock.stock_location_stock'),
'location_dest_id': ref('stock.stock_location_customers'),
- 'move_line_ids': [(0, 0, {
- 'product_id': ref('product.product_product_3'),
- 'qty_done': 16,
- 'product_uom_id': ref('uom.product_uom_unit'),
- 'location_id': ref('stock.stock_location_stock'),
- 'location_dest_id': ref('stock.stock_location_customers'),
- })],
})]"/>
</record>
@@ -206,13 +192,6 @@
'picking_type_id': ref('stock.picking_type_out'),
'location_id': ref('stock.stock_location_stock'),
'location_dest_id': ref('stock.stock_location_customers'),
- 'move_line_ids': [(0, 0, {
- 'product_id': ref('product.product_product_3'),
- 'qty_done': 32,
- 'product_uom_id': ref('uom.product_uom_unit'),
- 'location_id': ref('stock.stock_location_stock'),
- 'location_dest_id': ref('stock.stock_location_customers'),
- })],
})]"/>
</record>
@@ -232,13 +211,6 @@
'picking_type_id': ref('stock.picking_type_out'),
'location_id': ref('stock.stock_location_stock'),
'location_dest_id': ref('stock.stock_location_customers'),
- 'move_line_ids': [(0, 0, {
- 'product_id': ref('product.product_product_6'),
- 'qty_done': 50,
- 'product_uom_id': ref('uom.product_uom_unit'),
- 'location_id': ref('stock.stock_location_stock'),
- 'location_dest_id': ref('stock.stock_location_customers'),
- })],
})]"/>
</record>
@@ -364,13 +336,6 @@
'picking_type_id': ref('stock.chi_picking_type_in'),
'location_id': ref('stock.stock_location_suppliers'),
'location_dest_id': ref('stock.stock_location_shop0'),
- 'move_line_ids': [(0, 0, {
- 'product_id': ref('product.product_delivery_01'),
- 'qty_done': 100,
- 'product_uom_id': ref('uom.product_uom_unit'),
- 'location_id': ref('stock.stock_location_suppliers'),
- 'location_dest_id': ref('stock.stock_location_shop0'),
- })],
'company_id': ref('stock.res_company_1'),
})]"/>
</record>
@@ -450,13 +415,6 @@
'picking_type_id': ref('stock.chi_picking_type_out'),
'location_id': ref('stock.stock_location_shop0'),
'location_dest_id': ref('stock.stock_location_customers'),
- 'move_line_ids': [(0, 0, {
- 'product_id': ref('product.product_product_6'),
- 'qty_done': 100,
- 'product_uom_id': ref('uom.product_uom_unit'),
- 'location_id': ref('stock.stock_location_shop0'),
- 'location_dest_id': ref('stock.stock_location_customers'),
- })],
'company_id': ref('stock.res_company_1'),
})]"/>
</record>
@@ -519,6 +477,42 @@
obj().env.ref('stock.incomming_chicago_warehouse3').id]"/>
</function>
+ <function model="stock.picking" name="action_assign">
+ <value model="stock.picking" eval="[
+ obj().env.ref('stock.outgoing_shipment_main_warehouse1').id,
+ obj().env.ref('stock.outgoing_shipment_main_warehouse4').id,
+ obj().env.ref('stock.outgoing_shipment_main_warehouse5').id,
+ obj().env.ref('stock.outgoing_shipment_main_warehouse6').id,
+ obj().env.ref('stock.outgoing_chicago_warehouse1').id,
+ ]"/>
+ </function>
+
+ <!-- Adds move lines qty. done -->
+ <function model="stock.move.line" name="write">
+ <value model="stock.move.line" search="[('picking_id', '=', ref('stock.outgoing_shipment_main_warehouse1'))]"/>
+ <value eval="{'qty_done': 100}"/>
+ </function>
+ <function model="stock.move.line" name="write">
+ <value model="stock.move.line" search="[('picking_id', '=', ref('stock.outgoing_shipment_main_warehouse4'))]"/>
+ <value eval="{'qty_done': 16}"/>
+ </function>
+ <function model="stock.move.line" name="write">
+ <value model="stock.move.line" search="[('picking_id', '=', ref('stock.outgoing_shipment_main_warehouse5'))]"/>
+ <value eval="{'qty_done': 32}"/>
+ </function>
+ <function model="stock.move.line" name="write">
+ <value model="stock.move.line" search="[('picking_id', '=', ref('stock.outgoing_shipment_main_warehouse6'))]"/>
+ <value eval="{'qty_done': 50}"/>
+ </function>
+ <function model="stock.move.line" name="write">
+ <value model="stock.move.line" search="[('picking_id', '=', ref('stock.incomming_chicago_warehouse1'))]"/>
+ <value eval="{'qty_done': 100}"/>
+ </function>
+ <function model="stock.move.line" name="write">
+ <value model="stock.move.line" search="[('picking_id', '=', ref('stock.outgoing_chicago_warehouse1'))]"/>
+ <value eval="{'qty_done': 100}"/>
+ </function>
+
<function model="stock.picking" name="_action_done">
<value model="stock.picking" eval="[
obj().env.ref('stock.outgoing_shipment_main_warehouse1').id,