summaryrefslogtreecommitdiff
path: root/addons/stock_sms/models/res_company.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/stock_sms/models/res_company.py
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/stock_sms/models/res_company.py')
-rw-r--r--addons/stock_sms/models/res_company.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/addons/stock_sms/models/res_company.py b/addons/stock_sms/models/res_company.py
new file mode 100644
index 00000000..d7639c8e
--- /dev/null
+++ b/addons/stock_sms/models/res_company.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+
+class Company(models.Model):
+ _inherit = "res.company"
+
+ def _default_confirmation_sms_picking_template(self):
+ try:
+ return self.env.ref('stock_sms.sms_template_data_stock_delivery').id
+ except ValueError:
+ return False
+
+ stock_move_sms_validation = fields.Boolean("SMS Confirmation", default=True)
+ stock_sms_confirmation_template_id = fields.Many2one(
+ 'sms.template', string="SMS Template",
+ domain="[('model', '=', 'stock.picking')]",
+ default=_default_confirmation_sms_picking_template,
+ help="SMS sent to the customer once the order is done.")
+ has_received_warning_stock_sms = fields.Boolean()