feat(inventory): edit items in inventory grid
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled

- Added 'Editar' button in inventory rows.

- Reused create modal as create/edit with pre-filled data.

- Added fields: unit, max_stock, tax_rate, description, is_active.

- Added /inventory/categories/all endpoint for flat category selector.

- Price/cost inputs are disabled for users without config.edit_prices.
This commit is contained in:
2026-06-30 19:43:03 +00:00
parent b6679c6d9c
commit 603046cb09
3 changed files with 131 additions and 59 deletions

View File

@@ -2271,6 +2271,22 @@ def list_inventory_subcategories(category_id):
conn.close()
@inventory_bp.route('/categories/all', methods=['GET'])
@require_auth()
def list_all_inventory_categories():
"""Return all active categories (flat, with parent_id) for selectors."""
conn = get_tenant_conn(g.tenant_id)
try:
cur = conn.cursor()
cur.execute(
"SELECT id, name, parent_id FROM categories WHERE is_active = true ORDER BY name"
)
rows = cur.fetchall()
return jsonify({'categories': [{'id': r[0], 'name': r[1], 'parent_id': r[2]} for r in rows]})
finally:
conn.close()
# ─── Global Tier Discounts ───────────────────────
@inventory_bp.route('/tier-discounts', methods=['GET'])