__init__.py 722 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from . import models
  4. from . import wizard
  5. from odoo import api, SUPERUSER_ID
  6. def _assign_default_sms_template_picking_id(cr, registry):
  7. env = api.Environment(cr, SUPERUSER_ID, {})
  8. company_ids_without_default_sms_template_id = env['res.company'].search([
  9. ('stock_sms_confirmation_template_id', '=', False)
  10. ])
  11. default_sms_template_id = env.ref('stock_sms.sms_template_data_stock_delivery', raise_if_not_found=False)
  12. if default_sms_template_id:
  13. company_ids_without_default_sms_template_id.write({
  14. 'stock_sms_confirmation_template_id': default_sms_template_id.id,
  15. })