Fall 4434: Sammelrechnung
							parent
							
								
									3f644e084e
								
							
						
					
					
						commit
						db656cbaa2
					
				|  | @ -35,7 +35,6 @@ | ||||||
|         'views/res_partner_views.xml', |         'views/res_partner_views.xml', | ||||||
|         'views/sale_views.xml', |         'views/sale_views.xml', | ||||||
|         'views/account_views.xml', |         'views/account_views.xml', | ||||||
|         'security/ir.model.access.csv', |  | ||||||
|     ], |     ], | ||||||
|     'installable': True, |     'installable': True, | ||||||
|     'auto_install': False, |     'auto_install': False, | ||||||
|  |  | ||||||
|  | @ -20,5 +20,4 @@ | ||||||
| ############################################################################## | ############################################################################## | ||||||
| 
 | 
 | ||||||
| from . import sale | from . import sale | ||||||
| from . import account |  | ||||||
| from . import res_partner | 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: |         for record in self: | ||||||
|             if record.commercial_partner_id.retail_partner_id: |             if record.commercial_partner_id.retail_partner_id: | ||||||
|                 pass |                 res.update({'invoice': record.commercial_partner_id.retail_partner_id.id}) | ||||||
| 
 | 
 | ||||||
|         return res |         return res | ||||||
|  |  | ||||||
|  | @ -26,7 +26,20 @@ class SaleLayoutCategory(models.Model): | ||||||
| 
 | 
 | ||||||
|     order_id = fields.Many2one(comodel_name='sale.order') |     order_id = fields.Many2one(comodel_name='sale.order') | ||||||
| 
 | 
 | ||||||
|     @api.model | 
 | ||||||
|     def name_search(self, name, args=None, operator='ilike', limit=100): | class SaleOrderLine(models.Model): | ||||||
|         res = super(SaleLayoutCategory, self).name_search(name, args=args, operator=operator, limit=limit) |     _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 |         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"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <odoo> | <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> | </odoo> | ||||||
|  |  | ||||||
|  | @ -1,6 +1,30 @@ | ||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <odoo> | <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> | </odoo> | ||||||
|  |  | ||||||
|  | @ -1,6 +1,7 @@ | ||||||
| # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||||
| 
 | 
 | ||||||
| class Config(): | 
 | ||||||
|  | class Config(object): | ||||||
|     def __init__(self): |     def __init__(self): | ||||||
|         self.dump_file = 'odoo_backup.dump' |         self.dump_file = 'odoo_backup.dump' | ||||||
| 
 | 
 | ||||||
|  | @ -31,9 +32,9 @@ class Config(): | ||||||
| 
 | 
 | ||||||
|         # Aktive Steuerzuordnungen |         # Aktive Steuerzuordnungen | ||||||
|         self.valid_fiscal_positions = [ |         self.valid_fiscal_positions = [ | ||||||
|             #'Lieferant EU (ohne Ust-ID)', |             # 'Lieferant EU (ohne Ust-ID)', | ||||||
|             #'Lieferant EU Unternehmen (mit USt-ID)', |             # 'Lieferant EU Unternehmen (mit USt-ID)', | ||||||
|             #'Lieferant Ausland', |             # 'Lieferant Ausland', | ||||||
|             '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)', | ||||||
|  | @ -54,7 +55,7 @@ class Config(): | ||||||
|             # [formula] rices computed from formulas (discounts, margins, roundings) |             # [formula] rices computed from formulas (discounts, margins, roundings) | ||||||
|             'module_sale_margin': False, |             'module_sale_margin': False, | ||||||
|             'use_sale_note': True, |             'use_sale_note': True, | ||||||
|             'group_sale_layout': False, |             'group_sale_layout': True, | ||||||
|             'group_proforma_sales': 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, |             'group_warning_sale': False, | ||||||
|  | @ -88,7 +89,7 @@ class Config(): | ||||||
|             'manufacturing_lead': 0, |             'manufacturing_lead': 0, | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         self.removal_strategy = 'fifo'                      #[fifo], [lifo], [fefo] |         self.removal_strategy = 'fifo'  # [fifo], [lifo], [fefo] | ||||||
|         self.stock_cost_method = 'standard'  # [standard], [average], [real] |         self.stock_cost_method = 'standard'  # [standard], [average], [real] | ||||||
| 
 | 
 | ||||||
|         self.active_uoms = { |         self.active_uoms = { | ||||||
|  | @ -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')" |         timestamp = " + '_' +  time.strftime('%Y-%m-%d-%H%M') + '.pdf')" | ||||||
|         self.reports = { |         self.reports = { | ||||||
|             'sale.action_report_saleorder': "((object.state in ('draft','sent') and 'KV_' or 'AB_') + object.name" + timestamp, |             'sale.action_report_saleorder': "((object.state in ('draft','sent') and 'KV_' or 'AB_') + object.name" + timestamp, | ||||||
|  | @ -148,23 +149,23 @@ class Config(): | ||||||
|         self.users_file = 'res.users.csv' |         self.users_file = 'res.users.csv' | ||||||
| 
 | 
 | ||||||
|         self.translation_files = [  # Reihenfolge! |         self.translation_files = [  # Reihenfolge! | ||||||
|                                  #'auto_translated2.po', |             # 'auto_translated2.po', | ||||||
|             'ir.translation.csv', |             'ir.translation.csv', | ||||||
|                                  #'auto_translated.po', |             # 'auto_translated.po', | ||||||
|                                  #'auto_translated3.po', |             # 'auto_translated3.po', | ||||||
|         ] |         ] | ||||||
| 
 | 
 | ||||||
|         self.default_values = [  # ir.values |         self.default_values = [  # ir.values | ||||||
|             # ('product.template', 'type', 'product'), |             # ('product.template', 'type', 'product'), | ||||||
|             #('product.template', 'type', 'service'), |             # ('product.template', 'type', 'service'), | ||||||
|         ] |         ] | ||||||
| 
 | 
 | ||||||
|         self.order_policy = 'order' |         self.order_policy = 'order' | ||||||
| 
 | 
 | ||||||
|         self.data_updates = { |         self.data_updates = { | ||||||
|             #'mrp.route_warehouse0_manufacture': {'name': 'Produzieren'}, |             # 'mrp.route_warehouse0_manufacture': {'name': 'Produzieren'}, | ||||||
|             #'purchase.route_warehouse0_buy': {'name': 'Einkaufen'}, |             # 'purchase.route_warehouse0_buy': {'name': 'Einkaufen'}, | ||||||
|             #'stock.route_warehouse0_mto': {'name': 'Beschaffe von Auftrag'}, |             # 'stock.route_warehouse0_mto': {'name': 'Beschaffe von Auftrag'}, | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         self.system_parameters = { |         self.system_parameters = { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue