{{ message }}
Repository navigation
fix: sanitize restaurant name in URYTable.autoname - #477
Merged
ShahalaKP-Tridz merged 9 commits intoOct 7, 2026
Merged
ShahalaKP-Tridz merged 9 commits into
ShahalaKP-Tridz merged 9 commits into
Conversation
- Новое Frappe-приложение ury_ru поверх URY - Модули: 1C, Fiscal (АТОЛ/ШТРИХ-М/ОФД/54-ФЗ), Payments (Т-Банк/Сбер/СБП), Delivery (Яндекс Еда/Маркет Деливери), Marking (Честный знак), EGAIS, Mercury - ROADMAP.md: цель (аналог iiko), архитектура, этапы, правила разработки
- DESIGN.md: нормативка ФФД 1.05/1.1/1.2, архитектура, модель данных, потоки продажи/возврата, офлайн, НДС-маппинг, особенности АТОЛ и ШТРИХ-М - fiscal_driver.py: абстрактный FiscalDriver + реестр (паттерн URY PaymentTerminalProvider) - receipt.py: сборка чека ФФД из POS Invoice (ставки НДС, типы оплат) - fiscal_hooks.py: doc_events on_submit/on_cancel + async enqueue + журнал - drivers: simulated (эмулятор), atol, shtrih_m (честные заглушки) - doctypes: Fiscal Settings, VAT Mapping, KKT, Fiscal Receipt - hooks.py: подключение doc_events и выбор драйвера по настройкам
Решения владельца по Fiscal: ФФД 1.2 -> Marking, своя смена, чек коррекции с UI. - URY_RU_Fiscal: смена кассы (fiscal_shift.py + URY RU Fiscal Shift), чек коррекции с UI (URY RU Fiscal Correction), register_correction в драйвере - URY_RU_1C: OneCProvider + реестр, CommerceML/simulated, sync по cron - URY_RU_Payments: PaymentProvider (Т-Банк/Сбер/СБП) + simulated - URY_RU_Delivery: DeliveryProvider (Яндекс Еда/Маркет Деливери) + simulated - URY_RU_Marking: MarkingProvider (Честный знак) + ФФД 1.2 + simulated - URY_RU_EGAIS: EgaisProvider (УТМ) + simulated - URY_RU_Mercury: MercuryProvider (ВетИС.API) + simulated - hooks.py: register_providers_default() + scheduler для 1С - Все модули: интерфейс + NoOp (honest failure) + simulated + заглушки + doctypes
- Модули перенесены из лишнего вложенного пакета ury_ru/ury_ru/ в корень приложения ury_ru/ (Frappe резолвит модули через scrub(), ожидая lowercase-директории: URY_RU_1C -> ury_ru_1c) - Переименованы директории модулей в lowercase - Исправлены импорты в hooks.py и модулях (ury_ru.ury_ru_1c.* и т.д.) - Добавлены недостающие контроллеры .py для 22 doctype (без них install-app падает с ImportError)
Переведён интерфейс URY (POS, KDS, доктайпы, отчёты, сообщения об ошибках). Базовые frappe/erpnext/hrms уже имели ru.csv; у ury переводов не было вовсе.
…_Telegram (рассылка отчётов) - Deepseek: анализ показателей + выводы/советы, прогноз потока посетителей, прогноз заказа продуктов/полуфабрикатов (с раскрытием BOM) - Telegram: рассылка отчётов (продажи/клиенты/кухня/заказы) по расписанию - провайдерный паттерн (simulated + реальный HTTP-клиент), scheduler_events - doctype: Settings/Insight/Forecast (deepseek), Settings/Chat/Log (telegram)
Apostrophes (and other non-alphanumeric chars besides '-') in the restaurant name leaked into the naming series, which fails with InvalidNamingSeriesError. Strip them so names like "Victoria's Corner" produce a valid autoname. Fixes ury-erp#101 (bug 2).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes bug 2 of #101.
Problem
URYTable.autoname()builds the naming series prefix withself.restaurant.replace(" ", "-"), which strips spaces but not apostrophes (or any other special character). A restaurant name like "Victoria's Corner" therefore producesVictoria's-.##, andmake_autonamerejects it withInvalidNamingSeriesError.Fix
Strip all characters except
[a-zA-Z0-9-]before collapsing repeated hyphens, so the prefix is always a valid naming series.Tests
Added two unit tests in
test_ury_table.py:test_autoname_sanitizes_restaurant_name— apostrophe/spaces do not leak into the name.test_autoname_keeps_valid_hyphens— normal names still yieldMain-Hall-.##.