diff --git a/ext/custom-addons/dp_custom/__manifest__.py b/ext/custom-addons/dp_custom/__manifest__.py index 1c2cb0d5..3298cbec 100644 --- a/ext/custom-addons/dp_custom/__manifest__.py +++ b/ext/custom-addons/dp_custom/__manifest__.py @@ -34,6 +34,8 @@ ], 'data': [ 'data/dp_custom_data.xml', + 'data/glaser_company_data.xml', + 'data/tz_austria_company_data.xml', 'views/dp_custom_views.xml', 'security/ir.model.access.csv', ], diff --git a/ext/custom-addons/dp_custom/data/glaser_company_data.xml b/ext/custom-addons/dp_custom/data/glaser_company_data.xml new file mode 100644 index 00000000..c9bc4fd6 --- /dev/null +++ b/ext/custom-addons/dp_custom/data/glaser_company_data.xml @@ -0,0 +1,45 @@ + + + + Glaser & Co. + Neugasse 36 + Spannberg + 2244 + +43 (0)2538/8628-0 + +43 (0)2538/8628-400 + office@glaser-co.at + https://www.glaser-co.at + FN 61793 y + + ATU17860303 + + + + + + + Glaser & Co. ADMIN + glaser-admin + admin@glaser.at + + + + + + + + + + + + + + diff --git a/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml b/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml new file mode 100644 index 00000000..b828b9c5 --- /dev/null +++ b/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml @@ -0,0 +1,17 @@ + + + + TZ Tischlerzentrum ADMIN + tz-admin + + + admin@tz-austria.at + + + + diff --git a/ext/custom-addons/dp_custom/models/__init__.py b/ext/custom-addons/dp_custom/models/__init__.py index 0a5fa5c7..a65b0f2d 100644 --- a/ext/custom-addons/dp_custom/models/__init__.py +++ b/ext/custom-addons/dp_custom/models/__init__.py @@ -21,3 +21,4 @@ from . import ir_ui_menu from . import res_partner +from . import res_company diff --git a/ext/custom-addons/dp_custom/models/ir_ui_menu.py b/ext/custom-addons/dp_custom/models/ir_ui_menu.py index 9167e61b..5b820b1c 100644 --- a/ext/custom-addons/dp_custom/models/ir_ui_menu.py +++ b/ext/custom-addons/dp_custom/models/ir_ui_menu.py @@ -19,9 +19,7 @@ # ############################################################################## -from odoo import models -from odoo import api -from odoo import tools +from odoo import models, api, tools DISABLED_MENUS = [ ] diff --git a/ext/custom-addons/dp_custom/models/res_company.py b/ext/custom-addons/dp_custom/models/res_company.py new file mode 100644 index 00000000..6be7cf00 --- /dev/null +++ b/ext/custom-addons/dp_custom/models/res_company.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# datenpol gmbh +# Copyright (C) 2013-TODAY datenpol gmbh () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +import os +import base64 + +from odoo import fields, models, api + + +class Company(models.Model): + _inherit = 'res.company' + + @api.model + def set_company_logo(self, company, logo): + filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), logo) + fi = open(filename, 'rb') + content = base64.b64encode(fi.read()) + content = content.decode() + fi.close() + self.browse(company).write({'logo': content}) + + @api.model + def set_company_favicon(self, company, logo): + filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), logo) + fi = open(filename, 'rb') + content = base64.b64encode(fi.read()) + content = content.decode() + fi.close() + self.browse(company).write( + {'favicon_backend': content, 'favicon_backend_mimetype': 'image/x-icon'}) diff --git a/ext/custom-addons/dp_custom/static/src/img/glaser_favicon.png b/ext/custom-addons/dp_custom/static/src/img/glaser_favicon.png new file mode 100644 index 00000000..75584135 Binary files /dev/null and b/ext/custom-addons/dp_custom/static/src/img/glaser_favicon.png differ diff --git a/ext/custom-addons/dp_custom/static/src/img/logo_glaser.png b/ext/custom-addons/dp_custom/static/src/img/logo_glaser.png new file mode 100644 index 00000000..3534e24d Binary files /dev/null and b/ext/custom-addons/dp_custom/static/src/img/logo_glaser.png differ diff --git a/setup/lib/cli.py b/setup/lib/cli.py index e21c98cd..a5533353 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -119,6 +119,7 @@ def main(): #'default_set_order_policy', 'update_values', #'update_special_values', + 'set_password_for_admin_users', 'set_sys_params', #'setup_reports', 'consume_tours', diff --git a/setup/lib/config_at.py b/setup/lib/config_at.py index 74d94b1b..6ac28740 100644 --- a/setup/lib/config_at.py +++ b/setup/lib/config_at.py @@ -198,7 +198,6 @@ class Config(): # 'dp_reports_stock', 'account_cancel', 'stock', - 'partner_firstname', 'dp_changelogs' ] diff --git a/setup/lib/functions.py b/setup/lib/functions.py index fe877c10..285af674 100644 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -90,8 +90,7 @@ class DatenpolFunctions: vals['favicon_backend'] = self._readAndReturnFile(vals['favicon_backend'], encode='base64') vals['country_id'] = country_id - c_ids = self.odoo.env['res.company'].search([]) - return self.odoo.env['res.company'].write(c_ids, vals) + return self.odoo.env.ref('base.main_company').write(vals) def set_taxes(self): """Setze nicht benötigte Steuern auf inaktiv""" @@ -562,6 +561,18 @@ class DatenpolFunctions: """Spezialwerte setzen""" return True + def set_password_for_admin_users(self): + """Passwort für admin Users setzen""" + user_ids = self.odoo.env['res.users'].search([('login', 'ilike', 'admin'), ('id', '!=', 1)]) + wizard_id = self.odoo.env['change.password.wizard'].create({}) + change_ids = [] + for user_id in user_ids: + change_id = self.odoo.env['change.password.user'].create( + {'wizard_id': wizard_id, 'user_id': user_id, 'new_passwd': self.env.pwd}) + change_ids.append(change_id) + self.odoo.env['change.password.user'].browse(change_ids).change_password_button() + return True + def update_values(self): """Existierende Daten aktualisieren"""