währungen
							parent
							
								
									ffdfaa4dc5
								
							
						
					
					
						commit
						2e816077d1
					
				|  | @ -57,7 +57,8 @@ def main(): | ||||||
|             'set_taxes',     |             'set_taxes',     | ||||||
|             'set_uom',     |             'set_uom',     | ||||||
|             'set_steuerzuordnung',      |             'set_steuerzuordnung',      | ||||||
|             'setup_journals',           |             'setup_journals',     | ||||||
|  |             'set_currencies',       | ||||||
|         ] |         ] | ||||||
| 
 | 
 | ||||||
|     if cmd == 'rollout': |     if cmd == 'rollout': | ||||||
|  |  | ||||||
|  | @ -50,7 +50,12 @@ class Config(): | ||||||
|             'Kunde Ausland', |             'Kunde Ausland', | ||||||
|             'Kunde EU (ohne USt-ID)', |             'Kunde EU (ohne USt-ID)', | ||||||
|             'Kunde EU Unternehmen (mit USt-ID)', |             'Kunde EU Unternehmen (mit USt-ID)', | ||||||
|         ]         |         ]       | ||||||
|  |          | ||||||
|  |         # Aktive Währungen | ||||||
|  |         self.valid_currencies = [ | ||||||
|  |             'EUR', | ||||||
|  |         ]            | ||||||
|          |          | ||||||
|         # Allgemeine Einstellungen |         # Allgemeine Einstellungen | ||||||
|         self.base_config = { |         self.base_config = { | ||||||
|  |  | ||||||
|  | @ -264,6 +264,25 @@ class CamadeusFunctions(): | ||||||
|         wizard_id = self._execute('wizard.multi.charts.accounts', 'create', vals) |         wizard_id = self._execute('wizard.multi.charts.accounts', 'create', vals) | ||||||
|         res = self._execute('wizard.multi.charts.accounts', 'action_next', [wizard_id]) |         res = self._execute('wizard.multi.charts.accounts', 'action_next', [wizard_id]) | ||||||
|         return True |         return True | ||||||
|  | 
 | ||||||
|  |     def set_currencies(self): | ||||||
|  |         """Währungen setzen""" | ||||||
|  |          | ||||||
|  |         c = self.config | ||||||
|  |          | ||||||
|  |         # Set all currencies to active | ||||||
|  |         ids = self._execute('res.currency', 'search', ['|',('active','=',True),('active','=',False)]) | ||||||
|  |         res = self._execute('res.currency', 'write', ids, {'active': True}) | ||||||
|  |         if not res: | ||||||
|  |             return False | ||||||
|  |          | ||||||
|  |         # Set all other UOMs to inactive | ||||||
|  |         inactive_ids = self._execute('res.currency', 'search', [('name','not in',c.valid_currencies)]) | ||||||
|  |         res = self._execute('res.currency', 'write', inactive_ids, {'active': False}) | ||||||
|  |         if not res: | ||||||
|  |             return False | ||||||
|  |                  | ||||||
|  |         return True | ||||||
|      |      | ||||||
|     def uninstall_chat(self): |     def uninstall_chat(self): | ||||||
|         """Chat-Modul deinstallieren """ |         """Chat-Modul deinstallieren """ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue