Fall 4434: Sammelrechnung
							parent
							
								
									3f644e084e
								
							
						
					
					
						commit
						db656cbaa2
					
				|  | @ -35,7 +35,6 @@ | |||
|         'views/res_partner_views.xml', | ||||
|         'views/sale_views.xml', | ||||
|         'views/account_views.xml', | ||||
|         'security/ir.model.access.csv', | ||||
|     ], | ||||
|     'installable': True, | ||||
|     'auto_install': False, | ||||
|  |  | |||
|  | @ -20,5 +20,4 @@ | |||
| ############################################################################## | ||||
| 
 | ||||
| from . import sale | ||||
| from . import account | ||||
| from . import res_partner | ||||
|  |  | |||
|  | @ -1,25 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    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 | ||||
| #    published by the Free Software Foundation, either version 3 of the | ||||
| #    License, or (at your option) any later version. | ||||
| # | ||||
| #    This program is distributed in the hope that it will be useful, | ||||
| #    but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| #    GNU Affero General Public License for more details. | ||||
| # | ||||
| #    You should have received a copy of the GNU Affero General Public License | ||||
| #    along with this program.  If not, see <http://www.gnu.org/licenses/>. | ||||
| # | ||||
| ############################################################################## | ||||
| from odoo import models | ||||
| 
 | ||||
| 
 | ||||
| class AccountInvoiceLine(models.Model): | ||||
|     _inherit = 'account.invoice.line' | ||||
|  | @ -34,6 +34,6 @@ class Partner(models.Model): | |||
| 
 | ||||
|         for record in self: | ||||
|             if record.commercial_partner_id.retail_partner_id: | ||||
|                 pass | ||||
|                 res.update({'invoice': record.commercial_partner_id.retail_partner_id.id}) | ||||
| 
 | ||||
|         return res | ||||
|  |  | |||
|  | @ -26,7 +26,20 @@ class SaleLayoutCategory(models.Model): | |||
| 
 | ||||
|     order_id = fields.Many2one(comodel_name='sale.order') | ||||
| 
 | ||||
|     @api.model | ||||
|     def name_search(self, name, args=None, operator='ilike', limit=100): | ||||
|         res = super(SaleLayoutCategory, self).name_search(name, args=args, operator=operator, limit=limit) | ||||
| 
 | ||||
| class SaleOrderLine(models.Model): | ||||
|     _inherit = 'sale.order.line' | ||||
| 
 | ||||
|     layout_category_id = fields.Many2one(domain=[('order_id', '=', False)]) | ||||
| 
 | ||||
|     @api.multi | ||||
|     def _prepare_invoice_line(self, qty): | ||||
|         res = super(SaleOrderLine, self)._prepare_invoice_line(qty) | ||||
|         layout_category_id = self.env['sale.layout_category'].search([('order_id', '=', self.order_id.id)]) | ||||
|         if not layout_category_id: | ||||
|             layout_category_id = self.env['sale.layout_category'].create({ | ||||
|                 'order_id': self.order_id.id, | ||||
|                 'name': self.order_id.name | ||||
|             }) | ||||
|             res.update({'layout_category_id': layout_category_id.id}) | ||||
|         return res | ||||
|  |  | |||
|  | @ -1 +0,0 @@ | |||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||||
| 
 | 
|  | @ -1,7 +1,17 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <odoo> | ||||
| 
 | ||||
| 
 | ||||
|     <record id="account_invoice_form_view" model="ir.ui.view"> | ||||
|         <field name="name">account_invoice_form_view</field> | ||||
|         <field name="model">account.invoice</field> | ||||
|         <field name="inherit_id" ref="account.invoice_form"/> | ||||
|         <field name="arch" type="xml"> | ||||
|             <xpath expr="//field[@name='invoice_line_ids']/tree//field[@name='layout_category_id']" | ||||
|                    position="attributes"> | ||||
|                 <attribute name="options">{'no_create': True}</attribute> | ||||
|             </xpath> | ||||
|         </field> | ||||
|     </record> | ||||
| 
 | ||||
| 
 | ||||
| </odoo> | ||||
|  |  | |||
|  | @ -1,6 +1,30 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <odoo> | ||||
| 
 | ||||
|     <record id="sale_layout_category_form_view" model="ir.ui.view"> | ||||
|         <field name="name">sale_layout_category_form_view</field> | ||||
|         <field name="model">sale.layout_category</field> | ||||
|         <field name="inherit_id" ref="sale.report_configuration_form_view"/> | ||||
|         <field name="arch" type="xml"> | ||||
|             <field name="name" position="after"> | ||||
|                 <field name="order_id"/> | ||||
|             </field> | ||||
| 
 | ||||
|         </field> | ||||
|     </record> | ||||
| 
 | ||||
|     <record id="sale_order_form_view" model="ir.ui.view"> | ||||
|         <field name="name">sale_order_form_view</field> | ||||
|         <field name="model">sale.order</field> | ||||
|         <field name="inherit_id" ref="sale.view_order_form"/> | ||||
|         <field name="arch" type="xml"> | ||||
|             <xpath expr="//field[@name='order_line']/form//field[@name='layout_category_id']" position="attributes"> | ||||
|                 <attribute name="options">{'no_create': True}</attribute> | ||||
|             </xpath> | ||||
|             <xpath expr="//field[@name='order_line']/tree//field[@name='layout_category_id']" position="attributes"> | ||||
|                 <attribute name="options">{'no_create': True}</attribute> | ||||
|             </xpath> | ||||
|         </field> | ||||
|     </record> | ||||
| 
 | ||||
| </odoo> | ||||
|  |  | |||
|  | @ -1,15 +1,16 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| class Config(): | ||||
| 
 | ||||
| class Config(object): | ||||
|     def __init__(self): | ||||
|         self.dump_file = 'odoo_backup.dump' | ||||
| 
 | ||||
|         self.module_name = None | ||||
|         self.lang = 'de_DE' # de_DE, en_US | ||||
|         self.lang = 'de_DE'  # de_DE, en_US | ||||
|         self.default_sales_tax = 'Mehrwertsteuer 20%' | ||||
|         self.default_supplier_tax = 'Vorsteuer 20%' | ||||
|         self.price_decimals = 2 # Nachkommastellen Preis | ||||
|         self.uom_decimals = 3 # Nachkommastellen Mengeneinheiten | ||||
|         self.price_decimals = 2  # Nachkommastellen Preis | ||||
|         self.uom_decimals = 3  # Nachkommastellen Mengeneinheiten | ||||
| 
 | ||||
|         self.load_languages = ['en_US'] | ||||
| 
 | ||||
|  | @ -31,9 +32,9 @@ class Config(): | |||
| 
 | ||||
|         # Aktive Steuerzuordnungen | ||||
|         self.valid_fiscal_positions = [ | ||||
|             #'Lieferant EU (ohne Ust-ID)', | ||||
|             #'Lieferant EU Unternehmen (mit USt-ID)', | ||||
|             #'Lieferant Ausland', | ||||
|             # 'Lieferant EU (ohne Ust-ID)', | ||||
|             # 'Lieferant EU Unternehmen (mit USt-ID)', | ||||
|             # 'Lieferant Ausland', | ||||
|             'Kunde Ausland', | ||||
|             'Kunde EU (ohne USt-ID)', | ||||
|             'Kunde EU Unternehmen (mit USt-ID)', | ||||
|  | @ -45,39 +46,39 @@ class Config(): | |||
|             'group_multi_company': True, | ||||
| 
 | ||||
|             # Einstellungen Verkauf | ||||
|             'group_product_variant': False,                 # Produkte können mehrere Attribute haben, die Varianten definieren | ||||
|             'group_uom': True,                             # Verwende Mengeneinheiten | ||||
|             'group_discount_per_so_line': True,            # Rabatt auf Verkaufszeilen | ||||
|             'multi_sales_price': True,                      # Mehrere Verkaufspreise pro Produkt | ||||
|             'group_product_variant': False,  # Produkte können mehrere Attribute haben, die Varianten definieren | ||||
|             'group_uom': True,  # Verwende Mengeneinheiten | ||||
|             'group_discount_per_so_line': True,  # Rabatt auf Verkaufszeilen | ||||
|             'multi_sales_price': True,  # Mehrere Verkaufspreise pro Produkt | ||||
|             'multi_sales_price_method': 'percentage', | ||||
|                                                         # [percentage] Multiple prices per product (e.g. customer segments, currencies) | ||||
|                                                         # [formula] rices computed from formulas (discounts, margins, roundings) | ||||
|             # [percentage] Multiple prices per product (e.g. customer segments, currencies) | ||||
|             # [formula] rices computed from formulas (discounts, margins, roundings) | ||||
|             'module_sale_margin': False, | ||||
|             'use_sale_note': True, | ||||
|             'group_sale_layout': False, | ||||
|             'group_sale_layout': True, | ||||
|             'group_proforma_sales': True, | ||||
|             'group_sale_delivery_address': True,           # Verschiedene Adressen für Rechnung und Lieferung | ||||
|             'group_sale_delivery_address': True,  # Verschiedene Adressen für Rechnung und Lieferung | ||||
|             'group_warning_sale': False, | ||||
|             'auto_done_setting': False, | ||||
|             'module_delivery': True,                        # Für Intrastat benötigt | ||||
|             'module_delivery': True,  # Für Intrastat benötigt | ||||
|             'group_display_incoterm': True, | ||||
|             'module_sale_order_dates': False, | ||||
|             'group_route_so_lines': False, | ||||
| 
 | ||||
|             # Einstellungen Lager | ||||
|             'group_warning_stock': False, | ||||
|             'group_stock_production_lot': True,            # Verfolgen Sie Los- und Seriennummern | ||||
|             'group_stock_production_lot': True,  # Verfolgen Sie Los- und Seriennummern | ||||
|             'default_picking_policy': 'direct', | ||||
|             'group_stock_multi_locations': False, | ||||
|             'group_stock_multi_warehouses': False, | ||||
|             'group_stock_adv_location': False,              # Advanced routing of products using rules | ||||
|             'group_stock_adv_location': False,  # Advanced routing of products using rules | ||||
|             'use_security_lead': False, | ||||
|             'security_lead': 0, | ||||
| 
 | ||||
|             # Einstellungen Finanzen | ||||
|             'tax_calculation_rounding_method': 'round_per_line', | ||||
|             'vat_check_vies': True, | ||||
|             'group_multi_currency': True,                  # Multiwährungsfunktion aktivieren | ||||
|             'group_multi_currency': True,  # Multiwährungsfunktion aktivieren | ||||
|             'module_account_reports_followup': False, | ||||
|             'group_warning_account': False, | ||||
| 
 | ||||
|  | @ -88,8 +89,8 @@ class Config(): | |||
|             'manufacturing_lead': 0, | ||||
|         } | ||||
| 
 | ||||
|         self.removal_strategy = 'fifo'                      #[fifo], [lifo], [fefo] | ||||
|         self.stock_cost_method = 'standard'                 # [standard], [average], [real] | ||||
|         self.removal_strategy = 'fifo'  # [fifo], [lifo], [fefo] | ||||
|         self.stock_cost_method = 'standard'  # [standard], [average], [real] | ||||
| 
 | ||||
|         self.active_uoms = { | ||||
|             'product.product_uom_unit': 'Stk.', | ||||
|  | @ -137,7 +138,7 @@ class Config(): | |||
| 
 | ||||
|         ] | ||||
| 
 | ||||
| # 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')" | ||||
|         self.reports = { | ||||
|             'sale.action_report_saleorder': "((object.state in ('draft','sent') and 'KV_' or 'AB_') + object.name" + timestamp, | ||||
|  | @ -147,27 +148,27 @@ class Config(): | |||
| 
 | ||||
|         self.users_file = 'res.users.csv' | ||||
| 
 | ||||
|         self.translation_files = [ # Reihenfolge! | ||||
|                                  #'auto_translated2.po', | ||||
|                                  'ir.translation.csv', | ||||
|                                  #'auto_translated.po', | ||||
|                                  #'auto_translated3.po', | ||||
|                                   ] | ||||
|         self.translation_files = [  # Reihenfolge! | ||||
|             # 'auto_translated2.po', | ||||
|             'ir.translation.csv', | ||||
|             # 'auto_translated.po', | ||||
|             # 'auto_translated3.po', | ||||
|         ] | ||||
| 
 | ||||
|         self.default_values = [   # ir.values | ||||
|         self.default_values = [  # ir.values | ||||
|             # ('product.template', 'type', 'product'), | ||||
|             #('product.template', 'type', 'service'), | ||||
|             # ('product.template', 'type', 'service'), | ||||
|         ] | ||||
| 
 | ||||
|         self.order_policy = 'order' | ||||
| 
 | ||||
|         self.data_updates = { | ||||
|             #'mrp.route_warehouse0_manufacture': {'name': 'Produzieren'}, | ||||
|             #'purchase.route_warehouse0_buy': {'name': 'Einkaufen'}, | ||||
|             #'stock.route_warehouse0_mto': {'name': 'Beschaffe von Auftrag'}, | ||||
|             # 'mrp.route_warehouse0_manufacture': {'name': 'Produzieren'}, | ||||
|             # 'purchase.route_warehouse0_buy': {'name': 'Einkaufen'}, | ||||
|             # 'stock.route_warehouse0_mto': {'name': 'Beschaffe von Auftrag'}, | ||||
|         } | ||||
| 
 | ||||
|         self.system_parameters = { | ||||
|             'ir_attachment.location': 'file', # [db] oder [file] | ||||
|             'ir_attachment.location': 'file',  # [db] oder [file] | ||||
|             'database.expiration_date': '2038-01-19', | ||||
|         } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue