refactor: Use db.set_single_value (#35668)

I just applied semgrep autofix. Untested completed, review before merging.

```yaml
- id: frappe-set-value-semantics
  patterns:
    - pattern-either:
      - pattern: frappe.db.set_value($DOCTYPE, None, $...AFTER)
      - pattern: frappe.db.set_value($DOCTYPE, $DOCTYPE, $...AFTER)
  fix: frappe.db.set_single_value($DOCTYPE, $...AFTER)
  message: |
    If $DOCTYPE is a single doctype then using `frappe.db.set_value` is discouraged for setting values in DB. Use db.set_single_value for single doctype instead.
  languages: [python]
  severity: ERROR
```
This commit is contained in:
Ankush Menat
2023-06-13 17:30:38 +05:30
committed by GitHub
parent b43e068852
commit a3ea985348
43 changed files with 124 additions and 142 deletions

View File

@@ -1074,8 +1074,8 @@ def make_bom_for_subcontracted_items():
def set_backflush_based_on(based_on):
frappe.db.set_value(
"Buying Settings", None, "backflush_raw_materials_of_subcontract_based_on", based_on
frappe.db.set_single_value(
"Buying Settings", "backflush_raw_materials_of_subcontract_based_on", based_on
)