915b34391c
* chore: Added isort to pre-commit config * chore: Sort imports with isort * chore: Clean up imports with pycln * chore: Sort imports with isort * chore: Fix import issues * chore: Clean up sider issues * chore: Remove import errors from flake8 ignore list * chore: Clean up lint issues
15 lines
438 B
Python
15 lines
438 B
Python
from __future__ import unicode_literals
|
|
|
|
import frappe
|
|
|
|
|
|
def execute():
|
|
frappe.reload_doctype("Pricing Rule")
|
|
|
|
currency = frappe.db.get_default("currency")
|
|
for doc in frappe.get_all('Pricing Rule', fields = ["company", "name"]):
|
|
if doc.company:
|
|
currency = frappe.get_cached_value('Company', doc.company, "default_currency")
|
|
|
|
frappe.db.sql("""update `tabPricing Rule` set currency = %s where name = %s""",(currency, doc.name))
|