From b42641afc47e398d6bd533263e8fc1bdbae40518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=BCckl?= Date: Fri, 19 Jun 2015 13:28:29 +0200 Subject: [PATCH] reports, functions --- ext/custom-addons/cam_custom/cam_custom.py | 14 +++++++ .../cam_reports/report/purchase.order.rml | 10 ----- .../cam_reports/report/purchase.quotation.rml | 10 ----- setup/lib/cli.py | 5 ++- setup/lib/config_at.py | 23 ++++++++++- setup/lib/functions.py | 40 +++++++++++++------ 6 files changed, 67 insertions(+), 35 deletions(-) diff --git a/ext/custom-addons/cam_custom/cam_custom.py b/ext/custom-addons/cam_custom/cam_custom.py index 871897db..026933ca 100644 --- a/ext/custom-addons/cam_custom/cam_custom.py +++ b/ext/custom-addons/cam_custom/cam_custom.py @@ -138,3 +138,17 @@ class sale_order_line(models.Model): taxes_id = ir_values.get_default(self._cr, self._uid, 'product.template', 'taxes_id', company_id=company.id) at = self.env['account.tax'].search([('id','=',isinstance(taxes_id, list) and taxes_id[0] or taxes_id)]) self.tax_id = at + +class product_product(models.Model): + _inherit = 'product.product' + + def name_get(self, cr, user, ids, context=None): + """ beim Angebot die Nummer nicht in das Feld Bezeichnung übernehmen""" + if context is None: + context = {} + c = context.copy() + if c.get('partner_id', False): + if not c.get('quantity', False): + c.update({'display_default_code': False}) + return super(product_product, self).name_get(cr, user, ids, context=c) + \ No newline at end of file diff --git a/ext/custom-addons/cam_reports/report/purchase.order.rml b/ext/custom-addons/cam_reports/report/purchase.order.rml index 7838c5c6..62c5b88c 100644 --- a/ext/custom-addons/cam_reports/report/purchase.order.rml +++ b/ext/custom-addons/cam_reports/report/purchase.order.rml @@ -217,16 +217,6 @@ - [[o.payment_term_id or removeParentNode('blockTable') ]] - - - Zahlungsbedingungen: - - - [[o.payment_term_id and o.payment_term_id.note or '' ]] - - - diff --git a/ext/custom-addons/cam_reports/report/purchase.quotation.rml b/ext/custom-addons/cam_reports/report/purchase.quotation.rml index 5cc3bb1c..82a2969c 100644 --- a/ext/custom-addons/cam_reports/report/purchase.quotation.rml +++ b/ext/custom-addons/cam_reports/report/purchase.quotation.rml @@ -159,16 +159,6 @@ - [[o.payment_term_id or removeParentNode('blockTable') ]] - - - Zahlungsbedingungen: - - - [[o.payment_term_id and o.payment_term_id.note or '' ]] - - - diff --git a/setup/lib/cli.py b/setup/lib/cli.py index 24deda13..14ab3bce 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -68,6 +68,7 @@ def main(): 'sale_config', 'hr_config', 'stock_config', + 'mrp_config', 'stock_set_cost_method', 'set_incoterms', 'purchase_config', @@ -80,10 +81,11 @@ def main(): 'set_currencies', 'set_decimal_price', 'set_default_values', - 'set_translations', 'set_default_removal_strategy', 'default_set_order_policy', + 'delete_mail_server', + 'update_values', ] if cmd == 'rollout': @@ -92,7 +94,6 @@ def main(): 'set_dokumentennummern', 'set_dmi_noupdate', 'dmi_confirm_inventory', - 'setup_mail_server', 'import_users', ] diff --git a/setup/lib/config_at.py b/setup/lib/config_at.py index 8e0e6b81..591b7bb7 100644 --- a/setup/lib/config_at.py +++ b/setup/lib/config_at.py @@ -44,7 +44,13 @@ class Config(): # Nur für Lager # Wenn nicht gesetzt, dann wird der Firmenname genommen - self.warehouse_name = 'Bademeisterei' + self.warehouse_name = 'Bademeisterei' + + # Anzahl der Schritte beim Ausliefern + # [ship_only] Direkt vom Lager liefern + # [pick_ship] Liefere vor Auslieferung zuerst in Versandlager (Pick + Ship) + # [pick_pack_ship] Verpacken Sie die Produkte an einer Pack-Station bevor Sie den Versand vornehmen + self.delivery_steps = 'ship_only' self.valid_taxes = [ '20% MwSt', @@ -107,8 +113,16 @@ class Config(): 'group_stock_tracking_lot': False, # Benutze Verpackungen: Paletten, Boxen, ... 'group_stock_production_lot': True, # Verfolgen Sie Los- und Seriennummern. 'group_stock_packaging': False, # Ermöglicht die Auswahl einer Verpackung + 'group_stock_adv_location': True, # Verwalten Sie erweiterte Routen im Lager } + # Einstellungen Fertigung + self.mrp_config = { + 'group_mrp_routings': True, # Verwalte Arbeitspläne und Arbeitsaufträge + 'module_mrp_operations': True, # Detaillierte Planung von Arbeitsaufträgen vornehmen + 'group_mrp_properties': False, # Ermögliche Merkmale für verschiedene Stücklisten eines Produkts + } + #self.removal_strategy = 'fefo' #[fifo], [lifo], [fefo] self.stock_cost_method = 'average' # [standard], [average], [real] @@ -173,6 +187,7 @@ class Config(): self.allow_cancel_invoice = True self.modules = [ + 'base_iban', 'document', 'knowledge', 'auth_crypt', @@ -201,3 +216,9 @@ class Config(): self.default_values = [ # ir.values #('product.template', 'type', 'service'), ] + + self.config.data_updates = { + 'mrp.route_warehouse0_manufacture': {'name': 'Produzieren'}, + 'purchase.route_warehouse0_buy': {'name': 'Einkaufen'}, + 'stock.route_warehouse0_mto': {'name': 'Beschaffe von Auftrag'}, + } \ No newline at end of file diff --git a/setup/lib/functions.py b/setup/lib/functions.py index d16946ad..713251b1 100755 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -149,6 +149,16 @@ class CamadeusFunctions(): wizard_id = self._execute('stock.config.settings', 'create', vals) return self._execute('stock.config.settings', 'execute', [wizard_id]) return True + + def mrp_config(self): + """Basiskonfiguration für Fertigung laden""" + + if hasattr(self.config, 'mrp_config'): + vals = {}#self._execute('mrp.config.settings', 'default_get', self.config.mrp_config.keys()) + vals.update(self.config.mrp_config) + wizard_id = self._execute('mrp.config.settings', 'create', vals) + return self._execute('mrp.config.settings', 'execute', [wizard_id]) + return True def hr_config(self): """Basiskonfiguration für Personal Laden""" @@ -482,12 +492,13 @@ class CamadeusFunctions(): is_installed = self._execute('ir.module.module', 'search', [('name','=','stock'),('state','=','installed')]) if is_installed: vals = { - 'name': self.config.warehouse_name or self.config.company_data.get('name','Mein Unternehmen') + 'name': self.config.warehouse_name or self.config.company_data.get('name','Mein Unternehmen'), + 'delivery_steps': self.config.delivery_steps, } warehouse_ids = self._execute('stock.warehouse', 'search', [('id','=',1)]) return self._execute('stock.warehouse', 'write', warehouse_ids, vals) else: - return True + return True def set_dmi_noupdate(self): """DMI: Einträge auf 'no update' setzen""" @@ -539,18 +550,14 @@ class CamadeusFunctions(): return True - def setup_mail_server(self): + def delete_mail_server(self): """Mailserver einrichten""" - if hasattr(self.config, 'mail_server'): - vals = self.config.mail_server - server_ids = self._execute('ir.mail_server', 'search', [('name','=',vals.get('name'))]) - - if server_ids: - return self._execute('ir.mail_server', 'write', server_ids, vals) - else: - return self._execute('ir.mail_server', 'create', vals) - return False + server_ids = self._execute('ir.mail_server', 'search', []) + if server_ids: + return self._execute('ir.mail_server', 'unlink', server_ids) + + return True def stock_set_cost_method(self): """Kalkulationsverfahren für Lager setzen""" @@ -639,3 +646,12 @@ class CamadeusFunctions(): else: self._execute('ir.values', 'create', vals) return True + + def update_values(self): + """Existierende Daten aktualisieren""" + + for xml_id,vals in self.config.data_updates.items(): + dummy,model,res_id = self._execute('ir.model.data', 'xmlid_lookup', xml_id) + self._execute(model, 'write', [res_id], vals) + + return True \ No newline at end of file