summaryrefslogtreecommitdiff
path: root/addons/sale_stock/models/res_config_settings.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/sale_stock/models/res_config_settings.py
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/sale_stock/models/res_config_settings.py')
-rw-r--r--addons/sale_stock/models/res_config_settings.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/addons/sale_stock/models/res_config_settings.py b/addons/sale_stock/models/res_config_settings.py
new file mode 100644
index 00000000..e0057775
--- /dev/null
+++ b/addons/sale_stock/models/res_config_settings.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import api, fields, models
+
+
+class ResConfigSettings(models.TransientModel):
+ _inherit = 'res.config.settings'
+
+ security_lead = fields.Float(related='company_id.security_lead', string="Security Lead Time", readonly=False)
+ group_display_incoterm = fields.Boolean("Incoterms", implied_group='sale_stock.group_display_incoterm')
+ group_lot_on_invoice = fields.Boolean("Display Lots & Serial Numbers on Invoices",
+ implied_group='sale_stock.group_lot_on_invoice')
+ use_security_lead = fields.Boolean(
+ string="Security Lead Time for Sales",
+ config_parameter='sale_stock.use_security_lead',
+ help="Margin of error for dates promised to customers. Products will be scheduled for delivery that many days earlier than the actual promised date, to cope with unexpected delays in the supply chain.")
+ default_picking_policy = fields.Selection([
+ ('direct', 'Ship products as soon as available, with back orders'),
+ ('one', 'Ship all products at once')
+ ], "Picking Policy", default='direct', default_model="sale.order", required=True)
+
+ @api.onchange('use_security_lead')
+ def _onchange_use_security_lead(self):
+ if not self.use_security_lead:
+ self.security_lead = 0.0