Dokumentenvorlagen: Angebot
parent
2162198b85
commit
4def9ef90a
|
|
@ -51,6 +51,7 @@
|
|||
'views/material_type_views.xml',
|
||||
'views/product_views.xml',
|
||||
'views/ir_attachment_views.xml',
|
||||
'views/res_company_views.xml',
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'installable': True,
|
||||
|
|
|
|||
|
|
@ -21,12 +21,14 @@
|
|||
import os
|
||||
import base64
|
||||
|
||||
from odoo import models, api
|
||||
from odoo import models, api, fields
|
||||
|
||||
|
||||
class Company(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
eori_nr = fields.Char(string='EORI-Nr')
|
||||
|
||||
@api.model
|
||||
def set_company_logo(self, company, logo):
|
||||
filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), logo)
|
||||
|
|
|
|||
|
|
@ -42,6 +42,18 @@ class SaleOrder(models.Model):
|
|||
quote_name = fields.Char(compute='_compute_quote_name')
|
||||
internal_notes = fields.Text()
|
||||
assembly_notes = fields.Text()
|
||||
earliest_scheduled_date = fields.Datetime(compute='_compute_earliest_scheduled_date')
|
||||
|
||||
@api.multi
|
||||
def _compute_earliest_scheduled_date(self):
|
||||
for record in self:
|
||||
earliest_scheduled_date = False
|
||||
for picking in record.picking_ids:
|
||||
if not earliest_scheduled_date or earliest_scheduled_date > fields.Datetime.from_string(
|
||||
picking.scheduled_date):
|
||||
earliest_scheduled_date = fields.Datetime.from_string(picking.scheduled_date)
|
||||
if earliest_scheduled_date:
|
||||
record.earliest_scheduled_date = earliest_scheduled_date
|
||||
|
||||
@api.multi
|
||||
def _compute_quote_name(self):
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="res_company_form_view" model="ir.ui.view">
|
||||
<field name="name">res_company_form_view</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_registry" position="after">
|
||||
<field name="eori_nr"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
from odoo import models, fields, api
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class Company(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
external_report_layout = fields.Selection(selection_add=[("custom", "Custom")])
|
||||
external_report_layout = fields.Selection(selection_add=[("custom", "Custom")], default='custom')
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@
|
|||
<template id="external_layout" inherit_id="web.external_layout">
|
||||
<xpath expr="." position="inside">
|
||||
<t t-if="company.external_report_layout == 'custom'">
|
||||
<t t-call="dp_reports.external_layout_custom"><t t-raw="0"/></t>
|
||||
<t t-call="dp_reports.external_layout_custom">
|
||||
<t t-raw="0"/>
|
||||
</t>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
@ -64,6 +66,9 @@
|
|||
<t t-esc="company.partner_id.country_id.name"/>
|
||||
</div>
|
||||
<div class="oe_mt16 col-xs-12" style="padding-right:0px;">
|
||||
<t t-esc="company.partner_id.phone"/>
|
||||
</div>
|
||||
<div class="col-xs-12" style="padding-right:0px;">
|
||||
<t t-esc="company.partner_id.email"/>
|
||||
</div>
|
||||
<div class="col-xs-12" style="padding-right:0px;">
|
||||
|
|
@ -76,28 +81,21 @@
|
|||
</template>
|
||||
|
||||
<template id="external_layout_footer">
|
||||
<div class="footer" style="font-size:10pt;">
|
||||
<div class="footer" style="font-size:9pt;">
|
||||
|
||||
<div style="border-top: 2px solid black;">
|
||||
<div class="col-xs-4">
|
||||
<div class="row" style="padding-left:0;border-top: 2px solid black;">
|
||||
<div class="col-xs-10 text-center">
|
||||
<span t-esc="company.name"/>
|
||||
<br/>
|
||||
<span t-esc="company.vat"/>
|
||||
<br/>
|
||||
<span t-esc="company.company_registry"/>
|
||||
<strong style="font-size:larger;">·</strong>
|
||||
<span t-esc="company.street"/>
|
||||
<strong style="font-size:larger;">·</strong>
|
||||
<span t-esc="company.phone"/>
|
||||
<strong style="font-size:larger;">·</strong>
|
||||
<span t-esc="company.email"/>
|
||||
<strong style="font-size:larger;">·</strong>
|
||||
<span t-esc="company.website"/>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div t-if="company.bank_ids">
|
||||
<span t-esc="company.bank_ids[0].bank_id.name"/>
|
||||
<br/>
|
||||
IBAN:
|
||||
<span t-esc="company.bank_ids[0].acc_number"/>
|
||||
<br/>
|
||||
SWIFT-BIC:
|
||||
<span t-esc="company.bank_ids[0].bank_id.bic"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4 text-right">
|
||||
<div class="col-xs-2 text-right">
|
||||
<ul class="list-inline">
|
||||
<li>Seite:</li>
|
||||
<li>
|
||||
|
|
@ -110,6 +108,26 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
IBAN:
|
||||
<span t-if="company.bank_ids" t-esc="company.bank_ids[0].acc_number"/>
|
||||
<strong style="font-size:larger;">·</strong>
|
||||
BIC:
|
||||
<span t-if="company.bank_ids" t-esc="company.bank_ids[0].bank_id.bic"/>
|
||||
<strong style="font-size:larger;">·</strong>
|
||||
<span t-if="company.bank_ids" t-esc="company.bank_ids[0].bank_id.name"/>
|
||||
<strong style="font-size:larger;">·</strong>
|
||||
UID-Nr.:
|
||||
<span t-esc="company.vat"/>
|
||||
<strong style="font-size:larger;">·</strong>
|
||||
EORI-Nr.:
|
||||
<span t-esc="company.eori_nr"/>
|
||||
<strong style="font-size:larger;">·</strong>
|
||||
Firmenbuch Nr.:
|
||||
<span t-esc="company.company_registry"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@
|
|||
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>
|
||||
<div class="page">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div style="width:31%;padding-left:15px;padding-right:5px;float: left;">
|
||||
Kundendaten
|
||||
<br/>
|
||||
<strong>
|
||||
<span t-esc="o.partner_id.name"/>
|
||||
</strong>
|
||||
|
|
@ -18,49 +20,69 @@
|
|||
<span t-esc="o.partner_id.city"/>
|
||||
<br/>
|
||||
<span t-esc="o.partner_id.country_id.name"/>
|
||||
<br/>
|
||||
Email:
|
||||
<span t-esc="o.partner_id.email"/>
|
||||
<br/>
|
||||
Telefon:
|
||||
<span t-esc="o.partner_id.phone"/>
|
||||
</div>
|
||||
<div style="width:27%;padding-left:5px;padding-right:5px;float: left;">
|
||||
Lieferadresse
|
||||
<br/>
|
||||
<strong>
|
||||
<span t-esc="o.partner_shipping_id.name"/>
|
||||
</strong>
|
||||
<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 class="row">
|
||||
<div class="col-xs-offset-6 col-xs-6 text-right" style="padding-right:0;">
|
||||
<div class="col-xs-12" style="padding-right:2px;" t-if="o.partner_id.ref">
|
||||
<div class="text-right" style="width:42%;padding-right:2px;float: left;margin-top: 80px;">
|
||||
<div t-if="o.partner_id.ref">
|
||||
<span class="col-xs-6 text-left">Kundennr.:</span>
|
||||
<span class="col-xs-6" t-field="o.partner_id.ref"/>
|
||||
</div>
|
||||
<div class="col-xs-12" style="padding-right:2px;" t-if="o.partner_id.vat">
|
||||
<div t-if="o.partner_id.vat">
|
||||
<span class="col-xs-6 text-left">Ihre UID:</span>
|
||||
<span class="col-xs-6" t-field="o.partner_id.vat"/>
|
||||
</div>
|
||||
<div class="col-xs-12" style="padding-right:2px;" t-if="o.client_order_ref">
|
||||
<div t-if="o.client_order_ref">
|
||||
<span class="col-xs-6 text-left">Ihre Referenz:</span>
|
||||
<span class="col-xs-6" t-field="o.client_order_ref"/>
|
||||
</div>
|
||||
<div t-if="o.state in ['draft','sent'] and o.date_order" class="col-xs-12"
|
||||
style="padding-right:2px;">
|
||||
<div t-if="o.state in ['draft','sent'] and o.date_order">
|
||||
<span class="col-xs-6 text-left">Angebotsdatum:</span>
|
||||
<span class="col-xs-6" t-field="o.date_order"
|
||||
t-options='{"format": "dd.MM.yyyy"}'/>
|
||||
</div>
|
||||
<div t-if="o.state in ['draft','sent'] and o.validity_date" class="col-xs-12"
|
||||
style="padding-right:2px;">
|
||||
<div t-if="o.earliest_scheduled_date">
|
||||
<span class="col-xs-6 text-left">Lieferdatum:</span>
|
||||
<span class="col-xs-6" t-field="o.earliest_scheduled_date"
|
||||
t-options='{"format": "dd.MM.yyyy"}'/>
|
||||
</div>
|
||||
<div t-if="o.state in ['draft','sent'] and o.validity_date">
|
||||
<span class="col-xs-6 text-left">Gültig bis:</span>
|
||||
<span class="col-xs-6" t-field="o.validity_date"
|
||||
t-options='{"format": "dd.MM.yyyy"}'/>
|
||||
</div>
|
||||
<div t-if="o.state not in ['draft','sent'] and o.confirmation_date" class="col-xs-12"
|
||||
style="padding-right:2px;">
|
||||
<div t-if="o.state not in ['draft','sent'] and o.confirmation_date">
|
||||
<span class="col-xs-6 text-left">Bestelldatum:</span>
|
||||
<span class="col-xs-6" t-field="o.confirmation_date"
|
||||
t-options='{"format": "dd.MM.yyyy"}'/>
|
||||
</div>
|
||||
<div class="col-xs-12" style="padding-right:2px;" t-if="o.user_id">
|
||||
<div t-if="o.user_id">
|
||||
<span class="col-xs-6 text-left">Ansprechpartner:</span>
|
||||
<span class="col-xs-6" t-field="o.user_id"/>
|
||||
</div>
|
||||
<div class="col-xs-12" style="padding-right:2px;" t-if="o.user_id and o.user_id.email">
|
||||
<div t-if="o.user_id and o.user_id.email">
|
||||
<span class="col-xs-6 text-left">Email:</span>
|
||||
<span class="col-xs-6" t-field="o.user_id.email"/>
|
||||
</div>
|
||||
<div class="col-xs-12" style="padding-right:2px;" t-if="o.user_id and o.user_id.phone">
|
||||
<div t-if="o.user_id and o.user_id.phone">
|
||||
<span class="col-xs-6 text-left">Telefon:</span>
|
||||
<span class="col-xs-6" t-field="o.user_id.phone"/>
|
||||
</div>
|
||||
|
|
@ -94,7 +116,8 @@
|
|||
</thead>
|
||||
<tbody class="sale_tbody">
|
||||
<t t-set="pos_nr" t-value="0"/>
|
||||
<tr t-foreach="o.order_line" t-as="order_line">
|
||||
<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"/>
|
||||
|
|
@ -102,28 +125,39 @@
|
|||
<td class="text-center" t-if="art_number_is_set">
|
||||
<span t-field="order_line.product_id.default_code"/>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
<td rowspan="2" class="text-left">
|
||||
<span t-field="order_line.name"/>
|
||||
<br/>
|
||||
<p>
|
||||
Zolltarif Nr.:
|
||||
<span t-field="order_line.product_id.intrastat_id"/>
|
||||
</p>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td rowspan="2" class="text-center">
|
||||
<span t-field="order_line.product_uom_qty"/>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<td rowspan="2" class="text-right">
|
||||
<span t-field="order_line.price_unit"/>
|
||||
</td>
|
||||
<td class="text-right" t-if="discount_is_set">
|
||||
<td rowspan="2" class="text-right" t-if="discount_is_set">
|
||||
<span t-field="order_line.discount"/>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<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.product_id.image_medium"
|
||||
t-att-src="'data:image/png;base64,%s' % order_line.product_id.image_medium.decode()"/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="oe_mt32 col-xs-4 pull-right">
|
||||
<div class="col-xs-4 pull-right">
|
||||
<table class="table table-condensed">
|
||||
<tr class="border-black">
|
||||
<td>
|
||||
|
|
@ -160,11 +194,15 @@
|
|||
<p class="col-xs-12">
|
||||
<span t-field="o.note"/>
|
||||
</p>
|
||||
<p class="col-xs-12">
|
||||
<t t-if="o.payment_term_id.note">
|
||||
<t t-esc="o.payment_term_id.note"/>
|
||||
<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.name">
|
||||
Zahlungskonditionen:
|
||||
<span t-esc="o.payment_term_id.name"/>
|
||||
<br/>
|
||||
</t>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class ConfigTZA(Config):
|
|||
'vat': 'ATU 54619104',
|
||||
'vat_check_vies': True,
|
||||
'logo': '../ext/custom-addons/dp_custom/static/src/img/logo.png',
|
||||
'eori_nr': 'ATEOSI 0000 11273',
|
||||
#'favicon_backend': '../ext/custom-addons/dp_custom/static/src/img/favicon.ico',
|
||||
#'favicon_backend_mimetype': 'image/x-icon'
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue