Integra C-026: ficha de empleado simplificada

This commit is contained in:
Jorem Juárez committed 2026-08-17 17:27:28 -06:00
commit 50075e886c
3 files changed
+52

No files matched your search

@@ -147,6 +147,21 @@ class HrEmployee(models.Model):
attendance.sudo().with_context(beyond_sistema=True).write(campos)
return attendance
def action_beyond_ver_jornadas(self):
"""C-026b: las horas del empleado a un toque desde su ficha."""
self.ensure_one()
return {
'type': 'ir.actions.act_window',
'name': _('Jornadas de %s', self.name),
'res_model': 'hr.attendance',
'view_mode': 'list,form',
'views': [
(self.env.ref('beyond_attendance_qr.view_jornada_list').id, 'list'),
(self.env.ref('beyond_attendance_qr.view_jornada_form').id, 'form'),
],
'domain': [('employee_id', '=', self.id)],
}
def beyond_total_horas(self):
"""ÚNICA fuente del total de horas (regla §10.6 de Taboada: el
backend calcula todo; el frontend jamás). Total = jornadas cerradas
@@ -45,9 +45,18 @@ class TestBeyondLote5(BeyondChecadorCase):
self.assertNotIn('action_create_user', arch_rol,
"sin 'Crear usuario' para roles Beyond")
self.assertNotIn('hr_org_chart', arch_rol, "sin organigrama")
# C-026b: segundo barrido
self.assertNotIn('work_information', arch_rol, "sin pestaña Trabajo")
self.assertNotIn('personal_information', arch_rol, "sin pestaña Personal")
self.assertNotIn('versions_timeline', arch_rol, "sin línea de contratos")
self.assertIn('hr_settings', arch_rol, "Ajustes se queda: ahí vive el PIN")
self.assertIn('beyond_celular', arch_rol, "lo de Beyond sí está")
self.assertIn('branch_id', arch_rol, "la sucursal se ve arriba")
self.assertIn('action_beyond_ver_jornadas', arch_rol, "sus horas a un toque")
arch_tecnica = self.env['hr.employee'].with_user(
self.env.ref('base.user_admin')).get_view(vista.id, 'form')['arch']
self.assertIn('action_create_user', arch_tecnica,
"la cuenta técnica conserva todo")
self.assertIn('hr_org_chart', arch_tecnica)
self.assertIn('work_information', arch_tecnica)
self.assertIn('personal_information', arch_tecnica)
@@ -63,6 +63,21 @@
<field name="beyond_celular" placeholder="Sin cuenta del checador"
class="w-100 w-sm-75"/>
</h5>
<h5 class="d-flex align-items-baseline mb-0">
<i class="fa fa-building fa-fw me-1 text-primary" title="Sucursal"/>
<field name="branch_id" placeholder="Sin sucursal"
options="{'no_create': True}" class="w-100 w-sm-75"/>
</h5>
</xpath>
<!-- C-026b: sus horas a un toque -->
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_beyond_ver_jornadas" type="object"
class="oe_stat_button" icon="fa-clock-o"
groups="beyond_base.beyond_group_admin_sucursal">
<field name="beyond_horas_totales" widget="statinfo"
string="Horas Beyond"/>
</button>
</xpath>
<!-- C-021: lo nativo que Beyond no usa, solo para la cuenta
@@ -98,6 +113,19 @@
<xpath expr="//div[@name='contract_dates']" position="attributes">
<attribute name="groups">hr.group_hr_manager</attribute>
</xpath>
<!-- C-026b: segundo barrido — pestañas Trabajo y Personal y la
línea de tiempo de versiones/contratos son de RRHH
corporativo, no de una red de salones. Ajustes (hr_settings)
se conserva: ahí vive el PIN del kiosco de respaldo. -->
<xpath expr="//page[@name='work_information']" position="attributes">
<attribute name="groups">base.group_system</attribute>
</xpath>
<xpath expr="//page[@name='personal_information']" position="attributes">
<attribute name="groups">base.group_system</attribute>
</xpath>
<xpath expr="//header//field[@name='version_id']" position="attributes">
<attribute name="groups">base.group_system</attribute>
</xpath>
</field>
</record>
<!-- C-020: buscable por celular -->