dp_report_template

develop
Ahmed Aly 2017-11-24 15:57:47 +01:00
parent 43bed61f06
commit f136561230
8 changed files with 314 additions and 1 deletions

View File

@ -23,7 +23,7 @@ values = {
"phone": "+43 564564",
"mobile": "+43 677 564564",
"endkunde": True,
"portal_id": "111111",
"portal_id": "333333",
"company": "Bier AG",
"info_uid": "habe keine",
"info_kundennr": "K1234",

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# noinspection PyStatementEffect
{
'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': [
'dp_reports',
'sale'
],
'data': [
'reports/sale.xml',
],
# only loaded in demonstration mode
'demo': [],
'installable': True,
'auto_install': False,
}

View File

@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * dp_report
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-12 09:17+0000\n"
"PO-Revision-Date: 2016-10-13 11:58+0000\n"
"Last-Translator: datenpol\n"
"Language-Team: German (http://www.transifex.com/odoo/odoo-9/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import report_helper

View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from odoo import api, models
class SaleOrder(models.AbstractModel):
_name = 'report.dp_report_template.report_saleorder'
_inherit = 'report.abstract_report'
_template = 'dp_report_template.report_saleorder'
@api.model
def get_report_values(self, docids, data=None):
model = 'sale.order'
docs = self.env[model].browse(docids)
return {
'doc_ids': docids,
'doc_model': model,
'docs': docs,
'data': data,
'field_set_in_lines': self._field_set_in_lines,
'formatLang': self._formatLang,
}

View File

@ -0,0 +1,242 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_saleorder_document">
<t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
<div class="page">
<div class="oe_structure"/>
<div class="row">
<div class="col-xs-6">
<t t-if="doc.partner_shipping_id == doc.partner_invoice_id
and doc.partner_invoice_id != doc.partner_id
or doc.partner_shipping_id != doc.partner_invoice_id">
<strong t-if="doc.partner_shipping_id == doc.partner_invoice_id">Invoicing and shipping
address:
</strong>
<strong t-if="doc.partner_shipping_id != doc.partner_invoice_id">Invoicing address:</strong>
<div t-field="doc.partner_invoice_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
<div t-if="doc.partner_shipping_id != doc.partner_invoice_id" class="mt8">
<strong>Shipping address:</strong>
<div t-field="doc.partner_shipping_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
</div>
</t>
</div>
<div class="col-xs-5 col-xs-offset-1">
<div t-field="doc.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
<p t-if="doc.partner_id.vat"><t t-esc="doc.company_id.country_id.vat_label or 'TIN'"/>:
<span t-field="doc.partner_id.vat"/>
</p>
</div>
</div>
<h2>
<t t-if="not (env.context.get('proforma', False) or is_pro_forma)">
<span t-if="doc.state not in ['draft','sent']">Order #</span>
<span t-if="doc.state in ['draft','sent']">Quotation #</span>
</t>
<t t-if="env.context.get('proforma', False) or is_pro_forma">
<span>Pro-Forma Invoice #</span>
</t>
<span t-field="doc.name"/>
</h2>
<div class="row mt32 mb32" id="informations">
<div t-if="doc.client_order_ref" class="col-xs-3">
<strong>Your Reference:</strong>
<p t-field="doc.client_order_ref"/>
</div>
<div t-if="doc.confirmation_date and doc.state not in ['draft','sent']" class="col-xs-3">
<strong>Date Ordered:</strong>
<p t-field="doc.confirmation_date"/>
</div>
<div t-if="doc.date_order and doc.state in ['draft','sent']" class="col-xs-3">
<strong>Quotation Date:</strong>
<p t-field="doc.date_order"/>
</div>
<div t-if="doc.user_id.name" class="col-xs-3">
<strong>Salesperson:</strong>
<p t-field="doc.user_id"/>
</div>
<div name="payment_term" t-if="doc.payment_term_id" class="col-xs-3">
<strong>Payment Terms:</strong>
<p t-field="doc.payment_term_id"/>
</div>
</div>
<!-- Is there a discount on at least one line? -->
<t t-set="display_discount" t-value="any([l.discount for l in doc.order_line])"/>
<t t-foreach="doc.order_lines_layouted()" t-as="page">
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">
Disc.(%)
</th>
<th class="text-right">Taxes</th>
<th class="text-right" groups="sale.group_show_price_subtotal">Amount</th>
<th class="text-right price_tax_included" groups="sale.group_show_price_total">Total
Price
</th>
</tr>
</thead>
<tbody class="sale_tbody">
<t t-foreach="page" t-as="layout_category">
<t t-if="layout_category_size > 1 or page_size > 1" groups="sale.group_sale_layout">
<tr class="active">
<td colspan="7" style="font-weight: bold; border-bottom: 1px solid black;">&amp;bull;
<t t-esc="layout_category['name']"/>
</td>
</tr>
</t>
<!-- Lines associated -->
<t t-foreach="layout_category['lines']" t-as="l">
<tr>
<td>
<span t-field="l.name"/>
</td>
<td class="text-right">
<span t-field="l.product_uom_qty"/>
<span t-field="l.product_uom" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td t-if="display_discount" class="text-right"
groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.tax_id))"/>
</td>
<td class="text-right" groups="sale.group_show_price_subtotal">
<span t-field="l.price_subtotal"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
</td>
<td class="text-right" groups="sale.group_show_price_total">
<span t-field="l.price_total"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
</td>
</tr>
</t>
<t t-if="(layout_category_size > 1 or page_size > 1) and layout_category['subtotal']"
groups="sale.group_sale_layout">
<tr class="text-right">
<td colspan="6">
<strong>Subtotal:</strong>
<t t-set="subtotal"
t-value="sum(line.price_subtotal for line in layout_category['lines'])"/>
<span t-esc="subtotal"
t-options="{'widget': 'monetary', 'display_currency': doc.pricelist_id.currency_id}"/>
</td>
</tr>
</t>
</t>
</tbody>
</table>
<t t-if="page_index &lt; page_size - 1" groups="sale.group_sale_layout">
<p style="page-break-before:always;"></p>
</t>
</t>
<div class="clearfix">
<div class="row pull-right" name="total">
<div>
<table class="table-condensed" style="min-width: 200px;max-width: 350px;">
<tr class="border-black" style="border-bottom:1px solid #dddddd;">
<td>
<strong>Subtotal</strong>
</td>
<td class="text-right">
<span t-field="doc.amount_untaxed"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
</td>
</tr>
<t t-set="tax_groups_length" t-value="len(doc._get_tax_amount_by_group())"/>
<t t-foreach="doc._get_tax_amount_by_group()" t-as="amount_by_group">
<tr style="border-bottom:1px solid #dddddd;">
<t t-if="amount_by_group[3] == 1 and doc.amount_untaxed == amount_by_group[2]">
<td>
<span t-esc="amount_by_group[0]"/>
</td>
<td class="text-right">
<span t-esc="amount_by_group[1]"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
</td>
</t>
<t t-else="">
<td>
<span t-esc="amount_by_group[0]"/>
<span>&amp;nbsp;<span>on</span>&amp;nbsp;
<t t-esc="amount_by_group[2]"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
</span>
</td>
<td class="text-right">
<span t-esc="amount_by_group[1]"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
</td>
</t>
</tr>
</t>
<tr class="border-black">
<td>
<strong>Total</strong>
</td>
<td class="text-right">
<span t-field="doc.amount_total"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
</td>
</tr>
</table>
</div>
</div>
</div>
<p t-field="doc.note"/>
<p t-if="doc.payment_term_id.note">
<span t-field="doc.payment_term_id.note"/>
</p>
<p id="fiscal_position_remark" t-if="doc.fiscal_position_id and doc.fiscal_position_id.note">
<strong>Fiscal Position Remark:</strong>
<span t-field="doc.fiscal_position_id.note"/>
</p>
<div class="oe_structure"/>
</div>
</t>
</template>
<template id="report_saleorder">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="dp_report_template.report_saleorder_document" t-lang="doc.partner_id.lang"/>
</t>
</t>
</template>
<report
id="action_report_saleorder"
string="neu sale order"
model="sale.order"
report_type="qweb-pdf"
file="dp_report_template.report_saleorder"
name="dp_report_template.report_saleorder"
print_report_name="(object.state in ('draft', 'sent') and 'Quotation - %s' % (object.name)) or 'Order - %s' % (object.name)"
/>
<record id="dp_report_template.action_report_saleorder" model="ir.actions.report">
<field name="paperformat_id" ref="dp_reports.paperformat_a4_european"/>
</record>
</odoo>

View File

@ -0,0 +1 @@
"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