odoo/ext/custom-addons/dp_website/models/stock_picking.py

18 lines
712 B
Python
Executable File

# Copyright 2018-Today datenpol gmbh (<http://www.datenpol.at>)
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
from odoo import api, models
class StockPicking(models.Model):
_inherit = 'stock.picking'
@api.multi
def action_done(self):
res = super(StockPicking, self).action_done()
delivery_template = self.env.ref('delivery.mail_template_data_delivery_confirmation')
delivery_template.email_from = '${(object.company_id.email and \'%s <%s>\' % (object.company_id.name, object.company_id.email) or \'\')|safe}'
for record in self:
delivery_template.send_mail(record.id)
return res