- black: auto-reformatted all 4 Furnitex scripts to PEP 8 style
- isort: sorted imports in setup_furnitex.py and delete_streetwok.py
- codespell: renamed loop variable `ot` → `opp_type` in create_crm_stages()
(codespell flagged `ot` as a misspelling)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Frappe v16's server script sandbox does not allow explicit commits —
the framework manages the transaction automatically after the event
handler runs. Calling frappe.db.commit() inside a DocType Event script
throws AttributeError: module has no attribute 'commit'.
Also adds fix_server_script_commit.py to patch already-deployed instances.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- setup_furnitex_crm_billing.py: creates customer groups, territories, lead
sources (custom Select field), sales persons, payment modes, payment terms
(4 Furnitex-specific templates), T&C templates, price list, CRM custom fields,
sample customers, selling settings, sales stages, opportunity types, and letter head
- delete_streetwok.py: removes all streetwok (Demo) company data (invoices,
GL entries, warehouses, accounts, cost centres, customers) and resets default
company to Furnitex
- update_furnitex_info.py: updates ERPNext with real business details scraped from
furnitex.co.in — company phone/email, billing address, branded letter head, and
Quotation/Invoice/PO T&C templates with legal contact footer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ERPNext v16 ships project fields natively on Purchase Invoice, Purchase
Order, Stock Entry, and Delivery Note. Adding duplicate custom fields
caused UniqueFieldnameError. Now only two custom fields are added:
- Purchase Invoice.is_urd_purchase (new URD toggle)
- Journal Entry.project (only doctype missing it)
Also update profitability report queries to use native 'project' field
instead of 'furnitex_project' on PI, SE, and JE.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ERPNext v16 dropped the per-supplier default_purchase_taxes_and_charges
_template column. URD tax bypass is now entirely handled by the server
script (Before Save on Purchase Invoice) via the is_urd_purchase flag.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- All ERPNext doctypes append company abbr to names (Warehouse, Tax
Template, etc.) — switch existence checks to use filter-based lookup
instead of hardcoded "{name} - Furnitex" strings
- Add safe_insert() helper to absorb DuplicateEntryError gracefully so
re-runs never crash mid-way
- Service items: remove item_defaults entirely (non-stock items have no
warehouse, avoids cross-company warehouse validation error)
- Raw material items: only add item_defaults when a valid Furnitex
warehouse is resolved
- Supplier URD tax default: look up template by title+company filter
rather than bare name string
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ERPNext auto-appends the company abbreviation (e.g. "F") to warehouse
names, not the full company name. Fixed create_warehouses(), the
default_wh reference in raw material items, and the OnSite WIP server
script to all resolve the abbr at runtime via frappe.db.get_value.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a complete ERPNext v16 configuration script for Furnitex, an
interior design and furniture manufacturing company based in Kolkata.
Automates creation of:
- Custom UOMs: SqFt, Rft, Sheet, Bag, Bundle
- Item groups for raw materials and execution services
- Supplier groups including Unregistered (URD) vendor category
- Warehouses: Main Store + dynamic OnSite WIP per project
- Tax templates: No-GST URD purchase, GST 18% purchase/sales
- 10 service items (SqFt + lumpsum billing modes)
- 19 raw material stock items (plywood, laminates, hardware, civil)
- 6 sample suppliers with auto-applied URD tax defaults
- Custom fields to tag Project on PI, PO, SE, DN, JE
- Server scripts for OnSite WIP auto-warehouse and URD tax auto-clear
- Custom Script Report: Furnitex Project Profitability
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>