draft version of 'Produktionsschein'

develop
Andreas Osim 2018-10-25 16:48:46 +02:00
parent 60fffbd1e5
commit 78746a928b
9 changed files with 356 additions and 2 deletions

View File

@ -45,8 +45,11 @@
</p>
<p t-if="o._name == 'sale.order'">
<t t-if="not (env.context.get('proforma', False) or is_pro_forma)">
<span t-if="o.state not in ['draft','sent']">Auftragsbestätigung</span>
<span t-if="o.state in ['draft','sent']">Angebot</span>
<!--
-->
<span t-if="not data.get('tz_report_production', False) and o.state not in ['draft','sent']">Auftragsbestätigung</span>
<span t-if="not data.get('tz_report_production', False) and o.state in ['draft','sent']">Angebot</span>
<span t-if="data.get('tz_report_production',False)">Produktionsschein</span>
</t>
<t t-if="env.context.get('proforma', False) or is_pro_forma">
<span>Proformarechnung</span>

View File

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

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# noinspection PyStatementEffect
{
'name': 'TZ Report Production',
'category': 'Custom',
'version': '11.0.1.0.0',
'summary': 'Print Report for Production (Description & Pictures)',
'description': 'Print Report for Production (Description & Pictures)',
'author': 'TZAustria',
'website': 'https://www.tzaustria.at',
'support': 'andreas.osim@glaser-co.at',
'depends': [
'base',
'sale',
'dp_reports',
'sale_management',
'sale_comment_template',
'dp_line_comment_template',
],
'data': [
'reports/report_production.xml',
],
'installable': True,
'auto_install': False,
}

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.tz_reports_production.report_production'
_inherit = 'report.abstract_report'
_template = 'tz_reports_production.report_production'
@api.model
def get_report_values(self, docids, data=None):
model = 'sale.order'
docs = self.env[model].browse(docids)
data.update(tz_report_production=True)
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,295 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Sale Order Body -->
<template id="report_production_document">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>
<div class="page">
<div class="row">
<div class="col-xs-3">
<t t-call="dp_reports.partner_data"/>
</div>
<div class="col-xs-3">
<strong>Lieferadresse</strong>
<div class="partner-data">
<span t-esc="o.partner_shipping_id.name"/>
<br/>
<span t-esc="o.partner_shipping_id.street"/>
<br/>
<span t-esc="o.partner_shipping_id.zip"/>
<span t-esc="o.partner_shipping_id.city"/>
<br/>
<span t-esc="o.partner_shipping_id.country_id.name"/>
</div>
</div>
</div>
<div class="row mt32"/>
<div class="row height-20">
<div class="col-xs-3" style="padding-right: 4px">
<strong>
<span class="col-xs-8" style="padding: 0px;width: 58%;">Kundennr.:</span>
</strong>
<span class="col-xs-4" style="padding: 0px;width: 42%;" t-field="o.partner_id.ref"/>
</div>
<strong>
<span class="col-xs-2">Ansprechpartner:</span>
</strong>
<span class="col-xs-3" t-field="o.user_id"/>
<strong>
<span class="col-xs-2">Positionen:</span>
</strong>
<span class="col-xs-2" t-field="o.positions"/>
</div>
<div class="row height-20">
<div class="col-xs-3" style="padding-right: 4px">
<strong>
<span class="col-xs-8" style="padding: 0px;width: 58%;">Angebotsdatum:</span>
</strong>
<span class="col-xs-4" style="padding: 0px;width: 42%;" t-field="o.date_order"
t-options='{"widget": "date"}'/>
</div>
<strong>
<span class="col-xs-2">Email:</span>
</strong>
<span class="col-xs-3" t-field="res_company.email"/>
<p t-if="o.origin">
<strong>
<span class="col-xs-2">Ref:</span>
</strong>
<span class="col-xs-2" t-field="o.origin"/>
</p>
</div>
<div class="row">
<div class="col-xs-3" style="padding-right: 4px">
<strong>
<span class="col-xs-8" style="padding: 0px;width: 58%;">Lieferdatum:</span>
</strong>
<span class="col-xs-4" style="padding: 0px;width: 42%;" t-field="o.earliest_scheduled_date"
t-options='{"widget": "date"}'/>
</div>
<strong>
<span class="col-xs-2">Telefon:</span>
</strong>
<span class="col-xs-3" t-field="o.user_id.phone"/>
<strong>
<span class="col-xs-2">Bezeichnung:</span>
</strong>
<span class="col-xs-2" t-field="o.client_order_ref"/>
</div>
<div class="row mt32"/>
<p t-if="o.note1">
<span t-field="o.note1"/>
</p>
<table class="table table-condensed" style="background-color: #E6E7E9;">
<thead class="table-header">
<tr>
<th class="text-center">Pos.</th>
<th class="text-right"/>
<th class="text-left">Artikel</th>
<!--
<th class="text-right"/>
<th class="text-right">EP</th>
<th class="text-right" t-if="discount_is_set">Rabatt</th>
<th class="text-right">Gesamtpreis</th>
-->
<th class="text-right">Anzahl</th>
<th class="text-right">Gewicht</th>
</tr>
</thead>
<tbody class="sale-tbody">
<t t-set="pos_nr" t-value="0"/>
<t t-foreach="o.order_line" t-as="order_line">
<tr>
<t t-set="pos_nr" t-value="pos_nr+1"/>
<td class="text-center">
<span t-esc="pos_nr"/>
</td>
<td class="text-right"/>
<td rowspan="2" class="text-left">
<t t-if="order_line.product_id.default_code and order_line.product_id.material_type_id.print_default_code">
<strong>
<span t-field="order_line.product_id.default_code"/>
</strong>
<br/>
</t>
<!--
<t t-if="order_line.intrastat_id">
<span>
<strong>Zolltarif Nr.:</strong>
<span t-field="order_line.intrastat_id"/>
</span>
<br/>
</t>
-->
<span t-field="order_line.name"/>
<!--
<t t-if="order_line.delivery_date and (order_line.delivery_date != o.delivery_date)">
<br/>
<strong>Voraussichtliches Lieferdatum:</strong>
<span t-field="order_line.delivery_date"/>
</t>
-->
<p t-if="order_line.lot_id.notes">
<span t-field="order_line.lot_id.notes"/>
</p>
<p t-if="o.note_line">
<span t-field="o.note_line"/>
</p>
</td>
<td class="text-right">
<t t-if="order_line.product_uom_qty">
<span t-esc="o._formatLang(order_line.product_uom_qty, False).strip('0').strip(',').strip('.')"/>
</t>
</td>
<td class="text-right">
<t t-if="order_line.weight">
<span t-field="order_line.weight"/>
kg
</t>
</td>
<!--
<td rowspan="2" class="text-right">
<span t-if="order_line.hide_discount"
t-field="order_line.price_reduce"/>
<span t-if="not order_line.hide_discount"
t-field="order_line.price_unit"/>
</td>
<td rowspan="2" class="text-right" t-if="discount_is_set">
<t t-if="not order_line.hide_discount and order_line.discount">
<span t-esc="o._formatLang(order_line.discount, False).strip('0').strip(',').strip('.')"/>
%
</t>
</td>
<td rowspan="2" class="text-right">
<span t-field="order_line.price_subtotal"/>
</td>
-->
</tr>
<tr>
<td colspan="2" style="border: 0;text-align: center;">
<img t-if="order_line.lot_id.image_medium"
t-att-src="'data:image/png;base64,%s' % order_line.lot_id.image_medium.decode()" style="max-width: 128px;"/>
<img t-if="not order_line.lot_id.image_medium and order_line.product_id.image_medium"
t-att-src="'data:image/png;base64,%s' % order_line.product_id.image_medium.decode()" style="max-width: 128px;"/>
</td>
</tr>
</t>
</tbody>
</table>
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">
<tbody class="totals-tbody">
<!--
<tr>
<td>
Nettobetrag
</td>
<td class="text-right">
<span t-field="o.amount_untaxed"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
<span>USt.</span>
</td>
<td class="text-right">
<span t-field="o.amount_tax"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr class="amount-total">
<td>
<strong>Gesamtsumme</strong>
</td>
<td class="text-right">
<strong>
<span t-field="o.amount_total"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</strong>
</td>
</tr>
-->
</tbody>
</table>
</div>
</div>
<p t-if="o.note2">
<span t-field="o.note2"/>
</p>
<!--
<div class="row">
<p class="col-xs-12">
<span t-field="o.note"/>
</p>
<p class="col-xs-12">
Gesamtgewicht:
<span t-esc="round(o.weight_total, 2)"/>
kg
<br/>
</p>
<p class="col-xs-12" t-if="o.incoterm.name">
Lieferkonditionen:
<span t-esc="o.incoterm.name"/>
<br/>
</p>
<p class="col-xs-12" t-if="o.payment_term_id and not o.partner_invoice_id.is_retailer">
Zahlungskonditionen:
<span t-esc="o.payment_term_id.name"/>
<br/>
</p>
<p class="col-xs-12" t-if="o.state not in ['draft','sent']">
Bitte prüfen Sie bei Anlieferung sofort die Verpackung bzw. Ware auf Beschädigung!
<br/>
Falls die beschädigte Ware angenommen wird, besteht kein Anspruch auf Kostenerstattung bzw.
Austausch.
</p>
<t t-if="o.state in ['draft','sent']">
<p class="col-xs-12">
Gültigkeit: 14 Tage ab Ausstellungsdatum
</p>
<p class="col-xs-12">
Auftrag erteilt am: ____________________
</p>
<p class="col-xs-12">
Unterschrift: ____________________
</p>
</t>
</div>
-->
</div>
</t>
</template>
<template id="tz_reports_production.report_production">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="tz_reports_production.report_production_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
<!--
<record id="tz_reports_production.action_report_production" model="ir.actions.report">
</record>
-->
<report
id="action_report_production"
string="Productionschein"
model="sale.order"
report_type="qweb-pdf"
file="tz_reports_production.report_production"
name="tz_reports_production.report_production"
print_report_name="'Produktionsschein - %s' % (object.name)"
paperformat="dp_reports.paperformat_a4_european"
/>
<!-- print_report_name="(object.state in ('draft', 'sent') and 'Quotation - %s' % (object.name)) or 'Order - %s' % (object.name)" -->
</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

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB