Dokumentenvorlagen: Angebot/Auftrag und Rechnung Feedback

develop
Ahmed Aly 2018-01-08 10:42:22 +01:00
parent 9fbe0c0f1e
commit 440889d56a
2 changed files with 260 additions and 223 deletions

View File

@ -20,3 +20,22 @@ class SaleOrder(models.AbstractModel):
'field_set_in_lines': self._field_set_in_lines, 'field_set_in_lines': self._field_set_in_lines,
'formatLang': self._formatLang, 'formatLang': self._formatLang,
} }
class SaleOrderProForma(models.AbstractModel):
_name = 'report.sale.report_saleorder_pro_forma'
_inherit = 'report.abstract_report'
_template = 'sale.report_saleorder_pro_forma'
@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

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data>
<!-- Sale Order Body --> <!-- Sale Order Body -->
<template id="report_saleorder_document"> <template id="report_saleorder_document">
<t t-call="web.external_layout"> <t t-call="web.external_layout">
@ -41,7 +40,7 @@
<br/> <br/>
<span t-esc="o.partner_shipping_id.country_id.name"/> <span t-esc="o.partner_shipping_id.country_id.name"/>
</div> </div>
<div class="text-right" style="width:38%;float: left;margin-top: 80px;"> <div class="text-right" style="width:38%;float: left;;">
<div class="row" style="margin-right:0px;" t-if="o.partner_id.ref"> <div class="row" style="margin-right:0px;" t-if="o.partner_id.ref">
<span class="col-xs-6 text-left">Kundennr.:</span> <span class="col-xs-6 text-left">Kundennr.:</span>
<span class="col-xs-6" t-field="o.partner_id.ref"/> <span class="col-xs-6" t-field="o.partner_id.ref"/>
@ -64,12 +63,14 @@
<span class="col-xs-6" t-field="o.earliest_scheduled_date" <span class="col-xs-6" t-field="o.earliest_scheduled_date"
t-options='{"format": "dd.MM.yyyy"}'/> t-options='{"format": "dd.MM.yyyy"}'/>
</div> </div>
<div class="row" style="margin-right:0px;" t-if="o.state in ['draft','sent'] and o.validity_date"> <div class="row" style="margin-right:0px;"
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 text-left">Gültig bis:</span>
<span class="col-xs-6" t-field="o.validity_date" <span class="col-xs-6" t-field="o.validity_date"
t-options='{"format": "dd.MM.yyyy"}'/> t-options='{"format": "dd.MM.yyyy"}'/>
</div> </div>
<div class="row" style="margin-right:0px;" t-if="o.state not in ['draft','sent'] and o.confirmation_date"> <div class="row" style="margin-right:0px;"
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 text-left">Bestelldatum:</span>
<span class="col-xs-6" t-field="o.confirmation_date" <span class="col-xs-6" t-field="o.confirmation_date"
t-options='{"format": "dd.MM.yyyy"}'/> t-options='{"format": "dd.MM.yyyy"}'/>
@ -87,11 +88,11 @@
<span class="col-xs-6" t-field="o.user_id.phone"/> <span class="col-xs-6" t-field="o.user_id.phone"/>
</div> </div>
<div class="row oe_mt16" style="margin-right:0px;"> <div class="row oe_mt16" style="margin-right:0px;">
<span class="col-xs-offset-2 col-xs-4 text-left">Positionen:</span> <span class="col-xs-6 text-left">Positionen:</span>
<span class="col-xs-6" t-field="o.positions"/> <span class="col-xs-6" t-field="o.positions"/>
</div> </div>
<div class="row" style="margin-right:0px;"> <div class="row" style="margin-right:0px;">
<span class="col-xs-offset-2 col-xs-4 text-left">Artikel:</span> <span class="col-xs-6 text-left">Artikel:</span>
<span class="col-xs-6" t-field="o.num_items"/> <span class="col-xs-6" t-field="o.num_items"/>
</div> </div>
</div> </div>
@ -100,8 +101,13 @@
<div class="row oe_mt32"> <div class="row oe_mt32">
<div class="col-xs-12 text-left"> <div class="col-xs-12 text-left">
<h4> <h4>
<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 not in ['draft','sent']">Auftragsbestätigung</span>
<span t-if="o.state in ['draft','sent']">Angebot</span> <span t-if="o.state in ['draft','sent']">Angebot</span>
</t>
<t t-if="env.context.get('proforma', False) or is_pro_forma">
<span>Proformarechnung</span>
</t>
<span t-field="o.quote_name"/> <span t-field="o.quote_name"/>
</h4> </h4>
</div> </div>
@ -133,6 +139,7 @@
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-field="order_line.product_id.weight"/> <span t-field="order_line.product_id.weight"/>
<span t-field="order_line.product_uom"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-field="order_line.price_unit"/> <span t-field="order_line.price_unit"/>
@ -213,6 +220,7 @@
<br/> <br/>
</p> </p>
<p class="col-xs-12" t-if="o.payment_term_id.note"> <p class="col-xs-12" t-if="o.payment_term_id.note">
Zahlungskonditionen:
<span t-esc="o.payment_term_id.note"/> <span t-esc="o.payment_term_id.note"/>
<br/> <br/>
</p> </p>
@ -229,10 +237,20 @@
</t> </t>
</template> </template>
<template id="sale.report_saleorder_pro_forma">
</data> <t t-call="web.html_container">
<t t-set="is_pro_forma" t-value="True"/>
<t t-foreach="docs" t-as="o">
<t t-call="dp_reports_sale.report_saleorder_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
<record id="sale.action_report_saleorder" model="ir.actions.report"> <record id="sale.action_report_saleorder" model="ir.actions.report">
<field name="paperformat_id" ref="dp_reports.paperformat_a4_european"/> <field name="paperformat_id" ref="dp_reports.paperformat_a4_european"/>
</record> </record>
<record id="sale.action_report_pro_forma_invoice" model="ir.actions.report">
<field name="paperformat_id" ref="dp_reports.paperformat_a4_european"/>
</record>
</odoo> </odoo>