200 lines
11 KiB
XML
200 lines
11 KiB
XML
<odoo>
|
|
<!-- KANBAN -->
|
|
<record id="view_recreacao_crianca_kanban" model="ir.ui.view">
|
|
<field name="name">recreacao.crianca.kanban</field>
|
|
<field name="model">recreacao.crianca</field>
|
|
<field name="arch" type="xml">
|
|
<kanban class="o_kanban_mobile">
|
|
<field name="id"/>
|
|
<field name="name"/>
|
|
<field name="foto"/>
|
|
<field name="status_dia"/>
|
|
<field name="tem_alergia"/>
|
|
<field name="plano_id"/>
|
|
<field name="idade"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban">
|
|
<!-- Foto -->
|
|
<t t-if="record.foto.raw_value">
|
|
<div class="o_kanban_image">
|
|
<img t-att-src="kanban_image('recreacao.crianca', 'foto', record.id.raw_value)" alt="Foto"/>
|
|
</div>
|
|
</t>
|
|
<t t-else="">
|
|
<div class="o_kanban_image">
|
|
<img alt="Sem Foto" src="/base/static/img/avatar_grey.png"/>
|
|
</div>
|
|
</t>
|
|
|
|
<div class="oe_kanban_details">
|
|
<div class="o_kanban_record_top">
|
|
<div class="o_kanban_record_headings">
|
|
<strong class="o_kanban_record_title"><field name="name"/></strong>
|
|
</div>
|
|
<div class="o_dropdown_kanban dropdown">
|
|
<a class="dropdown-toggle o-no-caret btn" role="button" data-bs-toggle="dropdown" href="#" aria-label="Dropdown">
|
|
<span class="fa fa-ellipsis-v"/>
|
|
</a>
|
|
<div class="dropdown-menu" role="menu">
|
|
<a role="menuitem" type="edit" class="dropdown-item">Editar</a>
|
|
<a role="menuitem" type="object" name="action_abrir_historico" class="dropdown-item">Ver Diário</a>
|
|
<!-- CORRIGIDO AQUI: Nome da nova função -->
|
|
<a role="menuitem" type="object" name="action_gerar_cobranca" class="dropdown-item">Gerar Cobrança</a>
|
|
<a role="menuitem" type="delete" class="dropdown-item text-danger">Excluir</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<ul>
|
|
<li><span class="text-muted"><field name="idade"/></span></li>
|
|
<li><span class="badge text-bg-light"><field name="plano_id"/></span></li>
|
|
<li t-if="record.tem_alergia.raw_value">
|
|
<span class="badge text-bg-danger">⚠️ ALÉRGICO</span>
|
|
</li>
|
|
</ul>
|
|
<div class="o_kanban_record_bottom" style="margin-top: 8px;">
|
|
<div class="oe_kanban_bottom_left">
|
|
<button name="action_abrir_whatsapp" type="object" class="btn btn-sm btn-outline-success" style="border-radius: 50%; width: 32px; height: 32px; padding: 0;">
|
|
<i class="fa fa-whatsapp" style="font-size: 18px;"/>
|
|
</button>
|
|
</div>
|
|
<div class="oe_kanban_bottom_right">
|
|
<t t-if="record.status_dia.raw_value == 'ausente'">
|
|
<button name="action_marcar_entrada" type="object" class="btn btn-primary btn-sm">
|
|
<i class="fa fa-sign-in"/> Entrada
|
|
</button>
|
|
</t>
|
|
<t t-if="record.status_dia.raw_value == 'presente'">
|
|
<button name="action_marcar_saida" type="object" class="btn btn-danger btn-sm">
|
|
<i class="fa fa-sign-out"/> Saída
|
|
</button>
|
|
</t>
|
|
<t t-if="record.status_dia.raw_value == 'finalizado'">
|
|
<span class="badge rounded-pill text-bg-secondary">
|
|
<i class="fa fa-home"/> JÁ SAIU
|
|
</span>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- LISTA GERAL -->
|
|
<record id="view_recreacao_crianca_tree" model="ir.ui.view">
|
|
<field name="name">recreacao.crianca.tree</field>
|
|
<field name="model">recreacao.crianca</field>
|
|
<field name="arch" type="xml">
|
|
<tree>
|
|
<field name="name"/>
|
|
<field name="idade"/>
|
|
<field name="responsavel_financeiro_id"/>
|
|
<field name="plano_id"/>
|
|
<field name="status_dia" widget="badge"
|
|
decoration-success="status_dia == 'presente'"
|
|
decoration-muted="status_dia == 'finalizado'"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- FORMULÁRIO -->
|
|
<record id="view_recreacao_crianca_form" model="ir.ui.view">
|
|
<field name="name">recreacao.crianca.form</field>
|
|
<field name="model">recreacao.crianca</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<header>
|
|
<button name="action_marcar_entrada" string="Registrar Entrada" type="object" class="oe_highlight" invisible="status_dia != 'ausente'"/>
|
|
<button name="action_marcar_saida" string="Registrar Saída" type="object" class="btn-danger" invisible="status_dia != 'presente'"/>
|
|
|
|
<!-- CORRIGIDO AQUI: Botão novo -->
|
|
<button name="action_gerar_cobranca" string="Gerar Cobrança" type="object" class="btn-primary"/>
|
|
|
|
<field name="status_dia" widget="statusbar"/>
|
|
</header>
|
|
<sheet>
|
|
<field name="foto" widget="image" class="oe_avatar"/>
|
|
<div class="oe_title">
|
|
<h1><field name="name" placeholder="Nome da Criança"/></h1>
|
|
</div>
|
|
<group>
|
|
<group string="Filiação">
|
|
<field name="mae_id" context="{'default_is_company': False}"/>
|
|
<field name="pai_id" context="{'default_is_company': False}"/>
|
|
<field name="responsavel_financeiro_id"/>
|
|
</group>
|
|
<group string="Plano">
|
|
<field name="plano_id"/>
|
|
<field name="valor_plano"/>
|
|
<field name="data_nascimento"/>
|
|
<field name="idade"/>
|
|
</group>
|
|
</group>
|
|
|
|
<div class="alert alert-danger" role="alert" invisible="not tem_alergia and not toma_remedio">
|
|
<strong>ATENÇÃO:</strong> Criança com restrições médicas!
|
|
</div>
|
|
|
|
<notebook>
|
|
<page string="🏥 Saúde">
|
|
<group>
|
|
<group>
|
|
<field name="tem_alergia"/>
|
|
<field name="alergias" invisible="not tem_alergia"/>
|
|
</group>
|
|
<group>
|
|
<field name="toma_remedio"/>
|
|
<field name="medicamentos" invisible="not toma_remedio"/>
|
|
<field name="horario_medicacao" invisible="not toma_remedio"/>
|
|
</group>
|
|
</group>
|
|
<field name="observacoes_saude"/>
|
|
</page>
|
|
|
|
<page string="Histórico / Diário">
|
|
<field name="diario_ids">
|
|
<tree editable="bottom" default_order="data desc, create_date desc"
|
|
decoration-success="tipo=='entrada'"
|
|
decoration-danger="tipo=='saida'">
|
|
<field name="data"/>
|
|
<field name="hora_registro"/>
|
|
<field name="tipo"/>
|
|
<field name="descricao"/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
|
|
<!-- NOVO: Aba Financeiro -->
|
|
<page string="💲 Financeiro">
|
|
<field name="financeiro_ids" readonly="1">
|
|
<tree decoration-success="status=='pago'" decoration-danger="status=='pendente'">
|
|
<field name="data_vencimento"/>
|
|
<field name="name"/>
|
|
<field name="valor"/>
|
|
<field name="status" widget="badge"/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
|
|
</notebook>
|
|
</sheet>
|
|
<!-- CHATTER (Rodapé para mensagens) -->
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids"/>
|
|
<field name="message_ids"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_recreacao_crianca" model="ir.actions.act_window">
|
|
<field name="name">Alunos</field>
|
|
<field name="res_model">recreacao.crianca</field>
|
|
<field name="view_mode">kanban,tree,form</field>
|
|
</record>
|
|
<menuitem id="menu_recreacao_crianca" name="Painel de Alunos" parent="menu_recreacao_root" action="action_recreacao_crianca" sequence="1"/>
|
|
</odoo> |