Merge branch 'master' of git:~/gitrepos/cam-template
						commit
						e90080ad56
					
				|  | @ -52,18 +52,23 @@ def main(): | |||
|             'set_warehouse', | ||||
|             'base_config', | ||||
|             'sale_config', | ||||
|             'stock_config', | ||||
|             'purchase_config', | ||||
|             'set_date_format',  | ||||
|             'set_company',  | ||||
|             'set_taxes',     | ||||
|             'set_uom',     | ||||
|             'set_steuerzuordnung',      | ||||
|             'setup_journals',     | ||||
|             'set_currencies',       | ||||
|         ] | ||||
| 
 | ||||
|     if cmd == 'rollout': | ||||
|         methods = [ | ||||
|             'login', | ||||
|             'set_dokumentennummern',     | ||||
|             'set_dmi_noupdate',    | ||||
|             'dmi_confirm_inventory',                 | ||||
|         ]       | ||||
|      | ||||
|     if cmd == 'update': | ||||
|  |  | |||
|  | @ -52,6 +52,11 @@ class Config(): | |||
|             'Kunde EU Unternehmen (mit USt-ID)', | ||||
|         ]       | ||||
|          | ||||
|         # Aktive Währungen | ||||
|         self.valid_currencies = [ | ||||
|             'EUR', | ||||
|         ]            | ||||
|          | ||||
|         # Allgemeine Einstellungen | ||||
|         self.base_config = { | ||||
|             'module_portal': False,      # Kundenportal | ||||
|  | @ -73,6 +78,8 @@ class Config(): | |||
|         #Einstellungen Lager | ||||
|         self.stock_config = { | ||||
|             'group_stock_multiple_locations': True,      # Verwalten Sie mehrere Läger und Lagerorte | ||||
|             'group_stock_tracking_lot': False,           # Benutze Verpackungen: Paletten, Boxen, ... | ||||
|             'group_stock_packaging': False,              # Ermöglicht die Auswahl einer Verpackung             | ||||
|         }   | ||||
|          | ||||
|         self.sequences = { | ||||
|  |  | |||
|  | @ -274,6 +274,25 @@ class CamadeusFunctions(): | |||
|         res = self._execute('wizard.multi.charts.accounts', 'action_next', [wizard_id]) | ||||
|         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): | ||||
|         """Chat-Modul deinstallieren """ | ||||
|          | ||||
|  | @ -382,7 +401,28 @@ class CamadeusFunctions(): | |||
|             vals = { | ||||
|                 'name': self.config.warehouse_name or self.config.company_data.get('name','Mein Unternehmen') | ||||
|             } | ||||
|             warehouse_ids = self._execute('stock.warehouse', 'search', []) | ||||
|             warehouse_ids = self._execute('stock.warehouse', 'search', [('id','=',1)]) | ||||
|             return self._execute('stock.warehouse', 'write', warehouse_ids, vals) | ||||
|         else: | ||||
|             return True | ||||
| 
 | ||||
|     def set_dmi_noupdate(self): | ||||
|         """DMI: Einträge auf 'no update' setzen""" | ||||
|          | ||||
|         domain = [('module','=','cam_dmi'),('noupdate','=',False)] | ||||
|         data_ids = self._execute('ir.model.data', 'search', domain) | ||||
|          | ||||
|         vals = {'noupdate': True} | ||||
|         return self._execute('ir.model.data', 'write', data_ids, vals) | ||||
|      | ||||
|     def dmi_confirm_inventory(self): | ||||
|         """DMI: Lagerstand einbuchen""" | ||||
|          | ||||
|         dummy,inventory_id = self._execute('ir.model.data', 'get_object_reference', 'cam_dmi','inv_init')   | ||||
|          | ||||
|         inventory = self._execute('stock.inventory', 'read', inventory_id, ['state']) | ||||
|          | ||||
|         if inventory.get('state','') == 'confirm': | ||||
|             return self._execute('stock.inventory', 'action_done', [inventory_id]) | ||||
|          | ||||
|         return True | ||||
		Loading…
	
		Reference in New Issue