Monedero configurable por servicio y artículo

- Campo genera_monedero (default true) en servicios e items de inventario
- Puntos proporcionales a las líneas elegibles al liquidar la venta
- Toggle con icono Wallet en Servicios e Inventario
This commit is contained in:
2026-08-14 08:13:16 +00:00
parent c16017e3cf
commit 7bfa140d87
9 changed files with 79 additions and 18 deletions

View File

@@ -1555,7 +1555,7 @@ class SkeenFrontendController(http.Controller):
if not service.exists():
return json_response({'status': 'error', 'message': 'Servicio no encontrado'}, 404)
data = _parse_json_body()
allowed = ['name', 'code', 'category', 'price', 'duration_min', 'package_price', 'package_sessions', 'package_notes', 'description', 'color', 'service_group', 'is_favorite', 'active']
allowed = ['name', 'code', 'category', 'price', 'duration_min', 'package_price', 'package_sessions', 'package_notes', 'description', 'color', 'service_group', 'is_favorite', 'genera_monedero', 'active']
vals = {k: data[k] for k in allowed if k in data}
Servicio = request.env['skeen.servicio'].sudo()
if vals.get('name'):
@@ -1586,6 +1586,7 @@ class SkeenFrontendController(http.Controller):
'color': s.color,
'service_group': s.service_group or '',
'is_favorite': s.is_favorite,
'genera_monedero': s.genera_monedero,
}
# ============================================================
@@ -3290,6 +3291,7 @@ class SkeenFrontendController(http.Controller):
'expiry_date': it.expiry_date.strftime('%Y-%m-%d') if it.expiry_date else None,
'last_count_date': it.last_count_date.strftime('%Y-%m-%d') if it.last_count_date else None,
'active': it.active,
'genera_monedero': it.genera_monedero,
'notes': it.notes or '',
'stock_level': it.stock_level,
}
@@ -3373,7 +3375,7 @@ class SkeenFrontendController(http.Controller):
return json_response({'status': 'error', 'message': 'Item no encontrado'}, 404)
data = _parse_json_body()
allowed = ['name', 'kind', 'sku', 'category', 'unit', 'qty_optimal', 'qty_min',
'cost', 'expiry_date', 'notes', 'active']
'cost', 'expiry_date', 'notes', 'active', 'genera_monedero']
vals = {}
for k in allowed:
if k in data: