[FW][IMP] web,account,stock,sale & others: adapt report layouts to new report editor
General guidelines for adaptations: - include 'demo data' inside the report (e.g. `<span t-field='o.name'>INV/2023/001</span>`) - include div.oe_structure elements in several places - these elements take no space in the printed report if empty, but allow users to 'hook in' several places of the reports - modify the base report layout to include several placeholder blocks (for company address, etc.) that make it clear what goes where (since demo data are a bit unclear for bigger blocks, like address blocks) - add branching or re-order some t-if/t-else conditional blocks. The report shows the first `t-if` content by default, so it makes sense to have it be 'the default value' (e.g. instead of showing the options table all the time in the editor for a quote report, only show is as a t-else) - the goal is to have the report editor open on a report that looks as much as possible as the default, vanilla version of the report - whenever possible, try to avoid `<t>` nodes insise `table/thead/tbody/tr` nodes, as this is not allowed by the hml spec and browser parser will not agree with those. Since the problem is known, the report editor will convert such tables to div elements (and preserve the layout as much as possible) - but making sure the table is 'correct html' (e.g. by moving qweb directives on legal nodes, like tr or td) will preserve the layout and will also allow users to use the table modification tool of the Odd Editor This is a first pass on 'important' reports. A second pass will come before v17. closes odoo/odoo#129492 Forward-port-of: odoo/odoo#129310 Related: odoo/enterprise#44526 Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
This commit is contained in:
@@ -51,7 +51,8 @@
|
||||
<div class="mt-5 clearfix">
|
||||
<div class="page mb-4">
|
||||
<h2>
|
||||
<span t-if="proforma">PROFORMA</span>
|
||||
<span t-if="not proforma"></span>
|
||||
<span t-else="">PROFORMA</span>
|
||||
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">Invoice</span>
|
||||
<span t-elif="o.move_type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
|
||||
<span t-elif="o.move_type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>
|
||||
@@ -60,48 +61,49 @@
|
||||
<span t-elif="o.move_type == 'out_refund' and o.state == 'cancel'">Cancelled Credit Note</span>
|
||||
<span t-elif="o.move_type == 'in_refund'">Vendor Credit Note</span>
|
||||
<span t-elif="o.move_type == 'in_invoice'">Vendor Bill</span>
|
||||
<span t-if="o.name != '/'" t-field="o.name"/>
|
||||
<span t-if="o.name != '/'" t-field="o.name">INV/2023/0001</span>
|
||||
</h2>
|
||||
<div id="informations" class="row mt-3 mb-2">
|
||||
<div class="oe_structure"></div>
|
||||
<div id="informations" class="row mt-3 mb-1">
|
||||
<div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.invoice_date" name="invoice_date">
|
||||
<t t-if="o.move_type == 'out_invoice'"><strong>Invoice Date:</strong></t>
|
||||
<t t-elif="o.move_type == 'out_refund'"><strong>Credit Note Date:</strong></t>
|
||||
<t t-elif="o.move_type == 'out_receipt'"><strong>Receipt Date:</strong></t>
|
||||
<t t-else=""><strong>Date:</strong></t>
|
||||
<p class="m-0" t-field="o.invoice_date"/>
|
||||
<t t-else=""><strong>Date:</strong></t><br/>
|
||||
<span t-field="o.invoice_date">2023-09-12</span>
|
||||
</div>
|
||||
<div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'" name="due_date">
|
||||
<strong>Due Date:</strong>
|
||||
<p class="m-0" t-field="o.invoice_date_due"/>
|
||||
<strong>Due Date:</strong><br/>
|
||||
<span t-field="o.invoice_date_due">2023-10-31</span>
|
||||
</div>
|
||||
<div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.delivery_date" name="delivery_date">
|
||||
<strong>Delivery Date:</strong>
|
||||
<p class="m-0" t-field="o.delivery_date"/>
|
||||
<strong>Delivery Date:</strong><br/>
|
||||
<span t-field="o.delivery_date">2023-09-25</span>
|
||||
</div>
|
||||
<div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.invoice_origin" name="origin">
|
||||
<strong>Source:</strong>
|
||||
<p class="m-0" t-field="o.invoice_origin"/>
|
||||
<strong>Source:</strong><br/>
|
||||
<span t-field="o.invoice_origin">SO123</span>
|
||||
</div>
|
||||
<div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.partner_id.ref" name="customer_code">
|
||||
<strong>Customer Code:</strong>
|
||||
<p class="m-0" t-field="o.partner_id.ref"/>
|
||||
<strong>Customer Code:</strong><br/>
|
||||
<span t-field="o.partner_id.ref"/>
|
||||
</div>
|
||||
<div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.ref" name="reference">
|
||||
<strong>Reference:</strong>
|
||||
<p class="m-0" t-field="o.ref"/>
|
||||
<strong>Reference:</strong><br/>
|
||||
<span t-field="o.ref">INV/2023/00001</span>
|
||||
</div>
|
||||
<div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.invoice_incoterm_id" name="incoterm_id">
|
||||
<strong>Incoterm:</strong>
|
||||
<strong>Incoterm:</strong><br/>
|
||||
<p t-if="o.incoterm_location">
|
||||
<span t-field="o.invoice_incoterm_id.code"/> <br/>
|
||||
<span t-field="o.incoterm_location"/>
|
||||
</p>
|
||||
<p t-else="" t-field="o.invoice_incoterm_id.code" class="m-0"/>
|
||||
<span t-else="" t-field="o.invoice_incoterm_id.code" class="m-0"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<t t-set="display_discount" t-value="any(l.discount for l in o.invoice_line_ids)"/>
|
||||
|
||||
<div class="oe_structure"></div>
|
||||
<table class="table table-sm o_main_table table-borderless" name="invoice_line_table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -131,37 +133,37 @@
|
||||
|
||||
<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="line.display_type == 'product'" name="account_invoice_line_accountable">
|
||||
<td name="account_invoice_line_name"><span t-field="line.name" t-options="{'widget': 'text'}"/></td>
|
||||
<td name="account_invoice_line_name"><span t-field="line.name" t-options="{'widget': 'text'}">Bacon Burger</span></td>
|
||||
<td name="td_quantity" class="text-end">
|
||||
<span t-field="line.quantity"/>
|
||||
<span t-field="line.product_uom_id" groups="uom.group_uom"/>
|
||||
<span t-field="line.quantity">3.00</span>
|
||||
<span t-field="line.product_uom_id" groups="uom.group_uom">units</span>
|
||||
</td>
|
||||
<td name="td_price_unit" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
|
||||
<span class="text-nowrap" t-field="line.price_unit"/>
|
||||
<span class="text-nowrap" t-field="line.price_unit">9.00</span>
|
||||
</td>
|
||||
<td name="td_discount" t-if="display_discount" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
|
||||
<span class="text-nowrap" t-field="line.discount"/>
|
||||
<span class="text-nowrap" t-field="line.discount">0</span>
|
||||
</td>
|
||||
<td name="td_taxes" t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
|
||||
<span t-out="', '.join(map(lambda x: (x.invoice_label or x.name), line.tax_ids))" id="line_tax_ids"/>
|
||||
<span t-out="', '.join(map(lambda x: (x.invoice_label or x.name), line.tax_ids))" id="line_tax_ids">Tax 15%</span>
|
||||
</td>
|
||||
<td name="td_subtotal" class="text-end o_price_total">
|
||||
<span class="text-nowrap" t-field="line.price_subtotal"/>
|
||||
<span class="text-nowrap" t-field="line.price_subtotal">27.00</span>
|
||||
</td>
|
||||
<td t-if="o.tax_calculation_rounding_method == 'round_per_line'" name="td_total" class="text-end o_price_total">
|
||||
<span class="text-nowrap" t-field="line.price_total"/>
|
||||
<span class="text-nowrap" t-field="line.price_total">31.05</span>
|
||||
</td>
|
||||
</t>
|
||||
<t t-if="line.display_type == 'line_section'">
|
||||
<t t-elif="line.display_type == 'line_section'">
|
||||
<td colspan="99">
|
||||
<span t-field="line.name" t-options="{'widget': 'text'}"/>
|
||||
<span t-field="line.name" t-options="{'widget': 'text'}">A section title</span>
|
||||
</td>
|
||||
<t t-set="current_section" t-value="line"/>
|
||||
<t t-set="current_subtotal" t-value="0"/>
|
||||
</t>
|
||||
<t t-if="line.display_type == 'line_note'">
|
||||
<t t-elif="line.display_type == 'line_note'">
|
||||
<td colspan="99">
|
||||
<span t-field="line.name" t-options="{'widget': 'text'}"/>
|
||||
<span t-field="line.name" t-options="{'widget': 'text'}">A note, whose content usually applies to the section or product above.</span>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
@@ -173,7 +175,7 @@
|
||||
<span
|
||||
t-out="current_subtotal"
|
||||
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
|
||||
/>
|
||||
>31.05</span>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
@@ -182,7 +184,7 @@
|
||||
</table>
|
||||
<div>
|
||||
<div id="right-elements" t-attf-class="#{'col-5' if report_type != 'html' else 'col-12 col-md-5'} ms-5 d-inline-block float-end">
|
||||
<div id="total" class="clearfix row mb-2">
|
||||
<div id="total" class="clearfix row">
|
||||
<div class="ms-auto">
|
||||
<table class="table table-sm table-borderless avoid-page-break-inside">
|
||||
|
||||
@@ -197,10 +199,10 @@
|
||||
<t t-foreach="payments_vals" t-as="payment_vals">
|
||||
<tr t-if="payment_vals['is_exchange'] == 0">
|
||||
<td>
|
||||
<i class="oe_form_field text-end oe_payment_label">Paid on <t t-out="payment_vals['date']" t-options='{"widget": "date"}'/></i>
|
||||
<i class="oe_form_field text-end oe_payment_label">Paid on <t t-out="payment_vals['date']" t-options='{"widget": "date"}'>2021-09-19</t></i>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-out="payment_vals['amount']" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
|
||||
<span t-out="payment_vals['amount']" t-options='{"widget": "monetary", "display_currency": o.currency_id}'>20.00</span>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
@@ -208,7 +210,7 @@
|
||||
<tr class="border-black">
|
||||
<td><strong>Amount Due</strong></td>
|
||||
<td class="text-end">
|
||||
<span t-field="o.amount_residual"/>
|
||||
<span t-field="o.amount_residual">11.05</span>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
@@ -220,12 +222,12 @@
|
||||
<div class="mb-2">
|
||||
<p class="text-end lh-sm" t-if="o.company_id.display_invoice_amount_total_words">
|
||||
Total amount in words: <br/>
|
||||
<small class="text-muted lh-sm"><span t-field="o.amount_total_words"/></small>
|
||||
<small class="text-muted lh-sm"><span t-field="o.amount_total_words">Thirty one dollar and Five cents</span></small>
|
||||
</p>
|
||||
</div>
|
||||
<t t-call="account.document_tax_totals_company_currency_template"/>
|
||||
</div>
|
||||
<div id="payment_term" class="clearfix">
|
||||
<div id="payment_term" t-attf-class="#{'col-7' if report_type != 'html' else '' } clearfix" class="clearfix col-5">
|
||||
<div class="justify-text">
|
||||
<p t-if="not is_html_empty(o.fiscal_position_id.note)" name="note" class="mb-2">
|
||||
<span t-field="o.fiscal_position_id.note"/>
|
||||
@@ -233,23 +235,23 @@
|
||||
</div>
|
||||
<t t-set="payment_term_details" t-value="o.payment_term_details"/>
|
||||
<div class="mb-3">
|
||||
<div id="payment_terms_note_id" t-field="o.invoice_payment_term_id.note" name="payment_term"/>
|
||||
<span id="payment_terms_note_id" t-field="o.invoice_payment_term_id.note" name="payment_term">Payment within 30 calendar days</span><br/>
|
||||
<t t-if="o.invoice_payment_term_id.display_on_invoice and payment_term_details">
|
||||
<div t-if='o.show_payment_term_details' id="total_payment_term_details_table" class="row">
|
||||
<div t-attf-class="#{'col-10' if report_type != 'html' else 'col-sm-10 col-md-9'}">
|
||||
<t t-if="o._is_eligible_for_early_payment_discount(o.currency_id,o.invoice_date)">
|
||||
<td>
|
||||
<span t-options='{"widget": "monetary", "display_currency": o.currency_id}'
|
||||
t-out="o.invoice_payment_term_id._get_amount_due_after_discount(o.amount_total, o.amount_tax)"/> due if paid before
|
||||
<span t-out="o.invoice_payment_term_id._get_last_discount_date_formatted(o.invoice_date)"/>
|
||||
t-out="o.invoice_payment_term_id._get_amount_due_after_discount(o.amount_total, o.amount_tax)">30.00</span> due if paid before
|
||||
<span t-out="o.invoice_payment_term_id._get_last_discount_date_formatted(o.invoice_date)">2024-01-01</span>
|
||||
</td>
|
||||
</t>
|
||||
<t t-elif="len(payment_term_details) > 1" t-foreach="payment_term_details" t-as="term">
|
||||
<t t-if="len(payment_term_details) > 1" t-foreach="payment_term_details" t-as="term">
|
||||
<div>
|
||||
<span t-out="term_index + 1"/> - Installment of
|
||||
<t t-options='{"widget": "monetary", "display_currency": o.currency_id}' t-out="term.get('amount')" class="text-end"/>
|
||||
<span t-out="term_index + 1">1</span> - Installment of
|
||||
<t t-options='{"widget": "monetary", "display_currency": o.currency_id}' t-out="term.get('amount')" class="text-end">31.05</t>
|
||||
<span> due on </span>
|
||||
<t t-out="term.get('date')" class="text-start"/>
|
||||
<t t-out="term.get('date')" class="text-start">2024-01-01</t>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
@@ -258,10 +260,12 @@
|
||||
</div>
|
||||
<div class="mb-3" t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference">
|
||||
<p name="payment_communication">
|
||||
Payment Communication: <span class="fw-bold" t-field="o.payment_reference"/>
|
||||
Payment Communication: <span class="fw-bold" t-field="o.payment_reference">INV/2023/00001</span>
|
||||
</p>
|
||||
</div>
|
||||
<div id="qrcode" class="d-flex mb-3 avoid-page-break-inside" t-if="o.display_qr_code and o.amount_residual > 0">
|
||||
<t t-set="show_qr" t-value="o.display_qr_code and o.amount_residual > 0"/>
|
||||
<div t-if="not show_qr" name="qr_code_placeholder" class="oe_structure"></div>
|
||||
<div id="qrcode" class="d-flex mb-3 avoid-page-break-inside" t-else="">
|
||||
<div class="qrcode me-3" id="qrcode_image">
|
||||
<t t-set="qr_code_url" t-value="o._generate_qr_code(silent_errors=True)"/>
|
||||
<p t-if="qr_code_url" class="position-relative mb-0">
|
||||
@@ -303,7 +307,7 @@
|
||||
<span
|
||||
t-att-class="oe_subtotal_footer_separator"
|
||||
t-out="subtotal['formatted_amount']"
|
||||
>9</span>
|
||||
>27.00</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -314,7 +318,7 @@
|
||||
<tr t-if="'formatted_rounding_amount' in tax_totals and tax_totals['rounding_amount'] != 0">
|
||||
<td>Rounding</td>
|
||||
<td class="text-end">
|
||||
<span t-out="tax_totals['formatted_rounding_amount']">9 Eur</span>
|
||||
<span t-out="tax_totals['formatted_rounding_amount']">0</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -322,7 +326,7 @@
|
||||
<tr class="border-black o_total">
|
||||
<td><strong>Total</strong></td>
|
||||
<td class="text-end">
|
||||
<span t-out="tax_totals['formatted_amount_total']">10.4 Eur</span>
|
||||
<span t-out="tax_totals['formatted_amount_total']">31.05</span>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
@@ -339,22 +343,22 @@
|
||||
- subtotal_to_show: The subtotal we need to render the groups from
|
||||
-->
|
||||
<t t-foreach="tax_totals['groups_by_subtotal'][subtotal_to_show]" t-as="amount_by_group">
|
||||
<t t-set="display_tax_base" t-value="tax_totals['display_tax_base']"/>
|
||||
<tr>
|
||||
<t t-if="tax_totals['display_tax_base']">
|
||||
<td>
|
||||
<span t-out="amount_by_group['tax_group_name']">VAT 21%</span>
|
||||
<span class="text-nowrap"> on
|
||||
<t t-out="amount_by_group['formatted_tax_group_base_amount']">9 Eur</t>
|
||||
</span>
|
||||
</td>
|
||||
<t t-if="not display_tax_base">
|
||||
<td><span class="text-nowrap" t-out="amount_by_group['tax_group_name']">Tax 15%</span></td>
|
||||
<td class="text-end o_price_total">
|
||||
<span class="text-nowrap" t-out="amount_by_group['formatted_tax_group_amount']">1.4 Eur</span>
|
||||
<span class="text-nowrap" t-out="amount_by_group['formatted_tax_group_amount']">1.05</span>
|
||||
</td>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<td><span class="text-nowrap" t-out="amount_by_group['tax_group_name']">VAT 21%</span></td>
|
||||
<td>
|
||||
<span t-out="amount_by_group['tax_group_name']">Tax 15%</span>
|
||||
on
|
||||
<span class="text-nowrap" t-out="amount_by_group['formatted_tax_group_base_amount']">27.00</span>
|
||||
</td>
|
||||
<td class="text-end o_price_total">
|
||||
<span class="text-nowrap" t-out="amount_by_group['formatted_tax_group_amount']">1.4 Eur</span>
|
||||
<span class="text-nowrap" t-out="amount_by_group['formatted_tax_group_amount']">4.05</span>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
@@ -362,20 +366,22 @@
|
||||
</template>
|
||||
|
||||
<template id="document_tax_totals_company_currency_template">
|
||||
<t t-set="show_company_taxes" t-value="o.company_id.currency_id != o.currency_id and o.amount_tax != 0 and o.move_type in ['out_invoice', 'out_refund']"/>
|
||||
<div t-if="not show_company_taxes" class="oe_structure"></div>
|
||||
<div class="mb-2 mt-3 border p-2 avoid-page-break-inside totals_taxes_company_currency"
|
||||
t-if="o.company_id.currency_id != o.currency_id and o.amount_tax != 0 and o.move_type in ['out_invoice', 'out_refund']">
|
||||
t-else="">
|
||||
<table class="table table-sm table-borderless mb-0">
|
||||
<p class="tax_computation_company_currency">
|
||||
Tax computation in <span t-field="o.company_currency_id"/>
|
||||
</p>
|
||||
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
|
||||
<tr class="border-black o_subtotal">
|
||||
<td><strong t-out="subtotal['name']"/></td>
|
||||
<td><strong t-out="subtotal['name']">Untaxed amount</strong></td>
|
||||
<td class="text-end">
|
||||
<span
|
||||
t-out="subtotal['amount_company_currency']"
|
||||
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'
|
||||
/>
|
||||
>27.00</span>
|
||||
</td>
|
||||
</tr>
|
||||
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>
|
||||
@@ -383,18 +389,18 @@
|
||||
<tr>
|
||||
<t t-if="tax_totals['display_tax_base']">
|
||||
<td>
|
||||
<span t-out="amount_by_group['tax_group_name']"/>
|
||||
<span class="text-nowrap"> on
|
||||
<t t-out="amount_by_group['tax_group_base_amount_company_currency']"
|
||||
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'
|
||||
/>
|
||||
<span t-out="amount_by_group['tax_group_name']">Tax 15%</span>
|
||||
on
|
||||
<span class="text-nowrap" t-out="amount_by_group['tax_group_base_amount_company_currency']"
|
||||
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'>
|
||||
27.00
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-end o_price_total">
|
||||
<span class="text-nowrap"
|
||||
t-out="amount_by_group['tax_group_amount_company_currency']"
|
||||
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'
|
||||
/>
|
||||
>4.05</span>
|
||||
</td>
|
||||
</t>
|
||||
<t t-else="">
|
||||
@@ -403,7 +409,7 @@
|
||||
<span class="text-nowrap"
|
||||
t-out="amount_by_group['tax_group_amount_company_currency']"
|
||||
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'
|
||||
/>
|
||||
>31.05</span>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
@@ -414,8 +420,8 @@
|
||||
<td><strong>Total</strong></td>
|
||||
<td class="text-end">
|
||||
<span t-out="abs(o.amount_total_signed)"
|
||||
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'
|
||||
/>
|
||||
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'>
|
||||
31.05</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<odoo>
|
||||
|
||||
<template id="delivery_report_saleorder_document" inherit_id="sale.report_saleorder_document">
|
||||
<p name="order_note" position="before">
|
||||
<span name="order_note" position="before">
|
||||
<p t-if="doc.carrier_id.carrier_description" id="carrier_description">
|
||||
<strong>Shipping Description:</strong>
|
||||
<span t-out="doc.carrier_id.carrier_description"/>
|
||||
</p>
|
||||
</p>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -13,46 +13,43 @@
|
||||
<th class="text-start align-middle" t-if="show_task"><span>Task</span></th>
|
||||
<th class="text-start align-middle"><span>Description</span></th>
|
||||
<th class="text-end">
|
||||
<span t-if="is_uom_day">Days Spent</span>
|
||||
<span t-else="">Hours Spent</span>
|
||||
<span t-if="not is_uom_day">Hours Spent</span>
|
||||
<span t-else="">Days Spent</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="lines" t-as="line" t-att-style="'background-color: #F1F1F1;' if line_index % 2 == 0 else ''">
|
||||
<td class="align-middle">
|
||||
<span t-field="line.date"/>
|
||||
<span t-field="line.date">2021-09-01</span>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<span t-field="line.user_id.partner_id.name"/>
|
||||
<span t-if="not line.user_id.partner_id.name" t-field="line.employee_id"/>
|
||||
<span t-if="line.user_id.partner_id.name" t-field="line.user_id.partner_id.name">Audrey Peterson</span>
|
||||
<span t-else="" t-field="line.employee_id">Audrey Peterson</span>
|
||||
</td>
|
||||
<td t-if="show_project" class="align-middle">
|
||||
<span t-field="line.project_id.sudo().name"/>
|
||||
<span t-field="line.project_id.sudo().name">Research and Development</span>
|
||||
</td>
|
||||
<td t-if="show_task" class="align-middle">
|
||||
<span t-if="line.task_id" t-field="line.task_id.sudo().name"/>
|
||||
<span t-if="line.task_id" t-field="line.task_id.sudo().name">New Portal System</span>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<span t-field="line.name" t-options="{'widget': 'text'}"/>
|
||||
<span t-field="line.name" t-options="{'widget': 'text'}">Call client and discuss project</span>
|
||||
</td>
|
||||
<td class="text-end align-middle">
|
||||
<span t-if="is_uom_day" t-esc="line._get_timesheet_time_day()" t-options="{'widget': 'timesheet_uom'}"/>
|
||||
<span t-else="" t-field="line.unit_amount" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"/>
|
||||
<span t-if="not is_uom_day" t-field="line.unit_amount" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}">2 hours</span>
|
||||
<span t-else="" t-esc="line._get_timesheet_time_day()" t-options="{'widget': 'timesheet_uom'}">1 day</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<t t-set="nbCols" t-value="4"/>
|
||||
<t t-if="show_project" t-set="nbCols" t-value="nbCols + 1"/>
|
||||
<t t-if="show_task" t-set="nbCols" t-value="nbCols + 1"/>
|
||||
<td class="text-end" t-attf-colspan="{{nbCols}}">
|
||||
<strong t-if="is_uom_day">
|
||||
<span style="margin-right: 15px;">Total (Days)</span>
|
||||
<t t-esc="lines._convert_hours_to_days(sum(lines.mapped('unit_amount')))" t-options="{'widget': 'timesheet_uom'}"/>
|
||||
<td class="text-end" colspan="100">
|
||||
<strong t-if="not is_uom_day">
|
||||
<span style="margin-right: 15px;">Total (Hours)</span>
|
||||
<t t-esc="sum(lines.mapped('unit_amount'))" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}">2 hours</t>
|
||||
</strong>
|
||||
<strong t-else="">
|
||||
<span style="margin-right: 15px;">Total (Hours)</span>
|
||||
<t t-esc="sum(lines.mapped('unit_amount'))" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"/>
|
||||
<span style="margin-right: 15px;">Total (Days)</span>
|
||||
<t t-esc="lines._convert_hours_to_days(sum(lines.mapped('unit_amount')))" t-options="{'widget': 'timesheet_uom'}">1 day</t>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -112,7 +109,7 @@
|
||||
<h2>
|
||||
<span>Timesheets
|
||||
<t t-if="len(docs.project_id) == 1">
|
||||
for the <t t-out="docs.project_id.name"/> Project
|
||||
for the <t t-out="docs.project_id.name">Research and Development</t> Project
|
||||
</t>
|
||||
</span>
|
||||
</h2>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
|
||||
<xpath expr="//div[@name='payment_term']" position="after">
|
||||
<xpath expr="//span[@name='payment_term']" position="after">
|
||||
<p t-if="o.company_id.country_id.code == 'AE' and o.partner_id.country_id.code != 'AE' and o.env.ref('l10n_ae.gcc_countries_group') in o.partner_id.country_id.country_group_ids">
|
||||
Supply between <b>United Arab Emirates</b> and
|
||||
<b>
|
||||
|
||||
@@ -5,10 +5,6 @@ from odoo import models
|
||||
class SaleOrder(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
def _get_name_sale_report(self):
|
||||
self.ensure_one()
|
||||
return 'l10n_br_sales.report_saleorder_document_brazil' if self.company_id.country_code == 'BR' else super()._get_name_sale_report()
|
||||
|
||||
def _get_name_portal_content_view(self):
|
||||
self.ensure_one()
|
||||
return 'l10n_br_sales.sale_order_portal_content_brazil' if self.company_id.country_code == 'BR' else super()._get_name_portal_content_view()
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_saleorder" inherit_id="sale.report_saleorder">
|
||||
<template id="report_saleorder_document" inherit_id="sale.report_saleorder">
|
||||
<xpath expr='//t[@t-call="sale.report_saleorder_document"]' position="attributes">
|
||||
<attribute name="t-if" add="doc.company_id.country_code != 'BR'" separator=" and "/>
|
||||
</xpath>
|
||||
<xpath expr='//t[@t-call="sale.report_saleorder_document"]' position="after">
|
||||
<t t-elif="doc._get_name_sale_report() == 'l10n_br_sales.report_saleorder_document_brazil'"
|
||||
<t t-elif="doc.company_id.country_code == 'BR'"
|
||||
t-call="l10n_br_sales.report_saleorder_document_brazil" t-lang="doc.partner_id.lang"/>
|
||||
</xpath>
|
||||
</template>
|
||||
@@ -15,5 +18,8 @@
|
||||
<xpath expr="//th[@name='th_total']/span" position="replace">
|
||||
<span>Total</span>
|
||||
</xpath>
|
||||
<xpath expr="//t[@t-call='sale.document_tax_totals']" position="replace">
|
||||
<t t-call="l10n_br_sales.document_tax_totals_brazil"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
|
||||
@@ -12,5 +12,11 @@
|
||||
<xpath expr="//th[@id='total_header']/span" position="replace">
|
||||
<span>Total</span>
|
||||
</xpath>
|
||||
<xpath expr="//t[@t-call='sale.sale_order_portal_content_totals_table']" position="replace">
|
||||
<table class="table table-sm">
|
||||
<t t-set="tax_totals" t-value="sale_order.tax_totals"/>
|
||||
<t t-call="l10n_br_sales.document_tax_totals_brazil"/>
|
||||
</table>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<template id="l10n_ch_report_invoice_document" inherit_id="account.report_invoice_document">
|
||||
<xpath expr="//div[@id='qrcode']" position="attributes">
|
||||
<attribute name="t-if" add="and o.qr_code_method != 'ch_qr'" separator=" "/>
|
||||
<xpath expr="//t[@t-set='show_qr']" position="attributes">
|
||||
<attribute name="t-value" add="and o.qr_code_method != 'ch_qr'" separator=" "/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
<xpath expr="//th[@name='th_taxes']" position="replace"/>
|
||||
<xpath expr="//span[@id='line_tax_ids']/.." position="replace"/>
|
||||
|
||||
<div name="payment_term" position="replace"/>
|
||||
<span name="payment_term" position="replace"/>
|
||||
<xpath expr="//span[@t-field='o.payment_reference']/../.." position="replace"/>
|
||||
|
||||
<!-- replace information section and usage chilean style -->
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="stock_report_delivery_document_inherit_product_expiry" inherit_id="stock.report_delivery_document">
|
||||
<xpath expr="//t[@name='lot_serial']" position="after">
|
||||
<xpath expr="//th[@name='lot_serial']" position="after">
|
||||
<t t-set="has_expiry_date" t-value="False"/>
|
||||
<t t-set="has_expiry_date"
|
||||
t-value="o.move_line_ids.filtered(lambda ml: ml.lot_id.expiration_date)"
|
||||
|
||||
@@ -2,33 +2,37 @@
|
||||
<odoo>
|
||||
<template id="matrix">
|
||||
<t t-foreach="order.get_report_matrixes()" t-as="grid">
|
||||
<table class="o_view_grid o_product_variant_grid table table-sm table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th t-foreach="grid['header']" t-as="column_header" class="o_grid_title_header text-center">
|
||||
<span t-esc="column_header['name']"/>
|
||||
<t t-call="product_matrix.extra_price">
|
||||
<t t-set="price" t-value="column_header.get('price', False)"/>
|
||||
</t>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="grid['matrix']" t-as="row">
|
||||
<t t-foreach="row" t-as="cell">
|
||||
<td t-if="cell.get('name', False)" class="text-start">
|
||||
<strong t-esc="cell['name']"/>
|
||||
<t t-call="product_matrix.extra_price">
|
||||
<t t-set="price" t-value="cell.get('price', False)"/>
|
||||
</t>
|
||||
</td>
|
||||
<td t-else="" class="text-end">
|
||||
<span t-esc="cell.get('qty', 0)" class="o_grid_cell_container"/>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div t-if="False" contenteditable="false" class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 opacity-75 text-muted text-center">
|
||||
<!-- this block is here for demo purposes, when editing the report via studio -->
|
||||
<strong>Product matrix block</strong>
|
||||
<div>The matrix of product variants of this order will be displayed here, if there are any.</div>
|
||||
<small>Switch to the "else" condition of this block to view or edit the table.</small>
|
||||
</div>
|
||||
<table t-else="" class="o_view_grid o_product_variant_grid table table-sm table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th t-foreach="grid['header']" t-as="column_header" class="o_grid_title_header text-center">
|
||||
<span t-esc="column_header['name']">Column name</span>
|
||||
<t t-call="product_matrix.extra_price">
|
||||
<t t-set="price" t-value="column_header.get('price', False)"/>
|
||||
</t>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="grid['matrix']" t-as="row">
|
||||
<td t-foreach="row" t-as="cell" t-if="cell.get('name', False)" class="text-start">
|
||||
<strong t-esc="cell['name']">Cell name</strong>
|
||||
<t t-call="product_matrix.extra_price">
|
||||
<t t-set="price" t-value="cell.get('price', False)"/>
|
||||
</t>
|
||||
</td>
|
||||
<td t-else="" class="text-end">
|
||||
<span t-esc="cell.get('qty', 0)" class="o_grid_cell_container"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
@@ -44,7 +48,7 @@
|
||||
accurate to display it.
|
||||
-->
|
||||
<span class="variant_price_extra" style="white-space: nowrap;">
|
||||
<t t-out="price"/>
|
||||
<t t-out="price">Variant price</t>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
@@ -1548,11 +1548,6 @@ class SaleOrder(models.Model):
|
||||
self.ensure_one()
|
||||
return self.env.ref('sale.action_quotations_with_onboarding')
|
||||
|
||||
def _get_name_sale_report(self):
|
||||
""" This method can be inherited by localizations who want to localize the sale order report. """
|
||||
self.ensure_one()
|
||||
return 'sale.report_saleorder_document'
|
||||
|
||||
def _get_name_portal_content_view(self):
|
||||
""" This method can be inherited by localizations who want to localize the online quotation view. """
|
||||
self.ensure_one()
|
||||
|
||||
@@ -43,25 +43,25 @@
|
||||
<span t-field="doc.name">SO0000</span>
|
||||
</h2>
|
||||
|
||||
<div class="row mt-4 mb-4" id="informations">
|
||||
<div class="row mt-4 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>
|
||||
<p class="m-0" t-field="doc.client_order_ref">S:0000</p>
|
||||
<strong>Your Reference:</strong><br/>
|
||||
<span class="m-0" t-field="doc.client_order_ref">SO0000</span>
|
||||
</div>
|
||||
<div t-if="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>
|
||||
<p class="m-0" t-field="doc.date_order" t-options='{"widget": "date"}'>2023-07-10</p>
|
||||
<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-if="doc.validity_date and doc.state in ['draft', 'sent']"
|
||||
class="col-auto col-3 mw-100 mb-2"
|
||||
name="expiration_date">
|
||||
<strong>Expiration:</strong>
|
||||
<p class="m-0" t-field="doc.validity_date">2023-07-10</p>
|
||||
<strong>Expiration:</strong><br/>
|
||||
<span class="m-0" t-field="doc.validity_date">2023-12-31</span>
|
||||
</div>
|
||||
<div t-if="doc.user_id.name" class="col-auto col-3 mw-100 mb-2">
|
||||
<strong>Salesperson:</strong>
|
||||
<p class="m-0" t-field="doc.user_id">Mitchell Admin</p>
|
||||
<strong>Salesperson:</strong><br/>
|
||||
<span class="m-0" t-field="doc.user_id">Mitchell Admin</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<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"></div>
|
||||
<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">
|
||||
@@ -99,39 +100,39 @@
|
||||
|
||||
<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">Awesome Product</span></td>
|
||||
<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">mm</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" groups="product.group_discount_per_so_line">
|
||||
<span t-field="line.discount">4%</span>
|
||||
<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))">
|
||||
VAT 21%
|
||||
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">9</span>
|
||||
<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">9</span>
|
||||
<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">Awesome Services</span>
|
||||
<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">The previous product should be shipped with additional love</span>
|
||||
<span t-field="line.name">A note, whose content usually applies to the section or product above.</span>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
@@ -143,27 +144,28 @@
|
||||
<span
|
||||
t-out="current_subtotal"
|
||||
t-options='{"widget": "monetary", "display_currency": doc.currency_id}'
|
||||
>9</span>
|
||||
>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="#{doc._get_name_tax_totals_view()}"/>
|
||||
<t t-call="sale.document_tax_totals"/>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"></div>
|
||||
|
||||
<div t-if="doc.signature" class="mt-4 ml64 mr4" name="signature">
|
||||
<div t-if="not doc.signature" class="oe_structure"></div>
|
||||
<div t-else="" class="mt-4 ml64 mr4" name="signature">
|
||||
<div class="offset-8">
|
||||
<strong>Signature</strong>
|
||||
</div>
|
||||
@@ -171,12 +173,11 @@
|
||||
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/>
|
||||
</div>
|
||||
<div class="offset-8 text-center">
|
||||
<p t-field="doc.signed_by">Oscar Morgan</p>
|
||||
<span t-field="doc.signed_by">Oscar Morgan</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p t-field="doc.note" name="order_note"/>
|
||||
<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>
|
||||
@@ -194,10 +195,7 @@
|
||||
<template id="report_saleorder">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<!-- Not a dynamic t-call="#{doc._get_name_sale_report()}" because that breaks studio:
|
||||
https://github.com/odoo/odoo/pull/60609/files -->
|
||||
<t t-if="doc._get_name_sale_report() == 'sale.report_saleorder_document'"
|
||||
t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
|
||||
<t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
@@ -207,10 +205,7 @@
|
||||
<t t-set="is_pro_forma" t-value="True"/>
|
||||
<t t-set="docs" t-value="docs.with_context(proforma=True)"/>
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<!-- Not a dynamic t-call="#{doc._get_name_sale_report()}" because that breaks studio:
|
||||
https://github.com/odoo/odoo/pull/60609/files -->
|
||||
<t t-if="doc._get_name_sale_report() == 'sale.report_saleorder_document'"
|
||||
t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
|
||||
<t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
@@ -567,9 +567,7 @@
|
||||
</div>
|
||||
|
||||
<div id="total" class="row" name="total" style="page-break-inside: avoid;">
|
||||
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto">
|
||||
<t t-call="sale.sale_order_portal_content_totals_table"/>
|
||||
</div>
|
||||
<t t-call="sale.sale_order_portal_content_totals_table"/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -2,27 +2,28 @@
|
||||
<odoo>
|
||||
<template id="report_saleorder_document_inherit_sale_management" inherit_id="sale.report_saleorder_document">
|
||||
<xpath expr="//div[@name='signature']" position="after">
|
||||
<div t-if="doc.sale_order_option_ids and doc.state in ['draft', 'sent']">
|
||||
<div t-if="not (doc.sale_order_option_ids and doc.state in ['draft', 'sent'])" class="oe_structure">​</div>
|
||||
<div t-else="">
|
||||
<t t-set="has_option_discount" t-value="any(option.discount != 0.0 for option in doc.sale_order_option_ids)" />
|
||||
<h4 name="h_optional_products">
|
||||
<span>Options</span>
|
||||
</h4>
|
||||
<table name="table_optional_products" class="table table-sm">
|
||||
<thead>
|
||||
<thead class="fw-bold">
|
||||
<tr>
|
||||
<th name="th_option_name" class="text-start">Description</th>
|
||||
<th t-if="has_option_discount" name="th_option_discount" groups="product.group_discount_per_so_line" class="text-start">Disc.%</th>
|
||||
<th name="th_option_price_unit" class="text-end">Unit Price</th>
|
||||
<td name="th_option_name" class="text-start">Description</td>
|
||||
<td t-if="has_option_discount" name="th_option_discount" groups="product.group_discount_per_so_line" class="text-start">Disc.%</td>
|
||||
<td name="th_option_price_unit" class="text-end">Unit Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="sale_tbody">
|
||||
<tr t-foreach="doc.sale_order_option_ids" t-as="option">
|
||||
<td name="td_option_name">
|
||||
<span t-field="option.name">Awesome Product's extended warranty</span>
|
||||
<span t-field="option.name">Extra Chips</span>
|
||||
</td>
|
||||
<td t-if="has_option_discount" name="td_option_discount" groups="product.group_discount_per_so_line">
|
||||
<strong t-if="option.discount != 0.0" class="text-info">
|
||||
<t t-out="((option.discount % 1) and '%s' or '%d') % option.discount">3</t>%
|
||||
<t t-out="((option.discount % 1) and '%s' or '%d') % option.discount">-</t>%
|
||||
</strong>
|
||||
</td>
|
||||
<td name="td_option_price_unit">
|
||||
@@ -30,16 +31,17 @@
|
||||
<div t-field="option.price_unit"
|
||||
t-options='{"widget": "monetary", "display_currency": doc.currency_id}'
|
||||
t-att-style="option.discount and 'text-decoration: line-through' or None"
|
||||
t-att-class="option.discount and 'text-danger' or None">150 Eur</div>
|
||||
t-att-class="option.discount and 'text-danger' or None">1.5</div>
|
||||
<div t-if="option.discount">
|
||||
<t t-out="'%.2f' % ((1-option.discount / 100.0) * option.price_unit)">145.50 Eur</t>
|
||||
<t t-out="'%.2f' % ((1-option.discount / 100.0) * option.price_unit)"> </t>
|
||||
</div>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="oe_structure">​</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<xpath expr="//div[@name='div_sched_date']" position="after">
|
||||
<div class="col-auto justify-content-end" t-if="o.sudo().sale_id.client_order_ref">
|
||||
<strong>Customer Reference:</strong>
|
||||
<p t-field="o.sudo().sale_id.client_order_ref"/>
|
||||
<p t-field="o.sudo().sale_id.client_order_ref">Customer reference</p>
|
||||
</div>
|
||||
<div class="col-auto justify-content-end" t-if="o.sudo().sale_id.incoterm">
|
||||
<strong>Incoterm:</strong>
|
||||
<p t-if="o.sudo().sale_id.incoterm_location" t-out="'%s %s' % (o.sudo().sale_id.incoterm.code, o.sudo().sale_id.incoterm_location)"/>
|
||||
<p t-else="" t-field="o.sudo().sale_id.incoterm.display_name"/>
|
||||
<p t-if="o.sudo().sale_id.incoterm_location" t-out="'%s %s' % (o.sudo().sale_id.incoterm.code, o.sudo().sale_id.incoterm_location)">Incoterm details</p>
|
||||
<p t-else="" t-field="o.sudo().sale_id.incoterm.display_name">Incoterm details</p>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<t t-if="doc.timesheet_ids">
|
||||
<h2>
|
||||
<br/>
|
||||
<span>Timesheets for the <t t-out="doc_name"/> <t t-out="record_name"/>
|
||||
<span>Timesheets for the <t t-out="doc_name">S0001</t> <t t-out="record_name">- Timesheet product</t>
|
||||
</span>
|
||||
</h2>
|
||||
<t t-set='lines' t-value='doc.timesheet_ids'/>
|
||||
|
||||
@@ -43,23 +43,21 @@
|
||||
</t>
|
||||
<div class="page">
|
||||
<h2>
|
||||
<span t-field="o.name"/>
|
||||
<span t-field="o.name">WH/OUT/0001</span>
|
||||
</h2>
|
||||
<div class="oe_structure"></div>
|
||||
<div class="row mt32 mb32">
|
||||
<div t-if="o.origin" class="col-auto" name="div_origin">
|
||||
<strong>Order:</strong>
|
||||
<p t-field="o.origin"/>
|
||||
<p t-field="o.origin">S0001</p>
|
||||
</div>
|
||||
<div t-if="o.state" class="col-auto" name="div_sched_date">
|
||||
<strong>Shipping Date:</strong>
|
||||
<t t-if="o.state == 'done'">
|
||||
<p t-field="o.date_done"/>
|
||||
</t>
|
||||
<t t-if="o.state != 'done'">
|
||||
<p t-field="o.scheduled_date"/>
|
||||
</t>
|
||||
<p t-if="o.state == 'done'" t-field="o.date_done"/>
|
||||
<p t-else="" t-field="o.scheduled_date"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"></div>
|
||||
<table class="table table-sm" t-if="o.state!='done'" name="stock_move_table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -72,36 +70,34 @@
|
||||
<t t-set="lines" t-value="o.move_ids.filtered(lambda x: x.product_uom_qty)"/>
|
||||
<tr t-foreach="lines" t-as="move">
|
||||
<td>
|
||||
<span t-field="move.product_id"/>
|
||||
<span t-field="move.product_id">Customizable Desk</span>
|
||||
<p t-if="move.description_picking != move.product_id.name and move.description_picking != move.product_id.display_name">
|
||||
<span t-field="move.description_picking"/>
|
||||
<span t-field="move.description_picking">Description on transfer</span>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<span t-field="move.product_uom_qty"/>
|
||||
<span t-field="move.product_uom"/>
|
||||
<span t-field="move.product_uom_qty">3.00</span>
|
||||
<span t-field="move.product_uom">units</span>
|
||||
</td>
|
||||
<td>
|
||||
<span t-field="move.quantity_done"/>
|
||||
<span t-field="move.product_uom"/>
|
||||
<span t-field="move.quantity_done">3.00</span>
|
||||
<span t-field="move.product_uom">units</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm mt48" t-if="o.move_line_ids and o.state=='done'" name="stock_move_line_table">
|
||||
<table class="table table-sm mt48" t-elif="o.move_line_ids and o.state=='done'" name="stock_move_line_table">
|
||||
<t t-set="has_serial_number" t-value="False"/>
|
||||
<t t-set="has_serial_number" t-value="o.move_line_ids.mapped('lot_id')" groups="stock.group_lot_on_delivery_slip"/>
|
||||
<thead>
|
||||
<tr>
|
||||
<th name="th_sml_product"><strong>Product</strong></th>
|
||||
<t name="lot_serial" t-if="has_serial_number">
|
||||
<th>
|
||||
Lot/Serial Number
|
||||
</th>
|
||||
</t>
|
||||
<th name="th_sml_qty_ordered" class="text-center" t-if="not has_serial_number">
|
||||
<strong>Ordered</strong>
|
||||
</th>
|
||||
<th name="lot_serial" t-else="">
|
||||
Lot/Serial Number
|
||||
</th>
|
||||
<th name="th_sml_quantity" class="text-center"><strong>Delivered</strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -159,8 +155,10 @@
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="oe_structure"></div>
|
||||
<t t-set="backorders" t-value="o.backorder_ids.filtered(lambda x: x.state not in ('done', 'cancel'))"/>
|
||||
<t t-if="o.backorder_ids and backorders">
|
||||
<div t-if="not (o.backorder_ids and backorders)" class="oe_structure"></div>
|
||||
<div t-else="">
|
||||
<p class="mt-5">
|
||||
<span>Remaining quantities not yet delivered:</span>
|
||||
</p>
|
||||
@@ -173,27 +171,25 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="backorders" t-as="backorder">
|
||||
<t t-set="bo_lines" t-value="backorder.move_ids.filtered(lambda x: x.product_uom_qty)"/>
|
||||
<tr t-foreach="bo_lines" t-as="bo_line">
|
||||
<td class="w-auto">
|
||||
<span t-field="bo_line.product_id"/>
|
||||
<p t-if="bo_line.description_picking != bo_line.product_id.name and bo_line.description_picking != bo_line.product_id.display_name">
|
||||
<span t-field="bo_line.description_picking"/>
|
||||
</p>
|
||||
</td>
|
||||
<td/>
|
||||
<td class="text-center w-auto">
|
||||
<span t-field="bo_line.product_uom_qty"/>
|
||||
<span t-field="bo_line.product_uom"/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
<tr t-foreach="backorders.mapped('move_ids').filtered(lambda x: x.product_uom_qty)" t-as="bo_line">
|
||||
<td class="w-auto">
|
||||
<span t-field="bo_line.product_id">Office Chair</span>
|
||||
<p t-if="bo_line.description_picking != bo_line.product_id.name and bo_line.description_picking != bo_line.product_id.display_name">
|
||||
<span t-field="bo_line.description_picking">Description on transfer</span>
|
||||
</p>
|
||||
</td>
|
||||
<td/>
|
||||
<td class="text-center w-auto">
|
||||
<span t-field="bo_line.product_uom_qty">3.00</span>
|
||||
<span t-field="bo_line.product_uom">units</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<div t-if="o.signature" class="mt32 ml64 mr4" name="signature">
|
||||
<div t-if="not o.signature" class="oe_structure"></div>
|
||||
<div t-else="" class="mt32 ml64 mr4" name="signature">
|
||||
<div class="offset-8">
|
||||
<strong>Signature</strong>
|
||||
</div>
|
||||
@@ -201,7 +197,7 @@
|
||||
<img t-att-src="image_data_uri(o.signature)" style="max-height: 4cm; max-width: 8cm;"/>
|
||||
</div>
|
||||
<div class="offset-8 text-center">
|
||||
<p t-field="o.partner_id.name"/>
|
||||
<p t-field="o.partner_id.name">John Doe</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,39 +10,43 @@
|
||||
<t>
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
<table class="table table-condensed" style="border-bottom: 0px solid white !important;">
|
||||
<tr>
|
||||
<th>
|
||||
<h1 t-field="o.name" class="mt0 float-start"/>
|
||||
</th>
|
||||
<th name="td_pk_barcode" style="text-align: center">
|
||||
<t t-if="o.valid_sscc">
|
||||
<div class="row text-start">
|
||||
<t t-set="barcode" t-value="'00' + o.name"/>
|
||||
<t t-if="o.pack_date" t-set="barcode" t-value="barcode + '13' + o.pack_date.strftime('%y%m%d')"/>
|
||||
<div class="col-3" name="datamatrix_barcode" style="margin: 0px 20px 40px 60px" t-out="barcode" t-options="{'widget': 'barcode', 'symbology': 'ECC200DataMatrix', 'width': 100, 'height': 100}"/>
|
||||
</div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div t-field="o.name" t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:300px;height:50px;'}"/>
|
||||
<p t-field="o.name"/>
|
||||
</t>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="row mb-5">
|
||||
<div class="col-6">
|
||||
<h1><span t-field="o.name" class="mt0 float-start">Package Reference</span></h1>
|
||||
</div>
|
||||
<div class="col-6 d-flex flex-column justify-content-center align-item-center" t-if="o.valid_sscc">
|
||||
<t t-set="barcode" t-value="'00' + o.name"/>
|
||||
<t t-if="o.pack_date" t-set="barcode" t-value="barcode + '13' + o.pack_date.strftime('%y%m%d')"/>
|
||||
<div name="datamatrix_barcode" t-out="barcode" t-options="{'widget': 'barcode', 'symbology': 'ECC200DataMatrix', 'width': 100, 'height': 100}">
|
||||
<div class="bg-light border-1 rounded d-flex flex-column align-items-center justify-content-center px-1 py-2 opacity-75 text-muted text-center">
|
||||
(package barcode)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div t-else="" class="col-6 d-flex flex-column justify-content-center align-item-center text-center">
|
||||
<div t-field="o.name" t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:300px;height:50px;'}">
|
||||
<div class="bg-light border-1 rounded d-flex flex-column align-items-center justify-content-center px-1 py-2 opacity-75 text-muted text-center">
|
||||
(package barcode)
|
||||
</div>
|
||||
</div>
|
||||
<p t-field="o.name">Package Reference</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"></div>
|
||||
<div class="row mt32 mb32">
|
||||
<div t-if="o.pack_date" class="col-auto">
|
||||
<strong>Pack Date:</strong>
|
||||
<p t-field="o.pack_date"/>
|
||||
<p t-field="o.pack_date">2021-9-01</p>
|
||||
</div>
|
||||
<div t-if="o.package_type_id" class="o_packaging_type col-auto">
|
||||
<strong>Package Type:</strong>
|
||||
<p t-field="o.package_type_id.name"/>
|
||||
<p t-field="o.package_type_id.name">Pallet</p>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-sm table-striped" style="border-bottom: 0px solid white !important;">
|
||||
<t t-set="has_serial_number" t-value="o.quant_ids.mapped('lot_id')" />
|
||||
<t t-set="has_ean_barcode" t-value="any(valid_ean for valid_ean in o.quant_ids.product_id.mapped('valid_ean'))" />
|
||||
<div class="oe_structure"></div>
|
||||
<t t-set="has_serial_number" t-value="o.quant_ids.mapped('lot_id')" />
|
||||
<t t-set="has_ean_barcode" t-value="any(valid_ean for valid_ean in o.quant_ids.product_id.mapped('valid_ean'))" />
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Product</th>
|
||||
@@ -55,16 +59,16 @@
|
||||
<tbody>
|
||||
<tr t-foreach="o.quant_ids" t-as="l">
|
||||
<td>
|
||||
<span t-field="l.product_id.name"/>
|
||||
<span t-field="l.product_id.name">Customizable Desk</span>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-field="l.quantity"/>
|
||||
<span t-field="l.quantity">3.00</span>
|
||||
</td>
|
||||
<td groups="uom.group_uom">
|
||||
<span t-field="l.product_id.uom_id.name"/>
|
||||
<span t-field="l.product_id.uom_id.name">units</span>
|
||||
</td>
|
||||
<td class="text-end" t-if="has_serial_number">
|
||||
<t t-if="l.lot_id"><span t-field="l.lot_id.name"/></t>
|
||||
<t t-if="l.lot_id"><span t-field="l.lot_id.name">54326786758</span></t>
|
||||
</td>
|
||||
<td class="text-end" t-if="has_ean_barcode">
|
||||
<t t-if="l.product_id.valid_ean">
|
||||
@@ -84,7 +88,11 @@
|
||||
<!-- TODO: lot/sn ALWAYS has to be last part of barcode since left padding '0's = different sn/lot name match when scanning => fix when FNC1 can be used, -->
|
||||
<t name="product_barcode_lot_datamatrix" t-if="l.product_id.tracking == 'lot' and l.lot_id" t-set="product_barcode" t-value="product_barcode + '10' + l.lot_id.name"/>
|
||||
<t t-elif="l.product_id.tracking == 'serial' and l.lot_id" t-set="product_barcode" t-value="product_barcode + '21' + l.lot_id.name"/>
|
||||
<span t-out="product_barcode" t-options="{'widget': 'barcode', 'symbology': 'ECC200DataMatrix', 'img_style': 'width:17mm;height:17mm'}"/>
|
||||
<span t-out="product_barcode" t-options="{'widget': 'barcode', 'symbology': 'ECC200DataMatrix', 'img_style': 'width:17mm;height:17mm'}">
|
||||
<div class="bg-light border-1 rounded d-flex flex-column align-items-center justify-content-center px-1 py-2 opacity-75 text-muted text-center">
|
||||
(product barcode)
|
||||
</div>
|
||||
</span>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -6,10 +6,15 @@
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="address" t-value="None"/>
|
||||
<div class="page">
|
||||
<div class="row justify-content-end mb16">
|
||||
<div class="col-4" name="right_box">
|
||||
<div t-field="o.name" t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:300px;height:50px;'}"/>
|
||||
<div t-field="o.name" t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:300px;height:50px;'}">
|
||||
<div class="bg-light border-1 rounded d-flex flex-column align-items-center justify-content-center p-3 opacity-75 text-muted text-center">
|
||||
(document barcode)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -17,12 +22,22 @@
|
||||
<div t-if="o.should_print_delivery_address()">
|
||||
<span><strong>Delivery Address:</strong></span>
|
||||
<div t-field="o.move_ids[0].partner_id"
|
||||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
|
||||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 opacity-75 text-muted text-center">
|
||||
<strong>Delivery address</strong>
|
||||
<div>Presence depends on the type of operation.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div t-elif="o.picking_type_id.code != 'internal' and o.picking_type_id.warehouse_id.partner_id">
|
||||
<span><strong>Warehouse Address:</strong></span>
|
||||
<div t-field="o.picking_type_id.warehouse_id.partner_id"
|
||||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
|
||||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 opacity-75 text-muted text-center">
|
||||
<strong>Warehouse address</strong>
|
||||
<div>Presence depends on the type of operation.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-5 offset-1" name="div_incoming_address">
|
||||
@@ -31,34 +46,40 @@
|
||||
<span><strong>Vendor Address:</strong></span>
|
||||
<t t-set="show_partner" t-value="True" />
|
||||
</div>
|
||||
<div t-if="o.picking_type_id.code=='internal' and o.partner_id">
|
||||
<div t-elif="o.picking_type_id.code=='internal' and o.partner_id">
|
||||
<span><strong>Warehouse Address:</strong></span>
|
||||
<t t-set="show_partner" t-value="True" />
|
||||
</div>
|
||||
<div t-if="o.picking_type_id.code=='outgoing' and o.partner_id and o.partner_id != o.partner_id.commercial_partner_id">
|
||||
<div t-elif="o.picking_type_id.code=='outgoing' and o.partner_id and o.partner_id != o.partner_id.commercial_partner_id">
|
||||
<span><strong>Customer Address:</strong></span>
|
||||
<t t-set="show_partner" t-value="True" />
|
||||
</div>
|
||||
<div t-if="show_partner" name="partner_header">
|
||||
<div t-field="o.partner_id.commercial_partner_id"
|
||||
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/>
|
||||
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 opacity-75 text-muted text-center">
|
||||
<strong>Recipient address</strong>
|
||||
<div>Presence depends on the type of operation.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"></div>
|
||||
</div>
|
||||
<br/>
|
||||
<h1 t-field="o.name" class="mt0"/>
|
||||
<div class="row mt48 mb32">
|
||||
<h1 t-field="o.name" class="mt0">WH/OUT/00001</h1>
|
||||
<div class="oe_structure"></div>
|
||||
<div class="row mt32 mb32">
|
||||
<div t-if="o.origin" class="col-auto" name="div_origin">
|
||||
<strong>Order:</strong>
|
||||
<p t-field="o.origin"/>
|
||||
<p t-field="o.origin">S0001</p>
|
||||
</div>
|
||||
<div class="col-auto" name="div_state">
|
||||
<strong>Status:</strong>
|
||||
<p t-field="o.state"/>
|
||||
<p t-field="o.state">Draft</p>
|
||||
</div>
|
||||
<div class="col-auto" name="div_sched_date">
|
||||
<strong>Scheduled Date:</strong>
|
||||
<p t-field="o.scheduled_date"/>
|
||||
<p t-field="o.scheduled_date">2023-09-24</p>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-sm" t-if="o.move_line_ids and o.move_ids_without_package">
|
||||
@@ -75,7 +96,7 @@
|
||||
<th name="th_from" t-if="o.picking_type_id.code != 'incoming'" align="left" groups="stock.group_stock_multi_locations">
|
||||
<strong>From</strong>
|
||||
</th>
|
||||
<th name="th_to" t-if="o.picking_type_id.code != 'outgoing'" groups="stock.group_stock_multi_locations">
|
||||
<th name="th_to" t-elif="o.picking_type_id.code != 'outgoing'" groups="stock.group_stock_multi_locations">
|
||||
<strong>To</strong>
|
||||
</th>
|
||||
<th name="th_serial_number" class="text-center" t-if="has_serial_number">
|
||||
@@ -88,74 +109,90 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- In case you come across duplicated lines, ask NIM or LAP -->
|
||||
<t t-foreach="o.move_line_ids_without_package" t-as="ml">
|
||||
<tr>
|
||||
<td>
|
||||
<span t-field="ml.product_id.display_name"/><br/>
|
||||
<span t-field="ml.product_id.description_picking"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-if="o.state != 'done'" t-field="ml.reserved_uom_qty"/>
|
||||
<span t-if="o.state == 'done'" t-field="ml.qty_done"/>
|
||||
<span t-field="ml.product_uom_id" groups="uom.group_uom"/>
|
||||
</td>
|
||||
<td t-if="o.picking_type_id.code != 'incoming'" groups="stock.group_stock_multi_locations">
|
||||
<span t-esc="ml.location_id.display_name"/>
|
||||
<t t-if="ml.package_id">
|
||||
<span t-field="ml.package_id"/>
|
||||
</t>
|
||||
</td>
|
||||
<td t-if="o.picking_type_id.code != 'outgoing'" groups="stock.group_stock_multi_locations">
|
||||
<div>
|
||||
<span t-field="ml.location_dest_id"/>
|
||||
<t t-if="ml.result_package_id">
|
||||
<span t-field="ml.result_package_id"/>
|
||||
</t>
|
||||
</div>
|
||||
</td>
|
||||
<td class=" text-center h6" t-if="has_serial_number">
|
||||
<div t-if="has_serial_number and (ml.lot_id or ml.lot_name)" t-esc="ml.lot_id.name or ml.lot_name" t-options="{'widget': 'barcode', 'humanreadable': 1, 'width': 400, 'height': 100, 'img_style': 'width:100%;height:35px;'}"/>
|
||||
</td>
|
||||
<td class="text-center" t-if="has_barcode">
|
||||
<t t-if="product_barcode != ml.product_id.barcode">
|
||||
<span t-if="ml.product_id and ml.product_id.barcode">
|
||||
<div t-field="ml.product_id.barcode" t-options="{'widget': 'barcode', 'symbology': 'auto', 'width': 400, 'height': 100, 'quiet': 0, 'img_style': 'height:35px;'}"/>
|
||||
</span>
|
||||
<t t-set="product_barcode" t-value="ml.product_id.barcode"/>
|
||||
<tr t-foreach="o.move_line_ids_without_package" t-as="ml">
|
||||
<td>
|
||||
<span t-field="ml.product_id.display_name">Customizable Desk</span><br/>
|
||||
<span t-field="ml.product_id.description_picking">Description on transfer</span>
|
||||
</td>
|
||||
<td>
|
||||
<span t-if="o.state != 'done'" t-field="ml.reserved_uom_qty">3.00</span>
|
||||
<span t-else="" t-field="ml.qty_done">3.00</span>
|
||||
<span t-field="ml.product_uom_id" groups="uom.group_uom">units</span>
|
||||
</td>
|
||||
<td t-if="o.picking_type_id.code != 'incoming'" groups="stock.group_stock_multi_locations">
|
||||
<span t-esc="ml.location_id.display_name">WH/Stock</span>
|
||||
<t t-if="ml.package_id">
|
||||
<span t-field="ml.package_id">Package A</span>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</td>
|
||||
<td t-elif="o.picking_type_id.code != 'outgoing'" groups="stock.group_stock_multi_locations">
|
||||
<div>
|
||||
<span t-field="ml.location_dest_id">WH/Outgoing</span>
|
||||
<t t-if="ml.result_package_id">
|
||||
<span t-field="ml.result_package_id">Shelf 1</span>
|
||||
</t>
|
||||
</div>
|
||||
</td>
|
||||
<td class=" text-center h6" t-if="has_serial_number">
|
||||
<span t-if="has_serial_number and (ml.lot_id or ml.lot_name)" t-esc="ml.lot_id.name or ml.lot_name" t-options="{'widget': 'barcode', 'humanreadable': 1, 'width': 400, 'height': 100, 'img_style': 'width:100%;height:35px;'}">
|
||||
<div class="bg-light border-1 rounded d-flex flex-column align-items-center justify-content-center px-1 py-2 opacity-75 text-muted text-center">
|
||||
(serial barcode)
|
||||
</div>
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-center" t-if="has_barcode">
|
||||
<t t-if="product_barcode != ml.product_id.barcode">
|
||||
<span t-if="ml.product_id and ml.product_id.barcode">
|
||||
<div t-field="ml.product_id.barcode" t-options="{'widget': 'barcode', 'symbology': 'auto', 'width': 400, 'height': 100, 'quiet': 0, 'img_style': 'height:35px;'}">
|
||||
<div class="bg-light border-1 rounded d-flex flex-column align-items-center justify-content-center px-1 py-2 opacity-75 text-muted text-center">
|
||||
(product barcode)
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
<t t-set="product_barcode" t-value="ml.product_id.barcode"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm" t-if="o.package_level_ids and o.picking_type_entire_packs and o.state in ['assigned', 'done']">
|
||||
<div t-if="not (o.package_level_ids and o.picking_type_entire_packs and o.state in ['assigned', 'done'])" class="oe_structure"></div>
|
||||
<table t-else="" class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th name="th_package">Package</th>
|
||||
<th name="th_pko_from" t-if="o.picking_type_id.code != 'incoming'" groups="stock.group_stock_multi_locations">From</th>
|
||||
<th name="th_pki_from" t-if="o.picking_type_id.code != 'outgoing'" groups="stock.group_stock_multi_locations">To</th>
|
||||
<th name="th_pki_from" t-elif="o.picking_type_id.code != 'outgoing'" groups="stock.group_stock_multi_locations">To</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="o.package_level_ids.sorted(key=lambda p: p.package_id.name)" t-as="package">
|
||||
<t t-set="package" t-value="package.with_context(picking_id=o.id)" />
|
||||
<td name="td_pk_barcode">
|
||||
<div t-field="package.package_id.name" t-options="{'widget': 'barcode', 'humanreadable': 1, 'width': 600, 'height': 100, 'img_style': 'width:300px;height:50px;margin-left: -50px;'}"/><br/>
|
||||
<t t-set="package" t-value="package.with_context(picking_id=o.id)" />
|
||||
<div t-field="package.package_id.name" t-options="{'widget': 'barcode', 'humanreadable': 1, 'width': 600, 'height': 100, 'img_style': 'width:300px;height:50px;margin-left: -50px;'}">
|
||||
<div class="bg-light border-1 rounded d-flex flex-column align-items-center justify-content-center px-1 py-2 opacity-75 text-muted text-center">
|
||||
(package barcode)
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
</td>
|
||||
<td t-if="o.picking_type_id.code != 'incoming'" groups="stock.group_stock_multi_locations">
|
||||
<span t-field="package.location_id"/>
|
||||
</td>
|
||||
<td t-if="o.picking_type_id.code != 'outgoing'" groups="stock.group_stock_multi_locations">
|
||||
<td t-elif="o.picking_type_id.code != 'outgoing'" groups="stock.group_stock_multi_locations">
|
||||
<span t-field="package.location_dest_id"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<t t-set="no_reserved_product" t-value="o.move_ids.filtered(lambda x: x.product_uom_qty != x.reserved_availability and x.move_line_ids and x.state!='done')"/>
|
||||
<p t-if="o.state in ['draft', 'waiting', 'confirmed'] or no_reserved_product"><i class="fa fa-exclamation-triangle" />
|
||||
All products could not be reserved. Click on the "Check Availability" button to try to reserve products.
|
||||
</p>
|
||||
<p t-else=""/>
|
||||
<div class="oe_structure"></div>
|
||||
<p t-field="o.note"/>
|
||||
<div class="oe_structure"></div>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
@@ -4,30 +4,26 @@
|
||||
<xpath expr="//div[@id='right-elements']" position="after">
|
||||
<t groups="stock_account.group_lot_on_invoice">
|
||||
<t t-set="lot_values" t-value="o._get_invoiced_lot_values()"/>
|
||||
<t t-if="lot_values">
|
||||
<br/>
|
||||
<table class="table table-sm" style="width: 50%;" name="invoice_snln_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span>Product</span></th>
|
||||
<th class="text-end"><span>Quantity</span></th>
|
||||
<th class="text-end"><span>SN/LN</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="lot_values" t-as="snln_line">
|
||||
<tr>
|
||||
<td><t t-esc="snln_line['product_name']"/></td>
|
||||
<td class="text-end">
|
||||
<t t-esc="snln_line['quantity']"/>
|
||||
<t t-esc="snln_line['uom_name']" groups="uom.group_uom"/>
|
||||
</td>
|
||||
<td class="text-end"><t t-esc="snln_line['lot_name']"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
</t>
|
||||
<div t-if="not lot_values" class="oe_structure">​</div>
|
||||
<table t-else="" class="table table-sm mt-2" style="width: 50%;" name="invoice_snln_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span>Product</span></th>
|
||||
<th class="text-end"><span>Quantity</span></th>
|
||||
<th class="text-end"><span>SN/LN</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="lot_values" t-as="snln_line">
|
||||
<td><t t-esc="snln_line['product_name']">Bacon</t></td>
|
||||
<td class="text-end">
|
||||
<t t-esc="snln_line['quantity']">6.00</t>
|
||||
<t t-esc="snln_line['uom_name']" groups="uom.group_uom">units</t>
|
||||
</td>
|
||||
<td><t class="text-end" t-esc="snln_line['lot_name']">BC46282798</t></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
@@ -291,52 +291,58 @@
|
||||
|
||||
<template id="address_layout">
|
||||
<t t-set="colclass" t-value="('col-sm-5' if report_type == 'html' else 'col-5') + ' ms-auto'"/>
|
||||
<t t-if="address">
|
||||
<div class="address row">
|
||||
<t t-if="information_block">
|
||||
<t t-set="colclass" t-value="'col-5 offset-1'"/>
|
||||
<div name="information_block" class="col-6">
|
||||
<t t-out="information_block or None">
|
||||
<strong>Invoicing address</strong>
|
||||
<div>
|
||||
<div>Gemini Furniture, Oscar Morgan</div>
|
||||
<div>317 Fairchild Dr</div>
|
||||
<div>Fairfield CA 94535</div>
|
||||
<div>United States</div>
|
||||
<div>(561)-239-1744</div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
<div name="address" t-att-class="colclass">
|
||||
<t t-esc="address or None">
|
||||
<div>
|
||||
<div>Gemini Furniture, Oscar Morgan</div>
|
||||
<div>317 Fairchild Dr</div>
|
||||
<div>Fairfield CA 94535</div>
|
||||
<div>United States</div>
|
||||
<div>Tax ID: 0000000000-9999999999</div>
|
||||
<div t-if="address" class="address row " title="This block is not always present depending on the printed document.">
|
||||
<t t-if="information_block">
|
||||
<t t-set="colclass" t-value="'col-5 offset-1'"/>
|
||||
<div name="information_block" class="col-6">
|
||||
<t t-out="information_block or None">
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 opacity-75 text-muted text-center">
|
||||
<strong>Information block</strong>
|
||||
<div>Usually contains a source address or a complementary address.</div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<div name="address" t-att-class="colclass">
|
||||
<t t-esc="address or None">
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 opacity-75 text-muted text-center">
|
||||
<strong>Address block</strong>
|
||||
<div>Usually contains the address of the document's recipient.</div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
<div class="oe_structure" t-else=""></div>
|
||||
</template>
|
||||
|
||||
<template id="external_layout_striped">
|
||||
<div t-attf-class="o_company_#{company.id}_layout header" t-att-style="report_header_style">
|
||||
<div class="o_background_header">
|
||||
<div class="float-end">
|
||||
<div class="mt0 text-end h3" t-field="company.report_header"/>
|
||||
<div class="mt0 text-end h3" t-if="company.report_header" t-field="company.report_header">Company tagline</div>
|
||||
</div>
|
||||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" class="float-start" alt="Logo"/>
|
||||
<div class="float-start company_address">
|
||||
<ul class="list-unstyled">
|
||||
<li t-if="company.is_company_details_empty"><t t-esc="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/></li>
|
||||
<li t-else=""><t t-esc="company.company_details"/></li>
|
||||
<li t-if="forced_vat">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="forced_vat"/>
|
||||
<li t-if="company.is_company_details_empty"><span t-field="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company address block</strong>
|
||||
<div>Contains the company address.</div>
|
||||
</div>
|
||||
</span></li>
|
||||
<li t-else="">
|
||||
<span t-field="company.company_details">
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company details block</strong>
|
||||
<div>Contains the company details.</div>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
<li t-if="not forced_vat"/>
|
||||
<li t-else="">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'">Tax ID</t>:
|
||||
<span t-esc="forced_vat">US12345671</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -361,7 +367,7 @@
|
||||
<span class="topage"/>
|
||||
</div>
|
||||
<div t-if="report_type == 'pdf' and display_name_in_footer" class="text-muted">
|
||||
<span t-field="o.name"/>
|
||||
<span t-out="o.name">(document name)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -375,14 +381,27 @@
|
||||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/>
|
||||
</div>
|
||||
<div class="col-6 text-end mb4">
|
||||
<div class="mt0 h4" t-field="company.report_header"/>
|
||||
<div class="mt0 h4" t-if="company.report_header" t-field="company.report_header">Company tagline</div>
|
||||
<div name="company_address" class="float-end mb4">
|
||||
<ul class="list-unstyled">
|
||||
<li t-if="company.is_company_details_empty"><t t-esc="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/></li>
|
||||
<li t-else=""><t t-esc="company.company_details"/></li>
|
||||
<li t-if="forced_vat">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="forced_vat"/>
|
||||
<li t-if="company.is_company_details_empty"><span t-field="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company address block</strong>
|
||||
<div>Contains the company address.</div>
|
||||
</div>
|
||||
</span></li>
|
||||
<li t-else="">
|
||||
<span t-field="company.company_details">
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company details block</strong>
|
||||
<div>Contains the company details.</div>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
<li t-if="not forced_vat"/>
|
||||
<li t-else="">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'">Tax ID</t>:
|
||||
<span t-esc="forced_vat">US12345671</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -401,12 +420,12 @@
|
||||
|
||||
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout">
|
||||
<div class="text-center">
|
||||
<div t-field="company.report_footer"/>
|
||||
<div t-field="company.report_footer">Company Report Footer</div>
|
||||
<div t-if="report_type == 'pdf'">
|
||||
Page: <span class="page"/> / <span class="topage"/>
|
||||
</div>
|
||||
<div t-if="report_type == 'pdf' and display_name_in_footer" class="text-muted">
|
||||
<span t-field="o.name"/>
|
||||
<span t-out="o.name">(document name)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -421,11 +440,24 @@
|
||||
</div>
|
||||
<div class="col-5 offset-1" name="company_address">
|
||||
<ul class="list-unstyled">
|
||||
<li t-if="company.is_company_details_empty"><t t-esc="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/></li>
|
||||
<li t-else=""><t t-esc="company.company_details"/></li>
|
||||
<li t-if="forced_vat">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="forced_vat"/>
|
||||
<li t-if="company.is_company_details_empty"><span t-field="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company address block</strong>
|
||||
<div>Contains the company address.</div>
|
||||
</div>
|
||||
</span></li>
|
||||
<li t-else="">
|
||||
<span t-field="company.company_details">
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company details block</strong>
|
||||
<div>Contains the company details.</div>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
<li t-if="not forced_vat"/>
|
||||
<li t-else="">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'">Tax ID</t>:
|
||||
<span t-esc="forced_vat">US12345671</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -448,7 +480,7 @@
|
||||
<span t-else="" t-field="company.company_details"/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="mt0 mb0 h5" t-field="company.report_header"/>
|
||||
<div class="mt0 mb0 h5" t-if="company.report_header" t-field="company.report_header">Company tagline</div>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<ul t-if="report_type == 'pdf'" class="list-inline pagenumber float-end text-center">
|
||||
@@ -465,7 +497,7 @@
|
||||
<div class="col-3 mb4">
|
||||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 45px;" alt="Logo"/>
|
||||
</div>
|
||||
<div class="col-9 text-end" style="margin-top:22px;" t-field="company.report_header" name="moto"/>
|
||||
<div class="col-9 text-end" style="margin-top:22px;" t-if="company.report_header" t-field="company.report_header" name="moto">Company tagline</div>
|
||||
</div>
|
||||
<div t-if="company.logo or company.report_header" class="row zero_min_height">
|
||||
<div class="col-12">
|
||||
@@ -475,11 +507,24 @@
|
||||
<div class="row">
|
||||
<div class="col-6" name="company_address">
|
||||
<ul class="list-unstyled">
|
||||
<li t-if="company.is_company_details_empty"><t t-esc="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/></li>
|
||||
<li t-else=""><t t-esc="company.company_details"/></li>
|
||||
<li t-if="forced_vat">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="forced_vat"/>
|
||||
<li t-if="company.is_company_details_empty"><span t-field="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company address block</strong>
|
||||
<div>Contains the company address.</div>
|
||||
</div>
|
||||
</span></li>
|
||||
<li t-else="">
|
||||
<span t-field="company.company_details">
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company details block</strong>
|
||||
<div>Contains the company details.</div>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
<li t-if="not forced_vat"/>
|
||||
<li t-else="">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'">Tax ID</t>:
|
||||
<span t-esc="forced_vat">US12345671</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -504,7 +549,7 @@
|
||||
Page: <span class="page"/> / <span class="topage"/>
|
||||
</div>
|
||||
<div t-if="report_type == 'pdf' and display_name_in_footer" class="text-muted">
|
||||
<span t-field="o.name"/>
|
||||
<span t-out="o.name">(document name)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user