230: Webshop - Zahlungsarten + 237: Integration / Anpassung - 3rd Party Module
							parent
							
								
									b53acf4350
								
							
						
					
					
						commit
						8bd3be0421
					
				|  | @ -8,7 +8,7 @@ db_port = 5432 | ||||||
| db_user = False | db_user = False | ||||||
| db_password = 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 | ; For enterprise use the addons path bellow | ||||||
| ; addons_path = ext/enterprise-addons,ext/odoo/addons,ext/3rd-party-addons,ext/custom-addons,dmi/run1 | ; addons_path = ext/enterprise-addons,ext/odoo/addons,ext/3rd-party-addons,ext/custom-addons,dmi/run1 | ||||||
| timezone = Europe/Vienna | timezone = Europe/Vienna | ||||||
|  |  | ||||||
|  | @ -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. | ||||||
|  | @ -0,0 +1,23 @@ | ||||||
|  | # 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). | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | # 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, | ||||||
|  | } | ||||||
|  | @ -0,0 +1,29 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <odoo> | ||||||
|  | 
 | ||||||
|  |     <record model="website.theme" id="clarico_multi"> | ||||||
|  |         <field name="name">Multiwebsite Clarico Theme</field> | ||||||
|  |         <field name="converted_theme_addon">theme_clarico</field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <function model="website.theme" | ||||||
|  |               name="_convert_assets" | ||||||
|  |               eval="([ref('clarico_multi')])"/> | ||||||
|  | 
 | ||||||
|  |     <record id="website.default_website" model="website"> | ||||||
|  |         <field name="name">IR Heizpanelle</field> | ||||||
|  |         <field name="domain">www.irheizpanelle.at</field> | ||||||
|  |         <field name="company_id" eval="ref('base.main_company')"/> | ||||||
|  |         <field name="multi_theme_id" ref="dp_website.clarico_multi"/> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="tz_heizpaneele" model="website"> | ||||||
|  |         <field name="name">Heizpaneele</field> | ||||||
|  |         <field name="domain">www.heizpaneele.at</field> | ||||||
|  |         <field name="company_id" eval="ref('base.main_company')"/> | ||||||
|  |         <field name="multi_theme_id" ref="dp_website.clarico_multi"/> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | </odoo> | ||||||
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 2.2 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 26 KiB | 
|  | @ -20,6 +20,7 @@ def main(): | ||||||
|         print('   create                     Neue Datenbank erstellen') |         print('   create                     Neue Datenbank erstellen') | ||||||
|         print('   create_from_dump           Neue Datenbank von Dump erstellen') |         print('   create_from_dump           Neue Datenbank von Dump erstellen') | ||||||
|         print('   setup                      Modulinstallation, Konfigurationen') |         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 setup_function  Aufruf eines einzelnen Setup-Schrittes') | ||||||
|         print('                              "setup_part info" listet die verfügbaren') |         print('                              "setup_part info" listet die verfügbaren') | ||||||
|         print('                              Setup-Schritte auf') |         print('                              Setup-Schritte auf') | ||||||
|  | @ -171,6 +172,14 @@ def main(): | ||||||
|             'install_module', |             'install_module', | ||||||
|         ] |         ] | ||||||
| 
 | 
 | ||||||
|  |     if cmd == 'setup_website': | ||||||
|  |         methods = [ | ||||||
|  |             'login', | ||||||
|  |             'install_website_modules', | ||||||
|  |             'setup_websites', | ||||||
|  |             'configure_payment_providers' | ||||||
|  |         ] | ||||||
|  | 
 | ||||||
|     if cmd == 'uninstall': |     if cmd == 'uninstall': | ||||||
|         instance.config.module_name = argv[2] |         instance.config.module_name = argv[2] | ||||||
|         methods = [ |         methods = [ | ||||||
|  |  | ||||||
|  | @ -155,6 +155,16 @@ class Config(object): | ||||||
|             'auditlog' |             '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) |         # 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')" |         timestamp = " + '_' +  time.strftime('%Y-%m-%d-%H%M') + '.pdf')" | ||||||
|         self.reports = { |         self.reports = { | ||||||
|  |  | ||||||
|  | @ -250,6 +250,90 @@ class DatenpolFunctions(object): | ||||||
| 
 | 
 | ||||||
|         return True |         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): |     def install_modules(self, module=False, raise_exception=False): | ||||||
|         """Module installieren""" |         """Module installieren""" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue