128 lines
7.1 KiB
XML
128 lines
7.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<templates xml:space="preserve">
|
|
|
|
<div t-name="stock_barcode.MainComponent" class="o_content o_barcode_client_action" owl="1">
|
|
<div class="o_barcode_header">
|
|
<div class="navbar navbar-expand navbar-dark">
|
|
<nav class="navbar-nav me-auto">
|
|
<button t-on-click="exit" class="o_exit btn nav-link me-4">
|
|
<i class="fa fa-chevron-left"/>
|
|
</button>
|
|
<span class="o_title navbar-text" t-esc="env.model.name"/>
|
|
</nav>
|
|
<nav class="navbar-nav">
|
|
<t t-if="displayBarcodeApplication">
|
|
<button t-if="env.model.formViewId" t-on-click="toggleInformation" class="o_show_information btn nav-link">
|
|
<i class="fa fa-info-circle"/>
|
|
</button>
|
|
<button t-if="mobileScanner" class="o_stock_mobile_barcode btn nav-link" t-on-click="openMobileScanner">
|
|
<i class="fa fa-barcode"/>
|
|
</button>
|
|
<button t-on-click="toggleBarcodeActions" class="o_barcode_actions btn nav-link">
|
|
<i class="fa fa-cog"/>
|
|
</button>
|
|
</t>
|
|
<button t-else="" t-on-click="() => this.toggleBarcodeLines()" class="o_close btn nav-link">
|
|
<i class="fa fa-times"/>
|
|
</button>
|
|
</nav>
|
|
</div>
|
|
<t t-if="displayBarcodeApplication">
|
|
<div t-if="displayNote" class="alert alert-warning text-start mb-0">
|
|
<button type="button" class="close" title="Close" aria-label="Close" t-on-click="hideNote">×</button>
|
|
<t t-esc="env.model.record.note"/>
|
|
</div>
|
|
<div class="o_barcode_lines_header row alert m-0 px-1 "
|
|
t-attf-class="{{displayHeaderInfoAsColumn ? 'flex-column justify-content-center align-items-center' : 'justify-content-between'}}">
|
|
<div t-if="info.warning" class="o_barcode_pic position-relative text-center mt-2 mb-1">
|
|
<i class="fa fa-5x fa-exclamation-triangle"/>
|
|
</div>
|
|
<div name="barcode_messages" class="d-flex align-items-center justify-content-center w-100">
|
|
<span t-if="info.icon" class="fa fa-3x me-3" t-attf-class="fa-{{info.icon}}"/>
|
|
<span class="o_scan_message" t-attf-class="o_{{info.class}}">
|
|
<span t-if="info.warning" name="warning" class="fa fa-exclamation-triangle me-1"/>
|
|
<span t-out="info.message"/>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
<div t-if="displayBarcodeLines && (lines.length || packageLines.length)" class="o_barcode_lines"> <!-- Lines -->
|
|
<t t-foreach="lines" t-as="line" t-key="line.virtual_id">
|
|
<GroupedLineComponent t-if="line.lines" line="line" displayUOM="groups.group_uom"/>
|
|
<LineComponent t-else="" line="line" displayUOM="groups.group_uom"/>
|
|
</t>
|
|
<t t-foreach="packageLines" t-as="line" t-key="line.virtual_id">
|
|
<PackageLineComponent line="line" displayUOM="false"/>
|
|
</t>
|
|
</div>
|
|
<div t-if="displayProductPage"> <!-- Barcode Line Edit Form View -->
|
|
<View type="'form'" mode="'edit'"
|
|
viewId="env.model.lineFormViewId"
|
|
resModel="lineFormViewData.resModel"
|
|
resId="lineFormViewData.resId"
|
|
display="{ controlPanel: false }"
|
|
context="lineFormViewData.context"
|
|
onSave="(record) => this.saveFormView(record)"
|
|
onDiscard="() => this.toggleBarcodeLines()"/>
|
|
</div>
|
|
<div t-if="displayPackageContent"> <!-- Quants (in package) Kanban View -->
|
|
<View type="'kanban'"
|
|
viewId="packageKanbanViewId"
|
|
display="{ controlPanel: false }"
|
|
resModel="'stock.quant'"
|
|
domain="[['package_id', '=', _inspectedPackageId]]"/>
|
|
</div>
|
|
<div t-if="displayInformation"> <!-- Res Model Form View -->
|
|
<View type="'form'" mode="'edit'"
|
|
viewId="env.model.formViewId"
|
|
display="{ controlPanel: false }"
|
|
resModel="props.model"
|
|
resId="props.id"
|
|
onSave="() => this._onRefreshState({ lineId: this._editedLineParams && this._editedLineParams.currentId })"
|
|
onDiscard="() => this.toggleBarcodeLines()"/>
|
|
<ChatterContainer threadModel="props.model" threadId="props.id"/>
|
|
</div>
|
|
<div t-if="displayBarcodeActions" class="o_barcode_settings flex-column h100">
|
|
<t t-foreach="env.model.printButtons" t-as="button" t-key="button.class">
|
|
<button class="btn-lg btn btn-light text-uppercase"
|
|
t-attf-class="{{button.class}}" t-esc="button.name"
|
|
t-on-click="() => this.print(button.action, button.method)"/>
|
|
</t>
|
|
<button t-if="env.model.displayCancelButton"
|
|
t-on-click="cancel"
|
|
class="o_cancel_operation btn-lg btn btn-light text-uppercase">
|
|
Cancel
|
|
</button>
|
|
</div>
|
|
<div t-if="displayBarcodeLines" class="fixed-bottom"> <!-- Footer -->
|
|
<div class="o_barcode_control o_action_buttons d-flex">
|
|
<button class="o_add_line btn btn-secondary text-uppercase" t-on-click="openProductPage">
|
|
<i class="fa fa-plus me-1"/> Add Product
|
|
</button>
|
|
<button t-if="env.model.displayPutInPackButton" t-on-click="putInPack"
|
|
t-att-disabled="!env.model.canPutInPack"
|
|
class="o_put_in_pack btn btn-secondary text-uppercase">
|
|
<i class="fa fa-cube me-1"/> Put In Pack
|
|
</button>
|
|
<button t-if="env.model.displayValidateButton" t-on-click="validate"
|
|
class="btn text-uppercase o_validate_page"
|
|
t-att-disabled="!env.model.canBeValidate"
|
|
t-attf-class="{{highlightValidateButton ? 'btn-success' : 'btn-secondary'}}">
|
|
<i class="fa fa-check me-1"/> Validate
|
|
</button>
|
|
<button t-if="env.model.displayApplyButton" t-on-click="() => this.env.model.apply()"
|
|
class="btn text-uppercase o_apply_page"
|
|
t-att-disabled="env.model.applyOn === 0"
|
|
t-attf-class="{{highlightValidateButton ? 'btn-success' : 'btn-secondary'}}">
|
|
<i class="fa fa-check me-1"/> Apply
|
|
<span t-attf-class="{{highlightValidateButton ? '' : 'text-muted'}}">
|
|
(<t t-esc="env.model.applyOn"/>)
|
|
</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</templates>
|