Skip to content

refactor: migrate custom fields from fixtures to exported customizations#167

Open
engahmed1190 wants to merge 2 commits intodevelopfrom
clean_custom_fields_fix
Open

refactor: migrate custom fields from fixtures to exported customizations#167
engahmed1190 wants to merge 2 commits intodevelopfrom
clean_custom_fields_fix

Conversation

@engahmed1190
Copy link
Contributor

Summary

  • Migrated custom fields from fixture-based (custom_field.json) to exported customizations (pos_next/custom/*.json)
  • Removed Print Format fixture in favor of exported print format
  • Removed Custom Field and Print Format entries from hooks.py fixtures

Known Issues — Corrupted / Foreign Fields

This branch contains fields exported from the site database that do NOT belong to POS Next. The export-customizations command dumped ALL custom fields on the site, not just POS Next ones. The following must be cleaned up before merge:

Foreign Custom Fields (from other apps — KSA/UAE localization)

File Field Source Indicator
item.json Item-is_zero_rated KSA/UAE VAT localization is_system_generated: 1, module: null
item.json Item-is_exempt KSA/UAE VAT localization is_system_generated: 1, module: null
sales_invoice.json Sales Invoice-company_trn KSA/UAE localization is_system_generated: 1, module: null, fetches company.tax_id
sales_invoice.json Sales Invoice-customer_name_in_arabic KSA/UAE localization is_system_generated: 1, module: null
sales_invoice.json Sales Invoice-ksa_einv_qr KSA e-invoicing is_system_generated: 1, module: null
sales_invoice_item.json Sales Invoice Item-is_zero_rated KSA/UAE VAT localization is_system_generated: 1, module: null
sales_invoice_item.json Sales Invoice Item-is_exempt KSA/UAE VAT localization is_system_generated: 1, module: null
pos_profile.json POS Profile-custom_brands_table Another feature branch (KCSC) module: null, references POS Brands Detail child table

Site-Specific Property Setters (should NOT be exported)

  • item.json: 7 property_setters (naming_series hidden/options/reqd, item_code hidden/reqd, barcodes hidden, field_order)
  • sales_invoice.json: 14 property_setters (naming_series options, various hidden/print_hide tweaks)
  • sales_invoice_item.json: 4 property_setters (barcode hidden, discount_account, target_warehouse)
  • pos_profile.json: 1 property_setter (field_order)

Site-Specific Custom Perms (already handled by custom_docperm.json fixture)

  • item.json: 9 custom_perms (all ERPNext standard roles + POSNext Cashier — duplicated)
  • sales_invoice.json: 3 custom_perms (duplicated from custom_docperm.json)
  • pos_profile.json: 3 custom_perms (duplicated from custom_docperm.json)

Phantom Field Reference (pre-existing bug)

  • pos_profile.json line 163: "insert_after": "posa_default_sales_order" — this field does NOT exist anywhere in the codebase

Unnecessary Files (zero POS Next customizations)

  • item_barcode.json — only contains a site-specific property_setter
  • packed_item.json — only contains a site-specific property_setter

What SHOULD remain (POS Next only, module: "POS Next")

DocType Field Status
Item custom_company OK
Sales Invoice posa_pos_opening_shift OK
Sales Invoice posa_is_printed OK
POS Profile posa_cash_mode_of_payment OK
POS Profile posa_allow_delete OK
POS Profile posa_block_sale_beyond_available_qty OK (fix insert_after)
Mode of Payment is_wallet_payment OK

Action Required

Each custom JSON file needs to be cleaned to contain only fields with module: "POS Next", remove all foreign property_setters, remove duplicated custom_perms, and delete item_barcode.json and packed_item.json entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants