diff --git a/dev/odoo-server-dev-aa.conf b/dev/odoo-server-dev-aa.conf index d609e036..e3235590 100644 --- a/dev/odoo-server-dev-aa.conf +++ b/dev/odoo-server-dev-aa.conf @@ -8,7 +8,7 @@ db_port = 5432 db_user = False db_password = False -addons_path = ext/odoo/addons,ext/3rd-party-addons,ext/custom-addons +addons_path = ext/odoo/addons,ext/3rd-party-addons,ext/clarico-addons,ext/custom-addons ; For enterprise use the addons path bellow ; addons_path = ext/enterprise-addons,ext/odoo/addons,ext/3rd-party-addons,ext/custom-addons,dmi/run1 timezone = Europe/Vienna diff --git a/ext/custom-addons/dp_website/LICENSE b/ext/custom-addons/dp_website/LICENSE new file mode 100755 index 00000000..272c64b8 --- /dev/null +++ b/ext/custom-addons/dp_website/LICENSE @@ -0,0 +1,27 @@ +Odoo Proprietary License v1.0 + +This software and associated files (the "Software") may only be used (executed, +modified, executed after modifications) if you have purchased a valid license +from the authors, typically via Odoo Apps, or if you have received a written +agreement from the authors of the Software (see the COPYRIGHT file). + +You may develop Odoo modules that use the Software as a library (typically by +depending on it, importing it and using its resources), but without copying any +source code or material from the Software. You may distribute those modules +under the license of your choice, provided that this license is compatible with +the terms of the Odoo Proprietary License (For example: LGPL, MIT, +or proprietary licenses similar to this one). + +It is forbidden to publish, distribute, sublicense, or sell copies of the Software +or modified copies of the Software. + +The above copyright notice and this permission notice must be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/ext/custom-addons/dp_website/__init__.py b/ext/custom-addons/dp_website/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/ext/custom-addons/dp_website/__manifest__.py b/ext/custom-addons/dp_website/__manifest__.py new file mode 100644 index 00000000..13be20d3 --- /dev/null +++ b/ext/custom-addons/dp_website/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2018-Today datenpol gmbh() +# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). + + +# noinspection PyStatementEffect +{ + 'name': 'Dp Website', + 'summary' : 'datenpol Website Anpassungen', + 'version': '11.0.1.0.0', + 'license': 'OPL-1', + 'author': 'datenpol gmbh', + 'support': 'office@datenpol.at', + 'website': 'https://www.datenpol.at', + 'depends': [ + 'website', + 'website_multi_theme', + ], + 'data': [ + 'data/website_data.xml', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/ext/custom-addons/dp_website/data/website_data.xml b/ext/custom-addons/dp_website/data/website_data.xml new file mode 100644 index 00000000..8bc41cfb --- /dev/null +++ b/ext/custom-addons/dp_website/data/website_data.xml @@ -0,0 +1,29 @@ + + + + + Multiwebsite Clarico Theme + theme_clarico + + + + + + IR Heizpanelle + www.irheizpanelle.at + + + + + + Heizpaneele + www.heizpaneele.at + + + + + + + diff --git a/ext/custom-addons/dp_website/static/description/icon.png b/ext/custom-addons/dp_website/static/description/icon.png new file mode 100755 index 00000000..8387d765 Binary files /dev/null and b/ext/custom-addons/dp_website/static/description/icon.png differ diff --git a/ext/custom-addons/dp_website/static/src/img/favicon.ico b/ext/custom-addons/dp_website/static/src/img/favicon.ico new file mode 100755 index 00000000..3c33e99b Binary files /dev/null and b/ext/custom-addons/dp_website/static/src/img/favicon.ico differ diff --git a/setup/lib/cli.py b/setup/lib/cli.py index ce610be3..0c4106fa 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -20,6 +20,7 @@ def main(): print(' create Neue Datenbank erstellen') print(' create_from_dump Neue Datenbank von Dump erstellen') print(' setup Modulinstallation, Konfigurationen') + print(' setup_website Modulinstallation für die Websies, Konfigurationen') print(' setup_part setup_function Aufruf eines einzelnen Setup-Schrittes') print(' "setup_part info" listet die verfügbaren') print(' Setup-Schritte auf') @@ -171,6 +172,14 @@ def main(): 'install_module', ] + if cmd == 'setup_website': + methods = [ + 'login', + 'install_website_modules', + 'setup_websites', + 'configure_payment_providers' + ] + if cmd == 'uninstall': instance.config.module_name = argv[2] methods = [ diff --git a/setup/lib/config.py b/setup/lib/config.py index 5263b32b..7bb58f6b 100644 --- a/setup/lib/config.py +++ b/setup/lib/config.py @@ -155,6 +155,16 @@ class Config(object): 'auditlog' ] + self.multi_website_modules = [ + 'website_multi_company_sale', + 'dp_website', + 'clarico_cart', + 'clarico_contact', + 'theme_clarico', + 'payment_paypal', + 'payment_stripe' + ] + # Setze das Feld "Attachment" im Report (wenn gesetzt wird das PDF in den Anhängen gespeichert) timestamp = " + '_' + time.strftime('%Y-%m-%d-%H%M') + '.pdf')" self.reports = { diff --git a/setup/lib/functions.py b/setup/lib/functions.py index d6701cc9..01b173f3 100644 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -250,6 +250,90 @@ class DatenpolFunctions(object): return True + def install_website_modules(self): + """Website Module installieren""" + + for module in self.config.multi_website_modules: + self.install_modules(module=module) + return True + + def setup_websites(self): + """Setup Websites""" + # Create Theme + clarico_theme = self.odoo.env['website.theme'].create({ + 'name': 'Multiwebsite Clarico Theme', + 'converted_theme_addon': 'theme_clarico' + }) + + vals = { + 'model': 'website.theme', + 'module': 'website_multi_theme', + 'name': 'clarico_multi', + 'res_id': str(clarico_theme), + 'noupdate': False, + } + self.odoo.env['ir.model.data'].create(vals) + + self.odoo.env.ref('website.default_website').multi_theme_reload() + + #create Salesteam for all websites + crm_team_vals = { + 'name': 'IR Heizpaneele', + 'team_type': 'website', + 'company_id': self.odoo.env.ref('base.main_company').id, + } + cr_team_ir_heizpaneel = self.odoo.env['crm.team'].create(crm_team_vals) + + crm_team_vals = { + 'name': 'Heizpaneele', + 'team_type': 'website', + 'company_id': self.odoo.env.ref('base.main_company').id, + } + cr_team_heizpaneel = self.odoo.env['crm.team'].create(crm_team_vals) + + # Create and configure Websites + default_website = self.odoo.env.ref('website.default_website') + default_website.write({ + 'name': 'IR Heizpaneele', + 'domain': 'www.irheizpaneele.at', + 'company_id': self.odoo.env.ref('base.main_company').id, + 'salesteam_id': cr_team_ir_heizpaneel, + 'multi_theme_id': clarico_theme + }) + + heizpaneele = self.odoo.env['website'].create({ + 'name': 'Heizpaneele', + 'domain': 'www.heizpaneele.at', + 'company_id': self.odoo.env.ref('base.main_company').id, + 'salesteam_id': cr_team_heizpaneel, + 'multi_theme_id': clarico_theme + }) + vals = { + 'model': 'website', + 'module': 'dp_website', + 'name': 'tz_heizpaneele', + 'res_id': str(heizpaneele), + 'noupdate': False, + } + self.odoo.env['ir.model.data'].create(vals) + + return True + + def configure_payment_providers(self): + """Zahlungsmethoden konfigurieren""" + vals = { + 'website_ids': [(6, 0, [self.odoo.env.ref('dp_website.tz_heizpaneele').id, + self.odoo.env.ref('website.default_website').id])] + } + + paypal = self.odoo.env.ref('payment.payment_acquirer_paypal') + paypal.write(vals) + + stripe = self.odoo.env.ref('payment.payment_acquirer_stripe') + stripe.write(vals) + + return True + def install_modules(self, module=False, raise_exception=False): """Module installieren"""