Skip to content

fix: persist submitted documents and clear remaining lint findings - #131

Merged
av-dev2 merged 3 commits into
Aakvatech-Limited:version-15-hotfixfrom
av-dev2:fix/av-tools-lint-and-persistence
Aug 26, 2026
Merged

fix: persist submitted documents and clear remaining lint findings#131
av-dev2 merged 3 commits into
Aakvatech-Limited:version-15-hotfixfrom
av-dev2:fix/av-tools-lint-and-persistence

Conversation

@av-dev2

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

Copy link
Copy Markdown
Collaborator

Follow-up to #130, which merged before these three commits landed.

Submitted documents were never linked

purchase_invoice, journal_entry and stock_entry were assigned on self
inside on_submit. Frappe has already written the row by then, so the
assignments were discarded and the link fields stayed empty in the database.

They now go through db_set. Records submitted before this change keep their
empty fields.

Lint

int(round(...)) dropped; round() with one argument already returns an int.

Semgrep waivers

Four findings reviewed and waived, each with the rule name and a reason in the
code.

Rule Why it is waived
frappe-ssti template path is a hardcoded literal in this app, and the template has no include, import or extends. Only context values vary.
override-doctype-class ReportOverride subclasses frappe own Report; this is the documented hook.
frappe-codeinjection-eval Script Report python needs real imports, so safe_exec is not usable. Editing a Report is restricted to System Manager.
frappe-breaks-multitenancy query builder tables built at import in one report file. Only misbehaves on a bench mixing MariaDB and Postgres sites.

The frappe-codeinjection-eval waiver documents the risk rather than removing
it. If Report write access is ever widened beyond System Manager, revisit it.

pre-commit run --all-files passes on this branch.

round() with a single argument already returns an int.
purchase_invoice, journal_entry and stock_entry were assigned on self inside
on_submit. Frappe has already written the row by then, so the assignments were
discarded and the link fields stayed empty.

db_set writes them to the database. Records submitted before this change keep
their empty fields.
Each waiver names the rule and says why.

frappe-ssti: the template path is a hardcoded literal shipped in this app and
the template has no include, import or extends. Only context values vary.

override-doctype-class: ReportOverride subclasses frappe's own Report; this is
the documented hook.

frappe-codeinjection-eval: Script Report python needs real imports, so safe_exec
is not usable. Editing a Report is restricted to System Manager. Revisit if that
write access is ever widened.

frappe-breaks-multitenancy: query builder tables built at import in one report.
Only misbehaves on a bench mixing MariaDB and Postgres sites.
@av-dev2
av-dev2 merged commit b426675 into Aakvatech-Limited:version-15-hotfix Aug 26, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

Backport failed for version-16-hotfix, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin version-16-hotfix
git worktree add -d .worktree/backport-131-to-version-16-hotfix origin/version-16-hotfix
cd .worktree/backport-131-to-version-16-hotfix
git switch --create backport-131-to-version-16-hotfix
git cherry-pick -x 12ed2cb78496b141907e50a815d34fd2630f007e b7272fba5539f9894a6c781642727ae997a45124 0cef17ef7bf5d3b96b01d8d04ffc9dcb5590fb8d

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants