Server IP : 127.0.0.2 / Your IP : 3.141.164.124 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /opt/odoo/addons/stock/tests/ |
Upload File : |
# -*- coding: utf-8 -*- from odoo.addons.stock.tests.common2 import TestStockCommon class TestInventory(TestStockCommon): def test_shipment(self): # TDE NOTE: this test replaces test/shipment.yml present until saas-10 # TDE TODO # pickign.action_confirm -> confirm moves # picking.do_prepare_partial, should create pack ops, write on it ? # create and confirm an incoming move of product 3 incoming_move = self._create_move_in(self.product_3, self.warehouse_1, create_picking=True, product_uom_qty=50) incoming_move.action_confirm() # receive only 40 units of products; this will create a backorder of incoming shipment for the remaining 10 pack_operation = self._create_pack_operation( self.product_3, 40.0, incoming_move.picking_id, location_id=self.env.ref('stock.stock_location_suppliers').id, # TDE FIXME: locations location_dest_id=self.location_1.id) incoming_move.picking_id.with_context(active_model='stock.picking', active_id=incoming_move.picking_id.id, active_ids=[incoming_move.picking_id.id]).do_transfer() # check backorder shipment after receiving partial shipment and check remaining shipment for move_line in incoming_move.picking_id.move_lines: self.assertEqual(move_line.product_qty, 40) self.assertEqual(move_line.state, 'done') backorder = self.env['stock.picking'].search([('backorder_id', '=', incoming_move.picking_id.id)]) for move_line in backorder.move_lines: self.assertEqual(move_line.product_qty, 10) self.assertIn(move_line.state, ['assigned', 'waiting', 'confirmed']) backorder.with_context(active_model='stock.picking', active_id=backorder.id, active_ids=[backorder.id]) # receive the remaining 10 units from the backorder pack_operation = self._create_pack_operation( self.product_3, 10.0, backorder, location_id=self.env.ref('stock.stock_location_suppliers').id, # TDE FIXME: locations location_dest_id=self.location_1.id) backorder.do_transfer() # check the incoming shipment after receipt backorder = self.env['stock.picking'].search([('backorder_id', '=', incoming_move.picking_id.id)]) self.assertEqual(backorder.state, 'done') for move_line in backorder.move_lines: self.assertEqual(move_line.state, 'done')