Skip to content
Snippets Groups Projects
Commit 443ce04d authored by Eteil Djoumatchoua (etdj)'s avatar Eteil Djoumatchoua (etdj)
Browse files

[FIX] delivery: add test for delivery w/carrier when no linked sale order flow

This commit adds a test to a fix done in https://github.com/odoo/odoo/commit/afed7db30042e2ea91cdae292dadb7b6f742e33d



bug introduced during: odoo/odoo#109298
opw-3162826

closes odoo/odoo#111440

Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
parent 84d249e7
No related branches found
No related tags found
No related merge requests found
......@@ -76,3 +76,31 @@ class TestPacking(TestPackingCommon):
# default weight was set.
pack_wiz = self.env['choose.delivery.package'].with_context(pack_action_ctx).create({})
self.assertEqual(pack_wiz.shipping_weight, 13.5)
def test_send_to_shipper_without_sale_order(self):
"""
Check we can validate delivery with a delivery carrier set when it isn't linked to a sale order
"""
self.env['stock.quant']._update_available_quantity(self.product_aw, self.stock_location, 20.0)
picking_ship = self.env['stock.picking'].create({
'partner_id': self.env['res.partner'].create({'name': 'A partner'}).id,
'picking_type_id': self.warehouse.out_type_id.id,
'location_id': self.stock_location.id,
'location_dest_id': self.customer_location.id,
'carrier_id': self.test_carrier.id
})
self.env['stock.move.line'].create({
'product_id': self.product_aw.id,
'product_uom_id': self.uom_kg.id,
'picking_id': picking_ship.id,
'qty_done': 5,
'location_id': self.stock_location.id,
'location_dest_id': self.customer_location.id
})
self.assertEqual(picking_ship.state, 'draft', 'Delivery state should be draft.')
self.assertFalse(picking_ship.sale_id.id, 'Sale order shouldn\'t be set')
picking_ship.action_confirm()
picking_ship.button_validate()
self.assertEqual(picking_ship.state, 'done')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment