mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
refactor(journal entry): replace raw SQL with query builder to unlink asset value adjustment
(cherry picked from commit 5f00239bba)
This commit is contained in:
@@ -448,11 +448,12 @@ class JournalEntry(AccountsController):
|
|||||||
frappe.db.set_value("Journal Entry", self.name, "inter_company_journal_entry_reference", "")
|
frappe.db.set_value("Journal Entry", self.name, "inter_company_journal_entry_reference", "")
|
||||||
|
|
||||||
def unlink_asset_adjustment_entry(self):
|
def unlink_asset_adjustment_entry(self):
|
||||||
frappe.db.sql(
|
AssetValueAdjustment = frappe.qb.DocType("Asset Value Adjustment")
|
||||||
""" update `tabAsset Value Adjustment`
|
(
|
||||||
set journal_entry = null where journal_entry = %s""",
|
frappe.qb.update(AssetValueAdjustment)
|
||||||
self.name,
|
.set(AssetValueAdjustment.journal_entry, None)
|
||||||
)
|
.where(AssetValueAdjustment.journal_entry == self.name)
|
||||||
|
).run()
|
||||||
|
|
||||||
def validate_party(self):
|
def validate_party(self):
|
||||||
for d in self.get("accounts"):
|
for d in self.get("accounts"):
|
||||||
|
|||||||
Reference in New Issue
Block a user