Server IP : 127.0.0.2 / Your IP : 3.145.216.39 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/point_of_sale/tests/ |
Upload File : |
# -*- coding: utf-8 -*- from odoo.tests import common class TestPointOfSaleCommon(common.TransactionCase): def setUp(self): super(TestPointOfSaleCommon, self).setUp() self.AccountBankStatement = self.env['account.bank.statement'] self.AccountBankStatementLine = self.env['account.bank.statement.line'] self.PosMakePayment = self.env['pos.make.payment'] self.PosOrder = self.env['pos.order'] self.PosSession = self.env['pos.session'] self.company_id = self.ref('base.main_company') self.product3 = self.env.ref('product.product_product_3') self.product4 = self.env.ref('product.product_product_4') self.partner1 = self.env.ref('base.res_partner_1') self.partner4 = self.env.ref('base.res_partner_4') self.pos_config = self.env.ref('point_of_sale.pos_config_main') self.carotte = self.env.ref('point_of_sale.carotte') self.courgette = self.env.ref('point_of_sale.courgette') self.onions = self.env.ref('point_of_sale.Onions') # create a new session self.pos_order_session0 = self.env['pos.session'].create({ 'user_id': 1, 'config_id': self.pos_config.id }) # create a VAT tax of 10%, included in the public price Tax = self.env['account.tax'] account_tax_10_incl = Tax.create({ 'name': 'VAT 10 perc Incl', 'amount_type': 'percent', 'amount': 10.0, 'price_include': 1 }) # assign this 10 percent tax on the [PCSC234] PC Assemble SC234 product # as a sale tax self.product3.taxes_id = [(6, 0, [account_tax_10_incl.id])] # create a VAT tax of 5%, which is added to the public price account_tax_05_incl = Tax.create({ 'name': 'VAT 5 perc Incl', 'amount_type': 'percent', 'amount': 5.0, 'price_include': 0 }) # create a second VAT tax of 5% but this time for a child company, to # ensure that only product taxes of the current session's company are considered #(this tax should be ignore when computing order's taxes in following tests) account_tax_05_incl_chicago = Tax.create({ 'name': 'VAT 05 perc Excl (US)', 'amount_type': 'percent', 'amount': 5.0, 'price_include': 0, 'company_id': self.ref('stock.res_company_1') }) self.product4.company_id = False # I assign those 5 percent taxes on the PCSC349 product as a sale taxes self.product4.write( {'taxes_id': [(6, 0, [account_tax_05_incl.id, account_tax_05_incl_chicago.id])]})