Fall 4434: Sammelrechnung

develop
Ahmed Aly 2017-12-11 10:56:09 +01:00
parent 3f644e084e
commit db656cbaa2
9 changed files with 87 additions and 67 deletions

View File

@ -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,

View File

@ -20,5 +20,4 @@
##############################################################################
from . import sale
from . import account
from . import res_partner

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -1 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink

View File

@ -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>

View File

@ -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>

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
class Config():
class Config(object):
def __init__(self):
self.dump_file = 'odoo_backup.dump'
@ -54,7 +55,7 @@ class Config():
# [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_warning_sale': False,