| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <odoo> |
| 3 | <record id="product_view_kanban_catalog_purchase_only" model="ir.ui.view"> |
| 4 | <field name="name">product.view.kanban.catalog.purchase_stock</field> |
| 5 | <field name="model">product.product</field> |
| 6 | <field name="inherit_id" ref="purchase.product_view_kanban_catalog_purchase_only"/> |
| 7 | <field name="mode">primary</field> |
| 8 | <field name="arch" type="xml"> |
| 9 | <field name="id" position="after"> |
| 10 | <field name="type"/> |
| 11 | <field name="qty_available"/> |
| 12 | <field name="virtual_available"/> |
| 13 | <field name="monthly_demand"/> |
| 14 | <field name="suggested_qty"/> |
| 15 | </field> |
| 16 | <t name="qty_free" position="attributes"> |
| 17 | <attribute name="invisible">True</attribute> |
| 18 | </t> |
| 19 | <t name="qty_available" position="after"> |
| 20 | <t name="qty_forecasted" t-if="record.qty_available.raw_value != record.virtual_available.raw_value"> |
| 21 | <span> / </span> |
| 22 | <span class="fw-bold" t-att-class="record.virtual_available.raw_value < 0 ? 'text-danger' : ''" t-out="record.virtual_available.raw_value" name="o_kanban_forecasted_qty"/> |
| 23 | <span class="text-muted small ms-1">Forecasted</span> |
| 24 | </t> |
| 25 | </t> |
| 26 | <div name="o_kanban_qty_available_and_on_hand" position="after"> |
| 27 | <div t-if="record.type.raw_value === 'consu' and record.monthly_demand.raw_value != 0" name="kanban_monthly_demand"> |
| 28 | <span class="text-muted small me-1">Monthly Demand:</span> |
| 29 | <span class="fw-bold ms-1" t-esc="Math.round(record.monthly_demand.raw_value *100)/100" name="kanban_monthly_demand_qty"/> |
| 30 | <field name="uom_id" class="text-muted small ms-1" groups="uom.group_uom"/> |
| 31 | <span class="text-muted small ms-1" groups="!uom.group_uom">Units</span> |
| 32 | </div> |
| 33 | <div name="kanban_purchase_suggest" t-if="record.suggested_qty.raw_value != 0"> |
| 34 | <span class="text-info fw-bold fs-5 me-1">Suggest</span> |
| 35 | <span class="text-info fw-bold fs-5 me-1" t-out="record.suggested_qty.raw_value or 0" name="kanban_purchase_suggest_qty" /> |
| 36 | <field name="uom_id" class="text-info fw-bold fs-5 me-1" groups="uom.group_uom"/> |
| 37 | <span class="text-info fw-bold fs-5 me-1" groups="!uom.group_uom">Units</span> |
| 38 | </div> |
| 39 | </div> |
| 40 | </field> |
| 41 | </record> |
| 42 | |
| 43 | <record id="product_view_search_catalog" model="ir.ui.view"> |
| 44 | <field name="name">purchase.view.search.catalog.inherit.purchase_stock</field> |
| 45 | <field name="model">product.product</field> |
| 46 | <field name="mode">extension</field> |
| 47 | <field name="inherit_id" ref="purchase.product_view_search_catalog"/> |
| 48 | <field name="arch" type="xml"> |
| 49 | <xpath expr="//filter[@name='products_in_purchase_order']" position="after"> |
| 50 | <filter string="Suggested" name="suggested" domain="[('suggested_qty', '!=', 0)]"/> |
| 51 | <separator/> |
| 52 | <filter string="To Order" name="products_with_negative_forecast" domain="[('virtual_available', '<', 0)]"/> |
| 53 | <separator/> |
| 54 | </xpath> |
| 55 | </field> |
| 56 | </record> |
| 57 | </odoo> |