mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
fix: credit limit patch
This commit is contained in:
@@ -21,10 +21,10 @@ def move_credit_limit_to_child_table():
|
|||||||
if frappe.db.has_column('Customer', 'bypass_credit_limit_check_at_sales_order'):
|
if frappe.db.has_column('Customer', 'bypass_credit_limit_check_at_sales_order'):
|
||||||
fields = ", bypass_credit_limit_check_at_sales_order"
|
fields = ", bypass_credit_limit_check_at_sales_order"
|
||||||
|
|
||||||
credit_limit_record = frappe.db.sql(''' SELECT
|
credit_limit_record = frappe.db.sql('''
|
||||||
name, credit_limit
|
SELECT name, credit_limit {0}
|
||||||
{0}
|
FROM `tabCustomer` where credit_limit > 0
|
||||||
FROM `tabCustomer`'''.format(fields), as_dict=1) #nosec
|
'''.format(fields), as_dict=1) #nosec
|
||||||
|
|
||||||
companies = frappe.get_all("Company", 'name')
|
companies = frappe.get_all("Company", 'name')
|
||||||
|
|
||||||
@@ -36,4 +36,5 @@ def move_credit_limit_to_child_table():
|
|||||||
'bypass_credit_limit_check': record.bypass_credit_limit_check_at_sales_order,
|
'bypass_credit_limit_check': record.bypass_credit_limit_check_at_sales_order,
|
||||||
'company': company.name
|
'company': company.name
|
||||||
})
|
})
|
||||||
customer.db_insert()
|
for row in customer.credit_limit_reference:
|
||||||
|
row.db_insert()
|
||||||
|
|||||||
Reference in New Issue
Block a user