Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 18.119.13.56
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /opt/odoo/addons/stock_dropshipping/test/procurementexception.yml
-
  I create a product with no supplier define for it.
-
  !record {model: product.product, id: product_with_no_seller}:
    name: 'product with no seller'
    list_price: 20.00
    standard_price: 15.00
    categ_id: product.product_category_1
-
  I create a sales order with this product with route dropship.
-
  !record {model: sale.order, id: sale_order_route_dropship01}:
    partner_id: base.res_partner_2
    partner_invoice_id: base.res_partner_address_3
    partner_shipping_id: base.res_partner_address_3
    note: crossdock route
    payment_term_id: account.account_payment_term
    order_line:
      - product_id: product_with_no_seller
        product_uom_qty: 1
        route_id: route_drop_shipping
-
  I confirm the sales order.
-
  !python {model: sale.order, id: sale_order_route_dropship01}: |
    self.action_confirm()
-
  I check there is a procurement in exception that has the procurement group of the sales order created before.
-
  !python {model: procurement.order, id: False}: |
    self.run_scheduler()
    sale_order = self.env['sale.order'].browse(ref("sale_order_route_dropship01"))
    procs = self.search([('group_id.name', '=', sale_order.name), ('state', '=', 'exception')])
    assert procs, 'No Procurement!'
-
  I set the at least one supplier on the product.
-
  !record {model: product.product, id: product_with_no_seller, view: False}:
    seller_ids:
      - delay: 1
        name: base.res_partner_2
        min_qty: 2.0
-
  I run the Procurement.
-
  !python {model: procurement.order, id: False}: |
    sale_order = self.env['sale.order'].browse(ref("sale_order_route_dropship01"))
    procs = self.search([('group_id.name', '=', sale_order.name), ('state', '=', 'exception')])
    procs.run()
-
  I check the status changed there is no procurement order in exception any more from that procurement group
-
  !python {model: procurement.order, id: False}: |
    sale_order = self.env['sale.order'].browse(ref("sale_order_route_dropship01"))
    procs = self.search([('group_id.name', '=', sale_order.name), ('state', '=', 'exception')])
    assert not procs, 'Procurement should be in running state'
-
  I check a purchase quotation was created.
-
  !python {model: procurement.order, id: False}: |
    sale_order = self.env['sale.order'].browse(ref("sale_order_route_dropship01"))
    procs = self.search([('group_id.name', '=', sale_order.name)])
    purchase_id = [proc.purchase_line_id.order_id for proc in procs if proc.purchase_line_id]
    assert purchase_id, 'No Purchase Quotation is created'

Anon7 - 2022
AnonSec Team