Fall 5041: Anpassungen Rechnungsreport, US01 umgesetzt

develop
Roman Widmann 2018-03-07 14:43:24 +01:00
parent f8c775176a
commit 06c0d8f1a9
3 changed files with 96 additions and 64 deletions

View File

@ -2,3 +2,4 @@
from . import report_helper
from . import account_invoice

View File

@ -0,0 +1,21 @@
# Copyright 2018-Today datenpol gmbh (<http://www.datenpol.at>)
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
from odoo import api, models
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
@api.multi
def order_lines_layouted(self):
res = super(AccountInvoice, self).order_lines_layouted()
uncategorized = False
# Rechnungszeilen ohne Kategorie löschen und an den Anfang stellen
for idx1, page in enumerate(res):
for idx2, category in enumerate(page):
if category.get('name') == 'Uncategorized':
uncategorized = page.pop(idx2)
if uncategorized:
res[idx1] = [uncategorized] + res[idx1]
return res

View File

@ -67,6 +67,7 @@
<span class="col-xs-2" t-field="o.name"/>
</div>
<div class="row mt32"/>
<t t-foreach="o.order_lines_layouted()" t-as="page" name="lines_layouted">
<table class="table table-condensed">
<t t-set="discount_is_set" t-value="field_set_in_lines(o.invoice_line_ids, 'discount')"/>
<thead class="table-header">
@ -84,7 +85,14 @@
<tbody class="invoice-tbody">
<t t-set="pos_nr" t-value="0"/>
<t t-foreach="o.invoice_line_ids" t-as="invoice_line">
<t t-foreach="page" t-as="layout_category">
<tr t-if="layout_category['name'] != 'Uncategorized'">
<td colspan="7">
<strong><t t-esc="layout_category['name']"/></strong>
</td>
</tr>
<t t-foreach="layout_category['lines']" t-as="invoice_line">
<!-- <t t-foreach="o.invoice_line_ids" t-as="invoice_line"> -->
<tr>
<t t-set="pos_nr" t-value="pos_nr+1"/>
<td class="text-center">
@ -132,8 +140,10 @@
</td>
</tr>
</t>
</t>
</tbody>
</table>
</t>
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">