diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index 909050d0483..75249aea842 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -2,11 +2,11 @@ !context uid: 'res_users_stock_manager' - - I confirm outgoing shipment of 130 unit 15” LCD Monitor. + I confirm outgoing shipment of 130 Unit 15” LCD Monitor. - !workflow {model: stock.picking, action: button_confirm, ref: outgoing_shipment} - - I check shipment details after confirmed. + I check shipment details after confirmation. - !python {model: stock.picking}: | shipment = self.browse(cr, uid, ref("outgoing_shipment")) @@ -15,25 +15,25 @@ assert move_line.state == "confirmed", "Move should be confirmed." - - Now I check vitual stock of 15” LCD Monitor after confirmed outgoing shipment. + Now, I check virtual stock of 15” LCD Monitor after confirming outgoing shipment. - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) - assert product.virtual_available == -30, "Vitual stock is not updated." + assert product.virtual_available == -30, "Virtual stock is not updated." - - I confirm incomming shipment of 50 unit 15” LCD Monitor. + I confirm incoming shipment of 50 Unit 15” LCD Monitor. - - !workflow {model: stock.picking, action: button_confirm, ref: incomming_shipment} + !workflow {model: stock.picking, action: button_confirm, ref: incoming_shipment} - - I split incomming shipment into lots. each lot contain 10 unit 15” LCD Monitor. + I split incoming shipment into lots. each lot contain 10 Unit 15” LCD Monitor. - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) + shipment = self.browse(cr, uid, ref("incoming_shipment")) move_ids = [x.id for x in shipment.move_lines] context.update({'active_model': 'stock.move', 'active_id': move_ids[0], 'active_ids': move_ids}) - - !record {model: stock.move.split, id: split_lot_incomming}: + !record {model: stock.move.split, id: split_lot_incoming}: line_ids: - name: incoming_lot0 quantity: 10 @@ -45,29 +45,29 @@ quantity: 10 - !python {model: stock.move.split }: | - self.split_lot(cr, uid, [ref('split_lot_incomming')], context=context) + self.split_lot(cr, uid, [ref('split_lot_incoming')], context=context) - - I check move lines after spliting + I check move lines after splitting. - !python {model: stock.move}: | - mm = self.browse(cr, uid, ref("incomming_shipment_monitor")) - lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context) + mm = self.browse(cr, uid, ref("incoming_shipment_monitor")) + lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incoming'), context=context) lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])]) - assert len(lot_ids) == 4, 'lots of incomming shipment are not correspond.' + assert len(lot_ids) == 4, 'lots of incoming shipment are not correspond.' move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_monitor')),('prodlot_id','in',lot_ids)]) - assert len(move_ids) == 4, 'move lines are not correspond per prodcution lot after splited.' + assert len(move_ids) == 4, 'move lines are not correspond per production lot after splitting.' for move in self.browse(cr, uid, move_ids, context=context): assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond." assert move.product_qty == 10, "qty does not correspond per production lot." - - I receive 40 unit 15” LCD Monitor so I make backorder of incomming shipment for 40 unit. + I receive 40 units of 15” LCD Monitor. - !python {model: stock.partial.picking}: | - context.update({'active_model': 'stock.picking', 'active_id': ref('incomming_shipment'), 'active_ids': [ref('incomming_shipment')]}) + context.update({'active_model': 'stock.picking', 'active_id': ref('incoming_shipment'), 'active_ids': [ref('incoming_shipment')]}) - !python {model: stock.partial.picking}: | partial = [] - for move in self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment")).move_lines: + for move in self.pool.get('stock.picking').browse(cr, uid, ref("incoming_shipment")).move_lines: if move.prodlot_id: partial.append((0, 0, { 'quantity': move.product_qty, @@ -82,10 +82,10 @@ partial_id = self.create(cr, uid, {'move_ids': partial}, context=context) self.do_partial(cr, uid, [partial_id], context=context) - - I check backorder shipment after received partial shipment. + I check backorder shipment after receiving partial shipment. - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) + shipment = self.browse(cr, uid, ref("incoming_shipment")) backorder = shipment.backorder_id assert backorder, "Backorder should be created after partial shipment." assert backorder.state == 'done', "Backorder should be closed after received." @@ -95,82 +95,82 @@ qty += move_line.product_qty assert qty == 40, "Qty in backorder does not correspond." - - I receive another 10 unit 15” LCD Monitor. + I receive another 10 units of 15” LCD Monitor. - - !record {model: stock.partial.picking, id: partial_incomming}: + !record {model: stock.partial.picking, id: partial_incoming}: move_ids: - quantity: 10 product_id: product_product_6 product_uom: product.product_uom_unit - move_id: incomming_shipment_monitor + move_id: incoming_shipment_monitor location_id: stock_location_3 location_dest_id: location_monitor - !python {model: stock.partial.picking }: | - self.do_partial(cr, uid, [ref('partial_incomming')], context=context) + self.do_partial(cr, uid, [ref('partial_incoming')], context=context) - - I check incomming shipment after receiving it. + I check incoming shipment after receiving it. - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) + shipment = self.browse(cr, uid, ref("incoming_shipment")) assert shipment.state == 'done', "shipment should be closed after receiving." for move_line in shipment.move_lines: assert move_line.product_qty == 10, "Qty does not correspond." assert move_line.product_id.virtual_available == 20, "Virtual stock does not correspond." assert move_line.state == 'done', "Move line should be closed." - - I return last incomming shipment for 10 unit 15” LCD Monitor. + I return last incoming shipment for 10 Unit 15” LCD Monitor. - - !record {model: stock.return.picking, id: return_incomming}: + !record {model: stock.return.picking, id: return_incoming}: invoice_state: none - !python {model: stock.return.picking }: | # this work without giving the id of the picking to return, magically, thanks to the context - self.create_returns(cr, uid, [ref('return_incomming')], context=context) + self.create_returns(cr, uid, [ref('return_incoming')], context=context) - - I cancel incomming shipment after return it. + I cancel incoming shipment after returning it. - !python {model: stock.picking}: | - # the cancel is not on the return, but on the incomming shipment (which now has a quantity of 10, thanks to the + # the cancel is not on the return, but on the incoming shipment (which now has a quantity of 10, thanks to the # backorder). This situation is a little weird as we returned a move that we finally cancelled... As result, only # 30Unit from the original 50Unit will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity)) - self.action_cancel(cr, uid, [ref("incomming_shipment")], context=context) + self.action_cancel(cr, uid, [ref("incoming_shipment")], context=context) - - I make invoice of backorder of incomming shipment. + I make invoice of backorder of incoming shipment. - !python {model: stock.invoice.onshipping}: | - shipment = self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment")) + shipment = self.pool.get('stock.picking').browse(cr, uid, ref("incoming_shipment")) context.update({'active_model': 'stock.picking', 'active_id': shipment.backorder_id.id, 'active_ids': [shipment.backorder_id.id]}) - - !record {model: stock.invoice.onshipping, id: invoice_incomming}: + !record {model: stock.invoice.onshipping, id: invoice_incoming}: group: False - !python {model: stock.invoice.onshipping }: | - self.create_invoice(cr, uid, [ref('invoice_incomming')], context=context) + self.create_invoice(cr, uid, [ref('invoice_incoming')], context=context) - - I check invoice state of backorder of incomming shipment. + I check invoice status of backorder of incoming shipment. - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) - assert shipment.backorder_id.invoice_state == 'invoiced', 'Invoice state is not upadted.' + shipment = self.browse(cr, uid, ref("incoming_shipment")) + assert shipment.backorder_id.invoice_state == 'invoiced', 'Invoice state is not updated.' - - I check available stock after received incomming shipping. + I check available stock after receiving incoming shipping. - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 140, "Stock does not correspond." - assert product.virtual_available == 0, "Vitual stock does not correspond." + assert product.virtual_available == 0, "Virtual stock does not correspond." - I check the stock valuation account entries. - !python {model: account.move}: | - incomming_shipment = self.pool.get('stock.picking').browse(cr, uid, ref('incomming_shipment'), context=context) - account_move_ids = self.search(cr, uid, [('ref','=',incomming_shipment.name)]) + incoming_shipment = self.pool.get('stock.picking').browse(cr, uid, ref('incoming_shipment'), context=context) + account_move_ids = self.search(cr, uid, [('ref','=',incoming_shipment.name)]) assert len(account_move_ids), "account move should be created." account_move = self.browse(cr, uid, account_move_ids[0], context=context) - assert len(account_move.line_id) == len(incomming_shipment.move_lines) + 1, 'accuont entries are not correspond.' + assert len(account_move.line_id) == len(incoming_shipment.move_lines) + 1, 'Accounting entries does not correspond.' for account_move_line in account_move.line_id: - for stock_move in incomming_shipment.move_lines: + for stock_move in incoming_shipment.move_lines: if account_move_line.account_id.id == stock_move.product_id.property_stock_account_input.id: assert account_move_line.credit == 14000.0, "Credit amount does not correspond." assert account_move_line.debit == 0.0, "Debit amount does not correspond." @@ -181,11 +181,11 @@ I trace all incoming lots. - !python {model: stock.production.lot }: | - lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context) + lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incoming'), context=context) lot_ids = self.search(cr, uid, [('name', 'in', [x.name for x in lot.line_ids])]) self.action_traceability(cr, uid, lot_ids, context=context) - - I check outgoing shipment after stock availablity in Chicago shop. + I check outgoing shipment after stock availability in Chicago shop. - !python {model: stock.picking}: | shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context) @@ -213,7 +213,7 @@ !python {model: stock.move.consume}: | self.do_move_consume(cr, uid, [ref('consume_monitor1')], context=context) - - I check stock in scrap location and stock location shop0. + I check stock in scrap location and stock location. - !python {model: stock.location}: | ctx = {'product_id': ref('product_product_6')} @@ -222,14 +222,14 @@ scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx) assert scrapped_location.stock_real == 4, 'scraped stock does not correspond in scrap location.' - - I check availabile stock after consumed and scraped. + I check available stock after consumed and scraped move. - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 132.0, "Stock does not correspond." - assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." + assert round(product.virtual_available, 2) == -4.00, "Virtual stock does not correspond." - - I deliver 5 unit 15” LCD Monitor to customer so I make partial deliver + I deliver 5 Unit 15” LCD Monitor to customer partially. - !python {model: stock.partial.move}: | context.update({'active_model': 'stock.move', 'active_id': ref('outgoing_shipment_monitor'), 'active_ids': [ref('outgoing_shipment_monitor')]}) @@ -247,7 +247,7 @@ self.do_partial(cr, uid, [ref('partial_outgoing_monitor')], context=context) - - I packing outgoing shipment into box per 10 unit with unique tracking lot. + I pack outgoing shipment into box of 10 Unit with unique tracking lot. - !python {model: stock.move}: | stock_split = self.pool.get('stock.split.into') @@ -260,7 +260,7 @@ stock_split.split(cr, uid, [split_id], context=context) total_qty -= split_qty - - I deliver outgoing shipment. + I deliver the outgoing shipment. - !python {model: stock.partial.picking}: | context.update({'active_model': 'stock.picking', 'active_id': ref('outgoing_shipment'), 'active_ids': [ref('outgoing_shipment')]}) @@ -272,7 +272,7 @@ self.do_partial(cr, uid, [ref('partial_outgoing')], context=context) - - I check outgoing shipment after deliver. + I check outgoing shipment after delivery. - !python {model: stock.picking}: | shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context) @@ -280,9 +280,9 @@ for move_line in shipment.move_lines: assert move_line.state == "done", "Move should be closed." - - I check availaible stock after deliver. + I check available stock after delivery. - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert round(product.qty_available, 2) == 6, "Stock does not correspond." - assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." + assert round(product.virtual_available, 2) == -4.00, "Virtual stock does not correspond."