Skip to content

fix: sync authotp and weighbridge custom fields via json fixtures (backport of #136) - #139

Merged
av-dev2 merged 7 commits into
Aakvatech-Limited:version-16-hotfixfrom
av-dev2:backport-136-137-to-version-16-hotfix
Aug 31, 2026
Merged

fix: sync authotp and weighbridge custom fields via json fixtures (backport of #136)#139
av-dev2 merged 7 commits into
Aakvatech-Limited:version-16-hotfixfrom
av-dev2:backport-136-137-to-version-16-hotfix

Conversation

@av-dev2

@av-dev2 av-dev2 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Manual, scoped backport of #136, since the automatic backport failed with a cherry-pick conflict.

  • The authotp custom fields (Customer.authotp_validated, Sales Invoice.authotp*) were only created via after_install, so any site where av_tools was already installed before these fields were added never got them.
  • Moved the authotp fields and Vehicle.default_tare_weight into JSON fixtures under patches/custom_fields/custom_fields_json/, which the existing generic av_tools.utils.create_custom_fields.execute loader already runs on both after_install and after_migrate.
  • Removed the now-redundant one-off patch scripts and their hook registrations, including a dead duplicate call in after_migrate.py.

Deliberately out of scope: weighbridge_ticket item-link fields

version-15/version-15-hotfix also carry a weighbridge_ticket Link field on six Item child doctypes. version-16-hotfix does not have that field — it already replaced it with a generic document_type/document_reference/target_document_type/target_document_reference design directly on Weighbridge Ticket, and tests/test_customizations.py::test_weighbridge_and_otp_custom_fields_exist explicitly asserts the old weighbridge_ticket field must not exist. Backporting the old field here would fail that test and reintroduce a superseded pattern, so this PR intentionally leaves that design alone.

Test plan

  • Ran av_tools.utils.create_custom_fields.execute against a v15 test site; confirmed the authotp and Vehicle fields sync correctly via the generic loader.
  • Updated test_weighbridge_and_otp_custom_fields_exist to call the generic create_custom_fields.execute loader instead of importing the now-deleted patch modules directly; the rest of that test (asserting weighbridge_ticket does not exist and the document_reference fields do) is unchanged.
  • Pre-commit hooks pass on the changed files.

@av-dev2
av-dev2 merged commit a8fae30 into Aakvatech-Limited:version-16-hotfix Aug 31, 2026
3 of 4 checks passed
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.

1 participant