rurotil
Anmeldungsdatum: 7. April 2009
Beiträge: 102
|
Hi, ich möchte das im Container "<div class="row mt-5 mb-2" id="informations">" die Kundennummer anzeigt wird. Leider erscheint Sie nicht. Überall im Formular funktioniert es, nur in diesem einen Container nicht. Warum?
Die Kundennummer soll unter Salesperson genau erscheinen. <t t-name="sale.report_saleorder_document">
<t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>
<t t-set="forced_vat" t-value="doc.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set -->
<t t-set="address">
<div class="address">
<div t-field="doc.partner_id" t-options="{"widget": "contact", "fields": ["address", "name"], "no_marker": True}"/>
</div>
</t>
<p/>
<p/>
<p/>
<p/>
<div style="text-align: right;">
<strong>Kundennummer:</strong>
<span t-field="doc.partner_id.ref">1692</span>
</div>
<div class="page">
<div class="oe_structure"/>
<h2 class="mt-4">
<span t-if="env.context.get('proforma', False) or is_pro_forma">Pro-Forma Invoice # </span>
<span t-elif="doc.state in ['draft','sent']">Quotation # </span>
<span t-else="">Order # </span>
<span t-field="doc.name">SO0000</span>
</h2>
<span>Debug vor Container: </span>
<span t-esc="doc.partner_id.ref"/>
<div class="row mt-5 mb-2" id="informations">
<div t-if="doc.client_order_ref" class="col-auto col-3 mw-100 mb-2" name="informations_reference">
<strong>Your Reference:</strong><br/>
<span class="m-0" t-field="doc.client_order_ref">SO0000</span>
</div>
<div class="IhrContainer">
<span>Debug im Container: </span>
<span t-esc="doc.partner_id.ref"/>
<!-- Ihre bestehenden Container-Elemente -->
</div>
<div t-esc="doc.date_order" class="col-auto col-3 mw-100 mb-2" name="informations_date">
<strong t-if="doc.state in ['draft', 'sent']">Quotation Date:</strong>
<strong t-else="">Order Date:</strong><br/>
<span class="m-0" t-field="doc.date_order" t-options="{"widget": "date"}">2023-12-31</span>
</div>
<div t-esc="doc.validity_date and doc.state in ['draft', 'sent']" class="col-auto col-3 mw-100 mb-2" name="expiration_date">
<strong>Expiration:</strong><br/>
<span class="m-0" t-field="doc.validity_date">2023-12-31</span>
</div>
<div t-esc="doc.user_id.name" class="col-auto col-6 mw-100 mb-2">
<strong>Salesperson:</strong><br/>
<span class="m-0" t-field="doc.user_id">Mitchell Admin</span>
</div>
<div class="col-md-6 mb-2 text-right">
<strong>Kundennummer:</strong><br/>
<span class="m-0" t-field="doc.partner_id.ref">1692</span>
</div>
<div class="col-12 mb-3">
<strong>Kundennummer:</strong><br/>
<span class="m-0" t-field="doc.partner_id.ref">1692</span>
</div>
<div>
<span>Debug doc.partner_id.ref: </span>
<span t-esc="doc.partner_id.ref"/>
</div>
</div>
<div>
<span>Test Kundennummer: </span>
<span t-esc="doc.partner_id.ref"/>
</div>
<!-- Is there a discount on at least one line? -->
<t t-set="lines_to_report" t-value="doc._get_order_lines_to_report()"/>
<t t-set="display_discount" t-value="any(l.discount for l in lines_to_report)"/>
<div class="oe_structure"/>
<table class="table table-sm o_main_table table-borderless mt-4">
<!-- In case we want to repeat the header, remove "display: table-row-group" -->
<thead style="display: table-row-group">
<tr>
<th name="th_description" class="text-start">Description</th>
<th name="th_quantity" class="text-end">Quantity</th>
<th name="th_priceunit" class="text-end">Unit Price</th>
<th name="th_discount" t-if="display_discount" class="text-end">
<span>Disc.%</span>
</th>
<th name="th_taxes" class="text-end">Taxes</th>
<th name="th_subtotal" class="text-end">
<span>Tax excl.</span>
</th>
<th t-if="doc.company_id.tax_calculation_rounding_method == 'round_per_line'" name="th_total" class="text-end">
<span>Tax incl.</span>
</th>
</tr>
</thead>
<tbody class="sale_tbody">
<t t-set="current_subtotal" t-value="0"/>
<t t-foreach="lines_to_report" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"/>
<t t-set="current_total" t-value="current_subtotal + line.price_total" t-if="doc.company_id.tax_calculation_rounding_method == 'round_per_line'"/>
<tr t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''">
<t t-if="not line.display_type">
<td name="td_name"><span t-field="line.name">Bacon Burger</span></td>
<td name="td_quantity" class="text-end">
<span t-field="line.product_uom_qty">3</span>
<span t-field="line.product_uom">units</span>
</td>
<td name="td_priceunit" class="text-end">
<span t-field="line.price_unit">3</span>
</td>
<td t-if="display_discount" class="text-end">
<span t-field="line.discount">-</span>
</td>
<td name="td_taxes" class="text-end">
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))">
Tax 15%
</span>
</td>
<td t-if="not line.is_downpayment" name="td_subtotal" class="text-end o_price_total">
<span t-field="line.price_subtotal">27.00</span>
</td>
<td name="td_total" class="text-end o_price_total" t-if="doc.company_id.tax_calculation_rounding_method == 'round_per_line'">
<span t-field="line.price_total">31.05</span>
</td>
</t>
<t t-elif="line.display_type == 'line_section'">
<td name="td_section_line" colspan="99">
<span t-field="line.name">A section title</span>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
</t>
<t t-elif="line.display_type == 'line_note'">
<td name="td_note_line" colspan="99">
<span t-field="line.name">A note, whose content usually applies to the section or product above.</span>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section') and not line.is_downpayment">
<tr class="is-subtotal text-end">
<td name="td_section_subtotal" colspan="99">
<strong class="mr16">Subtotal</strong>
<span t-out="current_subtotal" t-options="{"widget": "monetary", "display_currency": doc.currency_id}">31.05</span>
</td>
</tr>
</t>
</t>
</tbody>
</table>
<div class="clearfix" name="so_total_summary">
<div id="total" class="row" name="total">
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto">
<table class="table table-sm table-borderless">
<!-- Tax totals -->
<t t-set="tax_totals" t-value="doc.tax_totals"/>
<t t-call="sale.document_tax_totals"/>
</table>
</div>
</div>
</div>
<div class="oe_structure"/>
<div t-if="not doc.signature" class="oe_structure"/>
<div t-else="" class="mt-4 ml64 mr4" name="signature">
<div class="offset-8">
<strong>Signature</strong>
</div>
<div class="offset-8">
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/>
</div>
<div class="offset-8 text-center">
<span t-field="doc.signed_by">Oscar Morgan</span>
</div>
</div>
<div>
<span t-field="doc.note" name="order_note"/>
<p t-if="not is_html_empty(doc.payment_term_id.note)">
<span t-field="doc.payment_term_id.note">The payment should also be transmitted with love</span>
</p>
<p t-if="doc.fiscal_position_id and not is_html_empty(doc.fiscal_position_id.sudo().note)" id="fiscal_position_remark">
<strong>Fiscal Position Remark:</strong>
<span t-field="doc.fiscal_position_id.sudo().note">No further requirements for this payment</span>
</p>
</div>
</div>
</t>
</t>
|
sh4711
Anmeldungsdatum: 13. Februar 2011
Beiträge: 1090
|
Meinst du hier:
<div class="row mt-5 mb-2" id="informations">
<div t-if="doc.client_order_ref" class="col-auto col-3 mw-100 mb-2" name="informations_reference">
<strong>Your Reference:</strong><br/>
<span class="m-0" t-field="doc.client_order_ref">SO0000</span>
</div>
<div class="IhrContainer">
<span>Debug im Container: </span>
<span t-esc="doc.partner_id.ref"/>
<!-- Ihre bestehenden Container-Elemente -->
</div>
|
rurotil
(Themenstarter)
Anmeldungsdatum: 7. April 2009
Beiträge: 102
|
Ja genau. Das war ein Versuch von vielen.
Ich möchte die partner_id anzeigen.Auserhalb vom Container geht es auch.
|
shiro
Anmeldungsdatum: 20. Juli 2020
Beiträge: 1214
|
Ehrlich gesagt, verstehe ich dein Problem nicht, da ja alles so korrekt angezeigt wird, wie du es mit dem xml Konstrukt willst. Schau dir den Schnippel im Browser an, dann siehst du es. Wenn du die Ausgabe der "partner_id" haben willst, musst du natürlich den Wert (1682) auch angeben und dann erst den <span> Block schließen.
Also:
<div>
<span>Test Kundennummer: </span>
<span t-esc="doc.partner_id.ref">1692</span>
</div>
statt
<div>
<span>Test Kundennummer: </span>
<span t-esc="doc.partner_id.ref"/>
</div>
Wenn du die xml Datei durch eine Applikation hast generieren lassen, wird die in der Applikationslogik es wahrscheinlich verbieten, lokale Variablen aus dem Container als globale zu verwenden. Wenn du das ändern willst, musst du deine Applikation ändern.
|
rurotil
(Themenstarter)
Anmeldungsdatum: 7. April 2009
Beiträge: 102
|
Wenn ich das mit dem Code Drucke, entseht diese PDF (Siehe Anhang) Ich hätte die Kundennummer gerne unter dem Verkäufer.Da erscheint Sie aber nicht, obwohl die Kundennummer im Code drin steht. An allen anderen Stellen im Dokument, oben wie unten funktioniert es. Nur nicht rechts in dem Info Fenster.
- Bilder
|
rurotil
(Themenstarter)
Anmeldungsdatum: 7. April 2009
Beiträge: 102
|
So sollte das Angebot "richtig" Aussehen:
- Bilder
|
sh4711
Anmeldungsdatum: 13. Februar 2011
Beiträge: 1090
|
shiro schrieb: Ehrlich gesagt, verstehe ich dein Problem nicht, da ja alles so korrekt angezeigt wird, wie du es mit dem xml Konstrukt willst. Schau dir den Schnippel im Browser an, dann siehst du es. Wenn du die Ausgabe der "partner_id" haben willst, musst du natürlich den Wert (1682) auch angeben und dann erst den <span> Block schließen.
Das war auch meine erste Idee, aber rurotil schrieb: ... Überall im Formular funktioniert es, nur in diesem einen Container nicht. ...
Das heißt alle Debug-Ausgaben der folgenden Form funktionieren:
<span t-esc="doc.partner_id.ref"/>
Das kann man leider beim angehängten Jpeg nicht erkennen. Von daher glaube ich, das der Fehler in <div class="IhrContainer"> zu suchen ist.
Probiere bitte folgendes:
<div>
<span>Debug im Container: </span>
<span t-esc="doc.partner_id.ref"/>
</div>
|
rurotil
(Themenstarter)
Anmeldungsdatum: 7. April 2009
Beiträge: 102
|
Nicht an jeder stelle, aber an einigen. Habe hier nochmals den ganzen Code und habe hier Debug01-Debug06, dann von Kundennummer07-Kundennummer09 und Debug10 im Code markiert. Debug01-Debug04 müsste vor dem Container sein oder?
Debug05, Kundenummer06, 07, 08 09 müsste im Container sein? Im Screenshot habe ich markiert was angzeigt wird. <t t-name="sale.report_saleorder_document">
<div>
<span>Debug01 - ganz oben vor dem Container: </span>
<span t-esc="doc.partner_id.ref"/>
</div>
<t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>
<t t-set="forced_vat" t-value="doc.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set -->
<t t-set="address">
<div class="address">
<div t-field="doc.partner_id" t-options="{"widget": "contact", "fields": ["address", "name"], "no_marker": True}"/>
</div>
</t>
<p/>
<p/>
<p/>
<p/>
<div style="text-align: right;">
<strong>Debug02 vor Container:</strong>
<span t-field="doc.partner_id.ref">1692</span>
</div>
<div class="page">
<div class="oe_structure"/>
<h2 class="mt-4">
<span t-if="env.context.get('proforma', False) or is_pro_forma">Pro-Forma Invoice # </span>
<span t-elif="doc.state in ['draft','sent']">Quotation # </span>
<span t-else="">Order # </span>
<span t-field="doc.name">SO0000</span>
</h2>
<span>Debug03 vor Container: </span>
<span t-esc="doc.partner_id.ref"/>
<div>
<span>Debug04 vor Container: </span>
<span t-esc="doc.partner_id.ref"/>
</div>
<div class="row mt-5 mb-2" id="informations">
<div t-if="doc.client_order_ref" class="col-auto col-3 mw-100 mb-2" name="informations_reference">
<strong>Your Reference:</strong><br/>
<span class="m-0" t-field="doc.client_order_ref">SO0000</span>
</div>
<div class="IhrContainer">
<div>
<span>Debug05 im Container: </span>
<span t-esc="doc.partner_id.ref"/>
</div>
<span>Debug06 im Container: </span>
<span t-esc="doc.partner_id.ref"/>
<!-- Ihre bestehenden Container-Elemente -->
</div>
<div t-esc="doc.date_order" class="col-auto col-3 mw-100 mb-2" name="informations_date">
<strong t-if="doc.state in ['draft', 'sent']">Quotation Date:</strong>
<strong t-else="">Order Date:</strong><br/>
<span class="m-0" t-field="doc.date_order" t-options="{"widget": "date"}">2023-12-31</span>
</div>
<div t-esc="doc.validity_date and doc.state in ['draft', 'sent']" class="col-auto col-3 mw-100 mb-2" name="expiration_date">
<strong>Expiration:</strong><br/>
<span class="m-0" t-field="doc.validity_date">2023-12-31</span>
</div>
<div t-esc="doc.user_id.name" class="col-auto col-6 mw-100 mb-2">
<strong>Salesperson:</strong><br/>
<span class="m-0" t-field="doc.user_id">Mitchell Admin</span>
</div>
<div class="col-md-6 mb-2 text-right">
<strong>Kundennummer07:</strong><br/>
<span class="m-0" t-field="doc.partner_id.ref">1692</span>
</div>
<div class="col-12 mb-3">
<strong>Kundennummer08:</strong><br/>
<span class="m-0" t-field="doc.partner_id.ref">1692</span>
</div>
</div>
<div>
<span>Kundennummer09: </span>
<span t-esc="doc.partner_id.ref"/>
</div>
<!-- Is there a discount on at least one line? -->
<t t-set="lines_to_report" t-value="doc._get_order_lines_to_report()"/>
<t t-set="display_discount" t-value="any(l.discount for l in lines_to_report)"/>
<div class="oe_structure"/>
<table class="table table-sm o_main_table table-borderless mt-4">
<!-- In case we want to repeat the header, remove "display: table-row-group" -->
<thead style="display: table-row-group">
<tr>
<th name="th_description" class="text-start">Description</th>
<th name="th_quantity" class="text-end">Quantity</th>
<th name="th_priceunit" class="text-end">Unit Price</th>
<th name="th_discount" t-if="display_discount" class="text-end">
<span>Disc.%</span>
</th>
<th name="th_taxes" class="text-end">Taxes</th>
<th name="th_subtotal" class="text-end">
<span>Tax excl.</span>
</th>
<th t-if="doc.company_id.tax_calculation_rounding_method == 'round_per_line'" name="th_total" class="text-end">
<span>Tax incl.</span>
</th>
</tr>
</thead>
<tbody class="sale_tbody">
<t t-set="current_subtotal" t-value="0"/>
<t t-foreach="lines_to_report" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"/>
<t t-set="current_total" t-value="current_subtotal + line.price_total" t-if="doc.company_id.tax_calculation_rounding_method == 'round_per_line'"/>
<tr t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''">
<t t-if="not line.display_type">
<td name="td_name"><span t-field="line.name">Bacon Burger</span></td>
<td name="td_quantity" class="text-end">
<span t-field="line.product_uom_qty">3</span>
<span t-field="line.product_uom">units</span>
</td>
<td name="td_priceunit" class="text-end">
<span t-field="line.price_unit">3</span>
</td>
<td t-if="display_discount" class="text-end">
<span t-field="line.discount">-</span>
</td>
<td name="td_taxes" class="text-end">
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))">
Tax 15%
</span>
</td>
<td t-if="not line.is_downpayment" name="td_subtotal" class="text-end o_price_total">
<span t-field="line.price_subtotal">27.00</span>
</td>
<td name="td_total" class="text-end o_price_total" t-if="doc.company_id.tax_calculation_rounding_method == 'round_per_line'">
<span t-field="line.price_total">31.05</span>
</td>
</t>
<t t-elif="line.display_type == 'line_section'">
<td name="td_section_line" colspan="99">
<span t-field="line.name">A section title</span>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
</t>
<t t-elif="line.display_type == 'line_note'">
<td name="td_note_line" colspan="99">
<span t-field="line.name">A note, whose content usually applies to the section or product above.</span>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section') and not line.is_downpayment">
<tr class="is-subtotal text-end">
<td name="td_section_subtotal" colspan="99">
<strong class="mr16">Subtotal</strong>
<span t-out="current_subtotal" t-options="{"widget": "monetary", "display_currency": doc.currency_id}">31.05</span>
</td>
</tr>
</t>
</t>
</tbody>
</table>
<div class="clearfix" name="so_total_summary">
<div id="total" class="row" name="total">
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto">
<table class="table table-sm table-borderless">
<!-- Tax totals -->
<t t-set="tax_totals" t-value="doc.tax_totals"/>
<t t-call="sale.document_tax_totals"/>
</table>
</div>
</div>
</div>
<div class="oe_structure"/>
<div>
<span>Debug10 - ganz unten: </span>
<span t-esc="doc.partner_id.ref"/>
</div>
<div t-if="not doc.signature" class="oe_structure"/>
<div t-else="" class="mt-4 ml64 mr4" name="signature">
<div class="offset-8">
<strong>Signature</strong>
</div>
<div class="offset-8">
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/>
</div>
<div class="offset-8 text-center">
<span t-field="doc.signed_by">Oscar Morgan</span>
</div>
</div>
<div>
<span t-field="doc.note" name="order_note"/>
<p t-if="not is_html_empty(doc.payment_term_id.note)">
<span t-field="doc.payment_term_id.note">The payment should also be transmitted with love</span>
</p>
<p t-if="doc.fiscal_position_id and not is_html_empty(doc.fiscal_position_id.sudo().note)" id="fiscal_position_remark">
<strong>Fiscal Position Remark:</strong>
<span t-field="doc.fiscal_position_id.sudo().note">No further requirements for this payment</span>
</p>
</div>
</div>
</t>
</t>
- Bilder
|
sh4711
Anmeldungsdatum: 13. Februar 2011
Beiträge: 1090
|
rurotil schrieb: ...
Laut JPG gibt es die Debugausgaben:
Debug vor Container1 Debug vor Container
Im Code sind diese nicht zu finden. Bitte senden einen Code der 100% zum JPG passt.
|
rurotil
(Themenstarter)
Anmeldungsdatum: 7. April 2009
Beiträge: 102
|
der Code ist vollständig, hab die 2 Zeilen selbst gesucht und nicht gefunden.....wie kann das sein?
Browser geschlossen und Cache gelöscht habe ich auch schon.....
|
shiro
Anmeldungsdatum: 20. Juli 2020
Beiträge: 1214
|
Das sieht eher nach einem mehrstufigen Prozess aus (Rätsel?). Offenbar wird zuerst die xml Datei erzeugt, die von einem weiteren Prozess (z.B. xslt mit Template?) in das Zielformat umgesetzt wird. Abhängig davon, wie dann das z.B. xslt programmiert und das Template gestaltet ist, bekommst du das von dir festgestellte Verhalten.
|