From e971f66cef116810b45148a0d441a22c52977610 Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Mon, 2 Jul 2018 15:18:38 +0200 Subject: [PATCH] =?UTF-8?q?Fall=20231:=20Bestellbest=C3=A4tigung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ext/custom-addons/dp_website/__init__.py | 1 + ext/custom-addons/dp_website/__manifest__.py | 3 ++- .../dp_website/models/__init__.py | 2 ++ .../dp_website/models/sale_order.py | 18 ++++++++++++++++++ .../dp_website/models/stock_picking.py | 17 +++++++++++++++++ setup/lib/functions.py | 2 +- 6 files changed, 41 insertions(+), 2 deletions(-) mode change 100755 => 100644 ext/custom-addons/dp_website/__init__.py create mode 100644 ext/custom-addons/dp_website/models/__init__.py create mode 100755 ext/custom-addons/dp_website/models/sale_order.py create mode 100755 ext/custom-addons/dp_website/models/stock_picking.py diff --git a/ext/custom-addons/dp_website/__init__.py b/ext/custom-addons/dp_website/__init__.py old mode 100755 new mode 100644 index e69de29b..0650744f --- a/ext/custom-addons/dp_website/__init__.py +++ b/ext/custom-addons/dp_website/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/ext/custom-addons/dp_website/__manifest__.py b/ext/custom-addons/dp_website/__manifest__.py index 719cdcfb..29eb9a67 100644 --- a/ext/custom-addons/dp_website/__manifest__.py +++ b/ext/custom-addons/dp_website/__manifest__.py @@ -5,7 +5,7 @@ # noinspection PyStatementEffect { 'name': 'Dp Website', - 'summary' : 'datenpol Website Anpassungen', + 'summary': 'datenpol Website Anpassungen', 'version': '11.0.1.0.0', 'license': 'OPL-1', 'author': 'datenpol gmbh', @@ -14,6 +14,7 @@ 'depends': [ 'website', 'website_multi_theme', + 'website_multi_company_sale', ], 'data': [ 'security/rule.xml' diff --git a/ext/custom-addons/dp_website/models/__init__.py b/ext/custom-addons/dp_website/models/__init__.py new file mode 100644 index 00000000..c0b4257c --- /dev/null +++ b/ext/custom-addons/dp_website/models/__init__.py @@ -0,0 +1,2 @@ +from . import sale_order +from . import stock_picking diff --git a/ext/custom-addons/dp_website/models/sale_order.py b/ext/custom-addons/dp_website/models/sale_order.py new file mode 100755 index 00000000..3a86a05e --- /dev/null +++ b/ext/custom-addons/dp_website/models/sale_order.py @@ -0,0 +1,18 @@ +# Copyright 2018-Today datenpol gmbh () +# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). + +from odoo import models + + +class SaleOrder(models.Model): + _inherit = 'sale.order' + + def action_mark_as_paid(self): + self.ensure_one() + result = super(SaleOrder, self).action_mark_as_paid() + + sale_template = self.env.ref('sale.email_template_edi_sale') + sale_template.email_from = '${(object.company_id.email and \'%s <%s>\' % (object.company_id.name, object.company_id.email) or \'\')|safe}' + sale_template.send_mail(self.id) + + return result diff --git a/ext/custom-addons/dp_website/models/stock_picking.py b/ext/custom-addons/dp_website/models/stock_picking.py new file mode 100755 index 00000000..ba82d0dd --- /dev/null +++ b/ext/custom-addons/dp_website/models/stock_picking.py @@ -0,0 +1,17 @@ +# Copyright 2018-Today datenpol gmbh () +# 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 diff --git a/setup/lib/functions.py b/setup/lib/functions.py index f6a5a1ba..f81a3cca 100644 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -282,7 +282,7 @@ class DatenpolFunctions(object): # # clarico_theme = self.odoo.env.ref('website_multi_theme.clarico_multi') - self.odoo.env.ref('website.default_website').multi_theme_reload() + # self.odoo.env.ref('website.default_website').multi_theme_reload() # create Salesteam for all websites cr_team_ir_heizpaneel = crm_team_obj.search([('name', '=', 'IR Heizpaneele')])