Files
jikimo_sf/mrp_mps/static/src/components/line.xml
qihao.gong@jikimo.com 1533ef7be9 新增主生产计划模块
2023-08-15 10:36:04 +08:00

185 lines
14 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="mrp_mps.MpsLineComponent" owl="1">
<tbody class="o_mps_content" t-att-data-id="productionSchedule.id" t-att-data-warehouse_id="'warehouse_id' in productionSchedule and productionSchedule.warehouse_id[0]">
<tr class="bg-light">
<th>
<CheckBox value='isSelected' onChange.bind="(ev) => this.toggleSelection(ev, productionSchedule.id)"/>
</th>
<th scope="col">
<a href="#" class="o_mrp_mps_record_url" t-att-data-res-id="productionSchedule.product_id[0]" t-att-data-model="'product.product'" t-on-click.prevent="_onClickRecordLink"><t t-esc="productionSchedule.product_id[1]"/></a>
<span t-if="'product_uom_id' in productionSchedule" class="text-muted"> by <t t-esc="productionSchedule.product_uom_id[1]"/></span>
<span t-if="'warehouse_id' in productionSchedule"> - <t t-esc="productionSchedule.warehouse_id[1]"/></span>
<span> </span>
<a href="#" role="button" title="Forecast Report" t-attf-class="fa fa-fw fa-area-chart" t-on-click.prevent="_onClickForecastReport"/>
</th>
<th/>
<t t-foreach="productionSchedule.forecast_ids" t-as="forecast" t-key="forecast_index">
<th class="text-end pe-4">
<span t-attf-class="{{! groups.mrp_mps_show_starting_inventory and 'o_hidden' or 'text-end'}}" t-esc="formatFloat(forecast.starting_inventory_qty, false, {'digits': [false, productionSchedule.precision_digits]})" data-bs-toggle="tooltip" data-bs-placement="bottom" title="The forecasted quantity in stock at the beginning of the period."/>
</th>
</t>
</tr>
<tr name="demand_forecast_year_minus_2" t-attf-class="{{! groups.mrp_mps_show_actual_demand_year_minus_2 and 'o_hidden' or ''}}">
<th/>
<th scope="row">
<span>Actual Demand Y-2</span>
</th>
<th/>
<t t-foreach="productionSchedule.forecast_ids" t-as="forecast" t-key="forecast_index">
<th class="text-end pe-4">
<span t-esc="formatFloat(forecast.outgoing_qty_year_minus_2, false, {'digits': [false, productionSchedule.precision_digits]})"/>
</th>
</t>
</tr>
<tr name="demand_forecast_year_minus_1" t-attf-class="{{! groups.mrp_mps_show_actual_demand_year_minus_1 and 'o_hidden' or ''}}">
<th/>
<th scope="row">
<span>Actual Demand Y-1</span>
</th>
<th></th>
<t t-foreach="productionSchedule.forecast_ids" t-as="forecast" t-key="forecast_index">
<th class="text-end pe-4">
<span t-esc="formatFloat(forecast.outgoing_qty_year_minus_1, false, {'digits': [false, productionSchedule.precision_digits]})"/>
</th>
</t>
</tr>
<tr t-ref="forecastRow" name="demand_forecast" t-attf-class="{{! (groups.mrp_mps_show_demand_forecast or groups.mrp_mps_show_actual_demand) and 'o_hidden' or ''}}">
<th/>
<th scope="row">
- <span t-attf-class="{{! groups.mrp_mps_show_actual_demand and 'o_hidden' or ''}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="The confirmed demand, based on the confirmed sales orders.">Actual</span>
<span t-attf-class="{{! (groups.mrp_mps_show_actual_demand and groups.mrp_mps_show_demand_forecast) and 'o_hidden' or ''}}"> / </span>
<span t-attf-class="{{! groups.mrp_mps_show_demand_forecast and 'o_hidden' or ''}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="The forecasted demand. This value has to be entered manually.">Forecasted Demand</span>
</th>
<th></th>
<t t-foreach="productionSchedule.forecast_ids" t-as="forecast" t-key="forecast_index">
<th class="text-end pe-4">
<a href="#"
name="actual_demand"
t-on-click="_onClickOpenDetails"
data-action="action_open_actual_demand_details"
t-att-data-date_index="forecast_index"
t-att-data-date_start="forecast.date_start"
t-att-data-date_stop="forecast.date_stop"
t-attf-class="{{! groups.mrp_mps_show_actual_demand and 'o_hidden' or 'o_mrp_mps_open_details'}}">
<t t-esc="formatFloat(forecast.outgoing_qty, false, {'digits': [false, productionSchedule.precision_digits]})"/>
</a>
<span t-attf-class="{{! (groups.mrp_mps_show_actual_demand and groups.mrp_mps_show_demand_forecast) and 'o_hidden' or ''}}"> / </span>
<input type="text"
t-att-data-date_index="forecast_index"
t-attf-class="text-end form-control o_mrp_mps_input_forcast_qty {{! groups.mrp_mps_show_demand_forecast and 'o_hidden' or groups.mrp_mps_show_actual_demand and 'o_mps_inline' or ''}}"
t-att-value="formatFloat(forecast.forecast_qty, false, {'digits': [false, productionSchedule.precision_digits]})"
t-on-change.stop="(ev) => this._onChangeForecast(ev, productionSchedule.id)"
t-on-focus.prevent="_onFocusInput"/>
</th>
</t>
</tr>
<tr name="indirect_demand" t-attf-class="{{(! groups.mrp_mps_show_indirect_demand or ! productionSchedule.has_indirect_demand) and 'o_hidden' or ''}}">
<th/>
<th scope="row" data-bs-toggle="tooltip" data-bs-placement="bottom" title="The forecasted demand to fulfill the needs in components of the Manufacturing Orders.">
- Indirect Demand Forecast
</th>
<th/>
<t t-foreach="productionSchedule.forecast_ids" t-as="forecast" t-key="forecast_index">
<th t-attf-class="text-end pe-4 {{forecast.indirect_demand_qty == 0 and 'text-muted' or ''}}">
<t t-esc="formatFloat(forecast.indirect_demand_qty, false, {'digits': [false, productionSchedule.precision_digits]})"/>
</th>
</t>
</tr>
<tr t-ref="replenishRow" name="to_replenish" t-attf-class="{{! (groups.mrp_mps_show_to_replenish or groups.mrp_mps_show_actual_replenishment) and 'o_hidden' or ''}}">
<th/>
<th scope="row">
+ <span t-attf-class="{{! groups.mrp_mps_show_actual_replenishment and 'o_hidden' or ''}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="The quantity being replenished, based on the Requests for Quotation and the Manufacturing Orders.">Actual</span>
<span t-attf-class="{{! (groups.mrp_mps_show_actual_replenishment and groups.mrp_mps_show_to_replenish) and 'o_hidden' or ''}}"> / </span>
<span t-attf-class="{{! groups.mrp_mps_show_to_replenish and 'o_hidden' or ''}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="The quantity to replenish through Purchase Orders or Manufacturing Orders.">Suggested Replenishment </span>
<button type="button" title="Replenish" t-attf-class="{{! groups.mrp_mps_show_to_replenish and 'o_hidden' or 'btn btn-secondary o_no_padding o_mrp_mps_procurement'}}"
t-on-click.stop="() => this._onClickReplenish(productionSchedule.id)"
t-on-mouseover.stop="_onMouseOverReplenish"
t-on-mouseout.stop="_onMouseOutReplenish">
Replenish
</button>
</th>
<th class="text-end">
<button type="button" t-attf-class="{{! groups.mrp_mps_show_to_replenish and 'o_hidden' or 'btn btn-link o_no_padding o_mrp_mps_edit'}}" t-on-click.stop="(ev) => this._onClickEdit(ev, productionSchedule.id)">
<t t-esc="productionSchedule.min_to_replenish_qty"/> &#8804;&#8230;&#8804; <t t-esc="productionSchedule.max_to_replenish_qty"/>
</button>
</th>
<t t-foreach="productionSchedule.forecast_ids" t-as="forecast" t-key="forecast_index">
<th t-attf-class="o_forecast_stock text-end pe-4 {{
forecast.to_replenish and 'o_mrp_mps_to_replenish' or ''
}} {{
forecast.forced_replenish and 'o_mrp_mps_forced_replenish' or ''
}}">
<a href="#"
name="actual_replenishment"
t-on-click.prevent="_onClickOpenDetails"
data-action="action_open_actual_replenishment_details"
t-att-data-date_index="forecast_index"
t-att-data-date_start="forecast.date_start"
t-att-data-date_stop="forecast.date_stop"
t-attf-class="o_mrp_mps_open_details {{
! groups.mrp_mps_show_actual_replenishment and 'o_hidden'
}} {{
forecast.to_replenish and 'o_mrp_mps_to_replenish' or ''
}} {{
forecast.forced_replenish and 'o_mrp_mps_forced_replenish' or ''
}}">
<t t-esc="formatFloat(forecast.incoming_qty, false, {'digits': [false, productionSchedule.precision_digits]})"/>
</a>
<span t-attf-class="{{! (groups.mrp_mps_show_actual_replenishment and groups.mrp_mps_show_to_replenish) and 'o_hidden' or ''}}"> / </span>
<div t-attf-class="input-group {{! groups.mrp_mps_show_to_replenish and 'o_hidden' or groups.mrp_mps_show_actual_replenishment and 'o_mps_inline' or ''}}">
<button type="button"
t-if="forecast.replenish_qty_updated"
t-on-click.stop="(ev) => this._onClickAutomaticMode(ev, productionSchedule.id)"
t-att-data-date_index="forecast_index"
class="btn btn-link input-group-addon
o_mrp_mps_automatic_mode fa fa-times
o_no_padding"/>
<input type="text"
t-att-data-date_index="forecast_index"
t-attf-class="form-control text-end
o_mrp_mps_input_replenish_qty
{{forecast.state == 'launched' and 'alert-dark' or
forecast.state == 'to_relaunch' and 'alert-warning' or
forecast.state == 'to_correct' and 'alert-danger' or
forecast.to_replenish and 'alert-success' or
forecast.replenish_qty_updated and 'alert-info' or ''
}} {{
forecast.to_replenish and 'o_mrp_mps_to_replenish' or ''
}} {{
forecast.forced_replenish and 'o_mrp_mps_forced_replenish' or ''
}}"
t-att-value="formatFloat(forecast.replenish_qty, false, {'digits': [false, productionSchedule.precision_digits]})"
t-on-change.stop="(ev) => this._onChangeToReplenish(ev, productionSchedule.id)"
t-on-focus="_onFocusInput"/>
</div>
</th>
</t>
</tr>
<tr name="safety_stock" t-attf-class="{{! (groups.mrp_mps_show_safety_stock or groups.mrp_mps_show_available_to_promise) and 'o_hidden' or ''}}">
<th/>
<th scope="row">
= <span t-attf-class="{{! groups.mrp_mps_show_available_to_promise and 'o_hidden' or ''}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Quantity predicted to be available for sale at the end of the period (= to replenish - actual demand).">ATP</span>
<span t-attf-class="{{! (groups.mrp_mps_show_safety_stock and groups.mrp_mps_show_available_to_promise) and 'o_hidden' or ''}}"> / </span>
<span t-attf-class="{{! groups.mrp_mps_show_safety_stock and 'o_hidden' or ''}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="The forecasted quantity in stock at the end of the period.">Forecasted Stock</span>
</th>
<th class="text-end">
<button type="button" t-attf-class="{{! groups.mrp_mps_show_safety_stock and 'o_hidden' or 'btn btn-link text-muted o_no_padding o_mrp_mps_edit'}}" t-on-click.stop="(ev) => this._onClickEdit(ev, productionSchedule.id)">
<span class="fa fa-bullseye text-muted fa-fw" role="img" aria-label="Forecasted" title="Forecasted"/>
<t t-esc="productionSchedule.forecast_target_qty or 0.0"/>
</button>
</th>
<t t-foreach="productionSchedule.forecast_ids" t-as="forecast" t-key="forecast_index">
<th class="text-end pe-4">
<span t-attf-class="{{! groups.mrp_mps_show_available_to_promise and 'o_hidden' or ''}}" t-esc="formatFloat(forecast.starting_inventory_qty + forecast.replenish_qty - forecast.outgoing_qty, false, {'digits': [false, productionSchedule.precision_digits]})"/>
<span t-attf-class="{{! (groups.mrp_mps_show_safety_stock and groups.mrp_mps_show_available_to_promise) and 'o_hidden' or ''}}"> / </span>
<span t-attf-class="{{forecast.safety_stock_qty &lt; 0 and 'text-danger' or ''}} {{! groups.mrp_mps_show_safety_stock and 'o_hidden' or ''}}" t-esc="formatFloat(forecast.safety_stock_qty, false, {'digits': [false, productionSchedule.precision_digits]})"/>
</th>
</t>
</tr>
</tbody>
</t>
</templates>