clinical_laboratory/lims_management/views/stock_lot_views.xml
2025-07-14 15:08:03 -06:00

67 lines
3.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Vista de Lista para Muestras de Laboratorio -->
<record id="view_lab_sample_list" model="ir.ui.view">
<field name="name">lab.sample.list</field>
<field name="model">stock.lot</field>
<field name="arch" type="xml">
<list string="Lab Samples">
<field name="name"/>
<field name="patient_id"/>
<field name="product_id" string="Sample Type"/>
<field name="collection_date"/>
<field name="collector_id"/>
<field name="container_type"/>
<field name="state" decoration-success="state == 'analyzed'" decoration-info="state == 'in_process'" decoration-muted="state == 'stored' or state == 'disposed'" widget="badge"/>
</list>
</field>
</record>
<!-- Vista de Formulario para Muestras de Laboratorio -->
<record id="view_lab_sample_form" model="ir.ui.view">
<field name="name">lab.sample.form</field>
<field name="model">stock.lot</field>
<field name="arch" type="xml">
<form string="Lab Sample">
<header>
<button name="action_receive" string="Recibir" type="object" class="oe_highlight" invisible="state != 'collected'"/>
<button name="action_start_analysis" string="Iniciar Análisis" type="object" class="oe_highlight" invisible="state != 'received'"/>
<button name="action_complete_analysis" string="Completar Análisis" type="object" class="oe_highlight" invisible="state != 'in_process'"/>
<button name="action_store" string="Almacenar" type="object" invisible="state == 'stored' or state == 'disposed'"/>
<button name="action_dispose" string="Desechar" type="object" invisible="state == 'disposed'"/>
<field name="state" widget="statusbar" statusbar_visible="collected,received,in_process,analyzed,stored"/>
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="patient_id" readonly="state != 'collected'"/>
<field name="request_id"
readonly="state != 'collected'"
domain="[('is_lab_request', '=', True), '|', ('partner_id', '=', False), ('partner_id', '=', patient_id)]"/>
<field name="product_id"
string="Sample Type"
domain="[('is_sample_type', '=', True)]"
options="{'no_create': True, 'no_create_edit': True}"
readonly="state != 'collected'"/>
</group>
<group>
<field name="collection_date" readonly="state != 'collected'"/>
<field name="collector_id" readonly="state != 'collected'"/>
<field name="container_type" readonly="state != 'collected'"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
</data>
</odoo>