diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.json b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.json index 771d1f26e2..607ca4fe1d 100644 --- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.json +++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.json @@ -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", diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py index 7e64915c3f..c0a6b8d705 100644 --- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py +++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py @@ -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)