Files
Odoo-Modules/fusion-plating/fusion_plating_safety/views/fp_sds_views.xml
gsinghpal be611876ad changes
2026-04-12 09:09:50 -04:00

166 lines
7.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Plating product family.
-->
<odoo>
<record id="view_fp_sds_list" model="ir.ui.view">
<field name="name">fp.sds.list</field>
<field name="model">fusion.plating.sds</field>
<field name="arch" type="xml">
<list string="Safety Data Sheets" decoration-danger="state == 'expired'" decoration-warning="state == 'expiring_soon'" decoration-muted="state == 'withdrawn'">
<field name="name"/>
<field name="product_name"/>
<field name="supplier_name"/>
<field name="cas_number"/>
<field name="version"/>
<field name="issue_date"/>
<field name="expiry_date"/>
<field name="hazard_class"/>
<field name="language"/>
<field name="state"/>
</list>
</field>
</record>
<record id="view_fp_sds_form" model="ir.ui.view">
<field name="name">fp.sds.form</field>
<field name="model">fusion.plating.sds</field>
<field name="arch" type="xml">
<form string="Safety Data Sheet">
<header>
<button name="action_mark_withdrawn" type="object" string="Mark Withdrawn" invisible="withdrawn"/>
<button name="action_mark_active" type="object" string="Mark Active" invisible="not withdrawn"/>
<field name="state" widget="statusbar" statusbar_visible="current,expiring_soon,expired,withdrawn"/>
</header>
<sheet>
<widget name="web_ribbon" title="Withdrawn" bg_color="text-bg-secondary" invisible="not withdrawn"/>
<div class="oe_title">
<label for="name"/>
<h1><field name="name" placeholder="e.g. Acme Bright Acid Copper"/></h1>
</div>
<group>
<group string="Product">
<field name="product_name"/>
<field name="cas_number"/>
<field name="hazard_class"/>
<field name="ghs_pictograms" placeholder="GHS01,GHS05,GHS07"/>
<field name="language"/>
</group>
<group string="Supplier &amp; Revision">
<field name="supplier_id"/>
<field name="supplier_name"/>
<field name="version"/>
<field name="issue_date"/>
<field name="expiry_date"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="active" widget="boolean_toggle"/>
</group>
</group>
<notebook>
<page string="Document">
<group>
<field name="attachment_id"/>
</group>
</page>
<page string="Notes">
<field name="notes"/>
</page>
<page string="Linked Chemicals">
<field name="chemical_ids">
<list>
<field name="name"/>
<field name="facility_id"/>
<field name="location"/>
<field name="quantity_on_hand"/>
</list>
</field>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="view_fp_sds_kanban" model="ir.ui.view">
<field name="name">fp.sds.kanban</field>
<field name="model">fusion.plating.sds</field>
<field name="arch" type="xml">
<kanban class="o_fp_sds_kanban">
<field name="id"/>
<field name="name"/>
<field name="product_name"/>
<field name="supplier_name"/>
<field name="hazard_class"/>
<field name="state"/>
<field name="expiry_date"/>
<templates>
<t t-name="card">
<div class="o_fp_card o_fp_sds_card" t-att-data-hazard="record.hazard_class.raw_value" t-att-data-state="record.state.raw_value">
<div class="d-flex align-items-start justify-content-between">
<div>
<strong class="o_fp_card_title"><field name="name"/></strong>
<div class="text-muted small"><field name="product_name"/></div>
</div>
<i class="fa fa-flask text-muted" aria-hidden="true"/>
</div>
<div class="mt-2 small">
<div><field name="supplier_name"/></div>
<div class="text-muted">Expires: <field name="expiry_date"/></div>
<span class="o_fp_badge mt-2 d-inline-block" t-att-data-state="record.state.raw_value">
<field name="state"/>
</span>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_fp_sds_search" model="ir.ui.view">
<field name="name">fp.sds.search</field>
<field name="model">fusion.plating.sds</field>
<field name="arch" type="xml">
<search string="Safety Data Sheets">
<field name="name"/>
<field name="product_name"/>
<field name="supplier_name"/>
<field name="cas_number"/>
<filter string="Current" name="filter_current" domain="[('state', '=', 'current')]"/>
<filter string="Expiring Soon" name="filter_expiring" domain="[('state', '=', 'expiring_soon')]"/>
<filter string="Expired" name="filter_expired" domain="[('state', '=', 'expired')]"/>
<filter string="Withdrawn" name="filter_withdrawn" domain="[('state', '=', 'withdrawn')]"/>
<separator/>
<filter string="Archived" name="filter_inactive" domain="[('active', '=', False)]"/>
<group>
<filter string="Hazard Class" name="group_hazard" context="{'group_by': 'hazard_class'}"/>
<filter string="Status" name="group_state" context="{'group_by': 'state'}"/>
<filter string="Supplier" name="group_supplier" context="{'group_by': 'supplier_id'}"/>
</group>
</search>
</field>
</record>
<record id="action_fp_sds" model="ir.actions.act_window">
<field name="name">SDS Library</field>
<field name="res_model">fusion.plating.sds</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_fp_sds_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Add a Safety Data Sheet
</p>
<p>
Maintain a current SDS for every hazardous product on site.
Under WHMIS / GHS each SDS is valid for three years from
its issue date — refresh from the supplier before expiry.
</p>
</field>
</record>
</odoo>