Merge branch 'master' of ssh://gitlab.datenpol.at:122/odoo/dp-template
						commit
						c27a8723ab
					
				|  | @ -1,8 +1,8 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.at>). | ||||
| #    datenpol gmbh | ||||
| #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||
| # | ||||
| #    This program is free software: you can redistribute it and/or modify | ||||
| #    it under the terms of the GNU Affero General Public License as | ||||
|  | @ -22,4 +22,3 @@ | |||
| import models | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
| 
 | ||||
|  |  | |||
|  | @ -2,7 +2,7 @@ | |||
| ############################################################################## | ||||
| # | ||||
| #    datenpol gmbh | ||||
| #    Copyright (C) 2013-TODAY datenpol gmbh(<http://www.datenpol.at>) | ||||
| #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||
| # | ||||
| #    This program is free software: you can redistribute it and/or modify | ||||
| #    it under the terms of the GNU Affero General Public License as | ||||
|  | @ -26,11 +26,13 @@ | |||
|     'version': '1.0', | ||||
|     'description': """Individuelle Anpassungen""", | ||||
|     'author': 'datenpol gmbh', | ||||
|     'website': 'http://www.datenpol.at', | ||||
|     'depends': ['base'], | ||||
|     'website': 'http://www.datenpol.at/', | ||||
|     'depends': [ | ||||
|         'base', | ||||
|     ], | ||||
|     'data': [ | ||||
|         'data/dp_custom_data.xml', | ||||
|         'views/dp_custom_view.xml', | ||||
|         'views/dp_custom_views.xml', | ||||
|         'security/ir.model.access.csv', | ||||
|     ], | ||||
|     'installable': True, | ||||
|  | @ -1,8 +1,6 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <openerp> | ||||
| <data noupdate="0"> | ||||
| 	 | ||||
| 	 | ||||
|     <!--  UNITS --> | ||||
| 
 | ||||
|     <!-- Einheit in Stück umbenennen --> | ||||
|  | @ -120,8 +118,5 @@ | |||
|     'width': fields.float('Width', help='The width of the package'), | ||||
|     'length': fields.float('Length', help='The length of the package'), | ||||
|     'weight': fields.float('Empty Package Weight'), --> | ||||
|          | ||||
|          | ||||
|         | ||||
| </data> | ||||
| </openerp> | ||||
|  |  | |||
|  | @ -2,7 +2,7 @@ | |||
| ############################################################################## | ||||
| # | ||||
| #    datenpol gmbh | ||||
| #    Copyright (C) 2013-TODAY datenpol gmbh(<http://www.datenpol.at>) | ||||
| #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||
| # | ||||
| #    This program is free software: you can redistribute it and/or modify | ||||
| #    it under the terms of the GNU Affero General Public License as | ||||
|  | @ -24,7 +24,6 @@ from openerp import api | |||
| from openerp.tools.translate import _ | ||||
| from openerp import SUPERUSER_ID | ||||
| from openerp import tools | ||||
| from lxml import etree | ||||
| 
 | ||||
| DISABLED_MENUS = [ | ||||
| ] | ||||
|  | @ -42,12 +41,12 @@ class ir_ui_menu(models.Model): | |||
|             menu = data_obj.get_object(cr, uid, module, xml_id) | ||||
|             if menu: | ||||
|                 menu_ids.append(menu.id) | ||||
| 
 | ||||
|         return menu_ids | ||||
| 
 | ||||
|     def _filter_visible_menus(self, cr, uid, ids, context=None): | ||||
|         if uid != 1: | ||||
|             disabled_ids = self.get_disabled_menu_ids(cr, uid) | ||||
|               | ||||
|             ids = [id for id in ids if id not in disabled_ids] | ||||
| 
 | ||||
|         ids = super(ir_ui_menu, self)._filter_visible_menus(cr, uid, ids, context) | ||||
|  |  | |||
|  | @ -2,9 +2,5 @@ | |||
| <openerp> | ||||
| <data> | ||||
| 
 | ||||
| 
 | ||||
| </data> | ||||
| </openerp> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  | @ -1,14 +1,16 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| { | ||||
|     'name': 'datepol Report Anpassungen', | ||||
|     'name': 'datepol Report-Anpassungen', | ||||
|     'category': 'Custom', | ||||
|     'version': '1.0', | ||||
|     'summary': """Individuelle Report Anpassungen""", | ||||
|     'description': """Individuelle Report Anpassungen""", | ||||
|     'author': 'datenpol gmbh', | ||||
|     'website': 'http://www.datenpol.at', | ||||
|     'depends': ['base'], | ||||
|     'website': 'http://www.datenpol.at/', | ||||
|     'depends': [ | ||||
|         'base', | ||||
|     ], | ||||
|     'data': [ | ||||
|         # 'security/ir.model.access.csv', | ||||
|         'views/layouts.xml', | ||||
|  | @ -49,6 +49,7 @@ | |||
|         </xpath> | ||||
|         <xpath expr="//table[@t-if='o.pack_operation_ids']/tbody/tr/td[2]" position="replace"/> | ||||
|     </template> | ||||
| 
 | ||||
|     <!-- Render Report with Header --> | ||||
|     <template id="stock.report_deliveryslip"> | ||||
|         <t t-set="header" t-value="1"/> | ||||
|  | @ -56,6 +57,7 @@ | |||
|             <t t-call="dp_report.report_delivery_document" t-lang="o.partner_id.lang"/> | ||||
|         </t> | ||||
|     </template> | ||||
| 
 | ||||
|     <!-- Render Report without Header --> | ||||
|     <template id="report_deliveryslip_blank"> | ||||
|         <t t-set="header" t-value="0"/> | ||||
|  | @ -63,6 +65,7 @@ | |||
|             <t t-call="dp_report.report_delivery_document" t-lang="o.partner_id.lang"/> | ||||
|         </t> | ||||
|     </template> | ||||
| 
 | ||||
|     <!-- Create new Report --> | ||||
|     <report id="dp_report_deliveryslip_blank" | ||||
|         string="Lieferschein Ohne Logo" | ||||
|  | @ -70,6 +73,5 @@ | |||
|         report_type="qweb-pdf" | ||||
|         name="dp_report.report_deliveryslip_blank" | ||||
|         file="dp_report.report_deliveryslip_blank"/> | ||||
| 
 | ||||
| </data> | ||||
| </openerp> | ||||
|  | @ -33,26 +33,27 @@ | |||
|             </p> | ||||
|         </p> | ||||
|     </template> | ||||
| 
 | ||||
|     <!-- Render Report with Header --> | ||||
|     <template id="account.report_invoice"> | ||||
|         <t t-call="report.html_container"> | ||||
|             <t t-set="header" t-value="1"/> | ||||
|             <t t-foreach="docs" t-as="o"> | ||||
|                     <t t-call="dp_report.report_invoice_document" t-lang="o.partner_id.lang"> | ||||
|                     </t> | ||||
|                 <t t-call="dp_report.report_invoice_document" t-lang="o.partner_id.lang"/> | ||||
|             </t> | ||||
|         </t> | ||||
|     </template> | ||||
| 
 | ||||
|     <!-- Render Report without Header --> | ||||
|     <template id="report_invoice_blank"> | ||||
|         <t t-call="report.html_container"> | ||||
|             <t t-set="header" t-value="0"/> | ||||
|             <t t-foreach="docs" t-as="o"> | ||||
|                     <t t-call="dp_report.report_invoice_document" t-lang="o.partner_id.lang"> | ||||
|                     </t> | ||||
|                 <t t-call="dp_report.report_invoice_document" t-lang="o.partner_id.lang"/> | ||||
|             </t> | ||||
|         </t> | ||||
|     </template> | ||||
| 
 | ||||
|     <!-- Create new Report --> | ||||
|     <report id="dp_report_invoice_blank" | ||||
|         string="Rechnung Ohne Logo" | ||||
|  | @ -60,6 +61,5 @@ | |||
|         report_type="qweb-pdf" | ||||
|         name="dp_report.report_invoice_blank" | ||||
|         file="dp_report.report_invoice_blank"/> | ||||
| 
 | ||||
| </data> | ||||
| </openerp> | ||||
|  | @ -6,10 +6,10 @@ | |||
|             <t t-set="o" t-value="doc"/> | ||||
|         </t> | ||||
|         <t t-if="o and 'company_id' in o"> | ||||
|                 <t t-set="company" t-value="o.company_id"></t> | ||||
|             <t t-set="company" t-value="o.company_id"/> | ||||
|         </t> | ||||
|         <t t-if="not o or not 'company_id' in o"> | ||||
|                 <t t-set="company" t-value="res_company"></t> | ||||
|             <t t-set="company" t-value="res_company"/> | ||||
|         </t> | ||||
|         <t t-if="header == 1"> | ||||
|             <t t-call="dp_report.external_layout_header"/> | ||||
|  |  | |||
|  | @ -53,26 +53,27 @@ | |||
|             </div> | ||||
|         </div> | ||||
|     </template> | ||||
| 
 | ||||
|     <!-- Render Report with Header --> | ||||
|     <template id="sale.report_saleorder"> | ||||
|         <t t-call="report.html_container"> | ||||
|             <t t-set="header" t-value="1"/> | ||||
|             <t t-foreach="docs" t-as="doc"> | ||||
|                     <t t-call="dp_report.report_saleorder_document" t-lang="doc.partner_id.lang"> | ||||
|                     </t> | ||||
|                 <t t-call="dp_report.report_saleorder_document" t-lang="doc.partner_id.lang"/> | ||||
|             </t> | ||||
|         </t> | ||||
|     </template> | ||||
| 
 | ||||
|     <!-- Render Report without Header --> | ||||
|     <template id="report_saleorder_blank"> | ||||
|         <t t-call="report.html_container"> | ||||
|             <t t-set="header" t-value="0"/> | ||||
|             <t t-foreach="docs" t-as="doc"> | ||||
|                     <t t-call="dp_report.report_saleorder_document" t-lang="doc.partner_id.lang"> | ||||
|                     </t> | ||||
|                 <t t-call="dp_report.report_saleorder_document" t-lang="doc.partner_id.lang"/> | ||||
|             </t> | ||||
|         </t> | ||||
|     </template> | ||||
| 
 | ||||
|     <!-- Create new Report --> | ||||
|     <report id="dp_report_saleorder_blank" | ||||
|         string="Angebot / Bestellung Ohne Logo" | ||||
|  | @ -80,6 +81,5 @@ | |||
|         report_type="qweb-pdf" | ||||
|         name="dp_report.report_saleorder_blank" | ||||
|         file="dp_report.report_saleorder_blank"/> | ||||
| 
 | ||||
| </data> | ||||
| </openerp> | ||||
|  | @ -82,7 +82,6 @@ def main(): | |||
|             'login', | ||||
|             'install_module_sale', | ||||
|             #'setup_accounting', | ||||
|             #'setup_accounting2', | ||||
|             'set_admin_rights', | ||||
|         ] | ||||
| 
 | ||||
|  | @ -127,6 +126,8 @@ def main(): | |||
|         #'update_special_values', | ||||
|         'set_sys_params', | ||||
|         #'setup_reports', | ||||
|         'consume_tours', | ||||
|         'disable_planners', | ||||
|     ] | ||||
| 
 | ||||
|     if cmd == 'setup': | ||||
|  |  | |||
|  | @ -25,7 +25,6 @@ class Config(): | |||
|             'website': 'http://www.datenpol.at/', | ||||
|             'company_registry': '359270p', | ||||
|             'country_id': 'at', # 'de' für Deutschland | ||||
|             'logo': False, | ||||
|             'vat': 'ATU 66309611', | ||||
|             'rml_header1': False, | ||||
|             'vat_check_vies': True, | ||||
|  | @ -84,11 +83,11 @@ class Config(): | |||
| 
 | ||||
|         # Einstellungen Verkauf | ||||
|         self.sale_config = { | ||||
|             'group_sale_delivery_address': True,         # Verschiedene Adressen für Rechnung und Lieferung | ||||
|             'group_sale_pricelist': True,                # Preislisten verwenden | ||||
|             'group_discount_per_so_line': True,          # Rabatte verwenden | ||||
|             'group_uom': True,                           # Verwende Mengeneinheiten | ||||
|             'group_invoice_deli_orders': True,           # Erstelle Rechnungen durch Auslieferungen | ||||
|             'group_sale_delivery_address': 0,            # Verschiedene Adressen für Rechnung und Lieferung | ||||
|             'sale_pricelist_setting': 'fixed',           # Verkaufspreis: [fixed], [percentage], [formula] | ||||
|             'group_discount_per_so_line': 0,             # Rabatt auf Verkaufszeilen | ||||
|             'group_uom': 0,                              # Verwende Mengeneinheiten | ||||
|             'default_invoice_policy': 'order'            # Standardabrechnung: [order], [delivery] | ||||
|         } | ||||
|         self.order_policy = 'picking'                    # Erzeuge Rechnung: [manual], [picking], [prepaid] | ||||
| 
 | ||||
|  | @ -101,12 +100,12 @@ class Config(): | |||
|             'group_costing_method': True,                # Benutzen Sie 'Einkaufs-' oder 'Durchschnittspreis' zur Bestandsbewertung | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         # Einstellungen Finanzen | ||||
|         self.finance_config = { | ||||
|             #'group_multi_currency':True | ||||
|             'group_multi_currency': False,               # Multiwährungsfunktion aktivieren | ||||
|             'default_sale_tax_id': 'XML:l10n_at.1_tax_at_mwst_10', # Standardsteuer Verkauf | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         # Einstellungen Personal | ||||
|         self.hr_config = { | ||||
|             'module_hr_expense': True,                   # Spesen der Mitarbeiter verwalten | ||||
|  | @ -116,11 +115,12 @@ class Config(): | |||
| 
 | ||||
|         # Einstellungen Lager | ||||
|         self.stock_config = { | ||||
|             'group_stock_multiple_locations': True,      # Verwalten Sie mehrere Lager und Lagerorte | ||||
|             '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 | ||||
|             'warehouse_and_location_usage_level': 0,     # Warehouses and Locations usage level | ||||
|             'group_stock_tracking_lot': 0,               # Verpackungsgrößen bei der Verpackung: Paletten, Kisten, Behälter... | ||||
|             'group_stock_production_lot': 0,             # Verfolgen Sie Los- und Seriennummern | ||||
|             'group_stock_packaging': 0,                  # Manage available packaging options per products | ||||
|             'group_stock_adv_location': 0,               # Advanced routing of products using rules | ||||
|             'group_product_variant': 0,                  # Produkte können mehrere Attribute haben, die Varianten definieren | ||||
|         } | ||||
| 
 | ||||
|         # Einstellungen Fertigung | ||||
|  | @ -253,4 +253,5 @@ class Config(): | |||
| 
 | ||||
|         self.system_parameters = { | ||||
|             'ir_attachment.location': 'db', # [db] oder [file] | ||||
|             'database.expiration_date': '2038-01-19', | ||||
|         } | ||||
|  |  | |||
|  | @ -95,6 +95,26 @@ class DatenpolFunctions(): | |||
|         fi.close() | ||||
|         return content | ||||
| 
 | ||||
|     def resolve_xml_id(self, value): | ||||
|         # In case the value starts with 'XML:' then take the remaining string | ||||
|         # as an XML-Id, resolve it and return that. Otherwise return value | ||||
|         # unchanged. | ||||
|         if type(value) != str or value[:4] != 'XML:': | ||||
|             return value | ||||
| 
 | ||||
|         xml_id = value[4:] | ||||
|         res_id = self._execute('ir.model.data', 'xmlid_to_res_id', xml_id) | ||||
|         if not res_id: | ||||
|             raise Exception('XML-Id "%s" nicht vorhanden!' % xml_id) | ||||
|         return res_id | ||||
| 
 | ||||
|     def resolve_xml_ids(self, data): | ||||
|         # Resolve all XML-Ids in the dict data | ||||
|         # Note: This happens in-place, the original dict is returned | ||||
|         for k, v in data.iteritems(): | ||||
|             data[k] = self.resolve_xml_id(v) | ||||
|         return data | ||||
| 
 | ||||
|     def set_company(self): | ||||
|         """Setze Unternehmensdaten (Allgemein, RML, Logo)""" | ||||
| 
 | ||||
|  | @ -344,15 +364,6 @@ class DatenpolFunctions(): | |||
|         return self._execute('res.users', 'write', [user_id], vals) | ||||
| 
 | ||||
|     def setup_accounting(self): | ||||
|         """Konfiguration Buchhaltung""" | ||||
| 
 | ||||
|         vals = self._execute('account.installer', 'default_get', []) | ||||
|         vals['charts'] = self.config.chart_of_accounts | ||||
|         wizard_id = self._execute('account.installer', 'create', vals) | ||||
|         self._execute('account.installer', 'action_next', [wizard_id]) | ||||
|         return True | ||||
| 
 | ||||
|     def setup_accounting2(self): | ||||
|         """Konfiguration Kontenplan""" | ||||
| 
 | ||||
|         c = self.config | ||||
|  | @ -690,14 +701,7 @@ class DatenpolFunctions(): | |||
|         """Defaultwerte für Dokumente setzen""" | ||||
| 
 | ||||
|         for model, field, value in self.config.default_values: | ||||
|             # Falls XML ID (prefix "XML:") dann die DB ID holen | ||||
|             if value[0:4] == 'XML:': | ||||
|                 xml_id = value[4:] | ||||
|                 dummy, dummy2, res_id = self._execute('ir.model.data', 'xmlid_lookup', xml_id) | ||||
|                 if not res_id: | ||||
|                     raise Exception('Defaultwerte anlegen: XML ID %s nicht vorhanden!' % (xml_id)) | ||||
|                 value = res_id | ||||
| 
 | ||||
|             value = self.resolve_xml_id(value) | ||||
|             vals = { | ||||
|                 'name': field, | ||||
|                 'model': model, | ||||
|  | @ -800,7 +804,7 @@ class DatenpolFunctions(): | |||
| 
 | ||||
|         if hasattr(self.config, 'finance_config'): | ||||
|             vals = self._execute('account.config.settings', 'default_get', []) | ||||
|             vals.update(self.config.finance_config) | ||||
|             vals.update(self.resolve_xml_ids(self.config.finance_config)) | ||||
|             wizard_id = self._execute('account.config.settings', 'create', vals) | ||||
|             return self._execute('account.config.settings', 'execute', [wizard_id]) | ||||
|         return True | ||||
|  | @ -909,6 +913,34 @@ class DatenpolFunctions(): | |||
|         #     except: | ||||
|         #         print "Fehler Anlage ExtID " + 'cust_account_mapp_' + acc | ||||
| 
 | ||||
|         return True | ||||
| 
 | ||||
|     def consume_tours(self): | ||||
|         """Odoo-Touren auf konsumiert setzen""" | ||||
| 
 | ||||
|         tours = [ | ||||
|             'crm_tour', | ||||
|             'mail_tour', | ||||
|             'sale_tour', | ||||
|             'rte', | ||||
|             'rte_inline', | ||||
|         ] | ||||
| 
 | ||||
|         for uid in self._execute('res.users', 'search', []): | ||||
|             for t in tours: | ||||
|                 vals = { | ||||
|                     'name': t, | ||||
|                     'user_id': uid, | ||||
|                 } | ||||
|                 self._execute('web_tour.tour', 'create', vals) | ||||
| 
 | ||||
|         return True | ||||
| 
 | ||||
|     def disable_planners(self): | ||||
|         """Implementierungsplaner deaktivieren""" | ||||
| 
 | ||||
|         # The dashboard widget itself remains. It can be removed in the | ||||
|         # module web_settings_dashboard in dashboard.xml and dashboard.js. | ||||
| 
 | ||||
|         planner_ids = self._execute('web.planner', 'search', []) | ||||
|         return self._execute('web.planner', 'write', planner_ids, {'active': False}) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue