fix default settings (#15345)

This commit is contained in:
Pawan Mehta 2018-09-07 17:59:10 +05:30 committed by Nabin Hait
parent 8be8345b65
commit 2cc7eb1e94
2 changed files with 6 additions and 3 deletions

View File

@ -864,7 +864,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"default": "",
"description": "Check this to enable a scheduled Daily synchronization routine via scheduler",
"fieldname": "enable_synch",
"fieldtype": "Check",
@ -935,7 +935,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-23 20:52:58.471424",
"modified": "2018-09-07 16:45:44.439834",
"modified_by": "Administrator",
"module": "ERPNext Integrations",
"name": "Amazon MWS Settings",

View File

@ -12,7 +12,10 @@ from amazon_methods import get_products_details, get_orders
class AmazonMWSSettings(Document):
def validate(self):
if self.enable_amazon == 1:
self.enable_synch = 1
setup_custom_fields()
else:
self.enable_synch = 0
def get_products_details(self):
if self.enable_amazon == 1:
@ -25,7 +28,7 @@ class AmazonMWSSettings(Document):
def schedule_get_order_details():
mws_settings = frappe.get_doc("Amazon MWS Settings")
if mws_settings.enable_synch:
if mws_settings.enable_synch and mws_settings.enable_amazon:
after_date = dateutil.parser.parse(mws_settings.after_date).strftime("%Y-%m-%d")
get_orders(after_date = after_date)