Server IP : 127.0.0.2 / Your IP : 3.129.209.87 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_dropshipping/test/ |
Upload File : |
- Create a vendor - !record {model: res.partner, id: supplier_dropship}: name: Vendor of Dropshipping test - Create new product without any routes - !record {model: product.product, id: drop_shop_product, view: False}: name: Pen drive type: product categ_id: product.product_category_1 list_price: 100.0 standard_price: 0.0 type: product seller_ids: - delay: 1 name: supplier_dropship min_qty: 2.0 uom_id: product.product_uom_unit uom_po_id: product.product_uom_unit - Create a sales order with a line of 200 PCE incoming shipment, with route_id drop shipping. - !record {model: sale.order, id: sale_order_drp_shpng}: partner_id: base.res_partner_2 note: Create sale order for drop shipping payment_term_id: account.account_payment_term order_line: - product_id: drop_shop_product product_uom_qty: 200 price_unit: 1.00 route_id: route_drop_shipping - Confirm sales order - !python {model: sale.order, id: sale_order_drp_shpng}: | self.action_confirm() - Check the sales order created a procurement group which has a procurement of 200 pieces - !python {model: procurement.group, id: False}: | sale_record = self.env["sale.order"].browse(ref('sale_order_drp_shpng')) assert sale_record.procurement_group_id.procurement_ids[0].product_qty == 200 - Check a quotation was created to a certain vendor and confirm so it becomes a confirmed purchase order - !python {model: purchase.order, id: False}: | from odoo import netsvc sale_record = self.env["sale.order"].browse(ref('sale_order_drp_shpng')) procurement_order = sale_record.procurement_group_id.procurement_ids[0] purchase = procurement_order.purchase_line_id.order_id purchase.button_confirm() po_id = self.env['purchase.order'].search([('partner_id', '=', ref('supplier_dropship'))]) assert purchase.state == 'purchase', 'Purchase order should be in the approved state' - Use 'Receive Products' button to immediately view this picking, it should have created a picking with 200 pieces - !python {model: purchase.order, id: False}: | po_id = self.search([('partner_id', '=', ref('supplier_dropship'))]).ids assert len(po_id) == 1, 'There should be one picking' - Send the 200 pieces. - !python {model: stock.picking, id: False}: | po = self.env['purchase.order'].search([('partner_id', '=', ref('supplier_dropship'))]) assert po.ids and len(po.ids) == 1, 'Problem with the Purchase Order detected' pickings = po[0].picking_ids pickings.do_transfer() - Check one quant was created in Customers location with 200 pieces and one move in the history_ids - !python {model: stock.quant, id: False}: | quants = self.search([('location_id', '=', ref('stock.stock_location_customers')), ('product_id', '=', ref("drop_shop_product"))]) assert quants, 'No Quant found' assert len(quants.ids) == 1, 'There should be exactly one quant' assert len(quants[0].history_ids) == 1, 'The quant should have exactly 1 move in its history'