Merge pull request #12022 from saurabh6790/v13-patch-fixes-1
fix: setup record for background color while setting up website theme
This commit is contained in:
commit
5f2dda205c
1 changed files with 14 additions and 0 deletions
|
|
@ -2,9 +2,23 @@ import frappe
|
|||
|
||||
def execute():
|
||||
frappe.reload_doctype('Website Theme')
|
||||
frappe.reload_doc('website', 'doctype', 'website_theme_ignore_app')
|
||||
frappe.reload_doc('website', 'doctype', 'color')
|
||||
|
||||
for theme in frappe.get_all('Website Theme'):
|
||||
doc = frappe.get_doc('Website Theme', theme.name)
|
||||
if not doc.get('custom_scss') and doc.theme_scss:
|
||||
# move old theme to new theme
|
||||
doc.custom_scss = doc.theme_scss
|
||||
|
||||
if doc.background_color:
|
||||
setup_color_record(doc.background_color)
|
||||
|
||||
doc.save()
|
||||
|
||||
def setup_color_record(color):
|
||||
frappe.get_doc({
|
||||
"doctype": "Color",
|
||||
"__newname": color,
|
||||
"color": color,
|
||||
}).save()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue