fix default settings (#15345)
This commit is contained in:
parent
8be8345b65
commit
2cc7eb1e94
@ -864,7 +864,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "1",
|
"default": "",
|
||||||
"description": "Check this to enable a scheduled Daily synchronization routine via scheduler",
|
"description": "Check this to enable a scheduled Daily synchronization routine via scheduler",
|
||||||
"fieldname": "enable_synch",
|
"fieldname": "enable_synch",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
@ -935,7 +935,7 @@
|
|||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-08-23 20:52:58.471424",
|
"modified": "2018-09-07 16:45:44.439834",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "ERPNext Integrations",
|
"module": "ERPNext Integrations",
|
||||||
"name": "Amazon MWS Settings",
|
"name": "Amazon MWS Settings",
|
||||||
|
@ -12,7 +12,10 @@ from amazon_methods import get_products_details, get_orders
|
|||||||
class AmazonMWSSettings(Document):
|
class AmazonMWSSettings(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.enable_amazon == 1:
|
if self.enable_amazon == 1:
|
||||||
|
self.enable_synch = 1
|
||||||
setup_custom_fields()
|
setup_custom_fields()
|
||||||
|
else:
|
||||||
|
self.enable_synch = 0
|
||||||
|
|
||||||
def get_products_details(self):
|
def get_products_details(self):
|
||||||
if self.enable_amazon == 1:
|
if self.enable_amazon == 1:
|
||||||
@ -25,7 +28,7 @@ class AmazonMWSSettings(Document):
|
|||||||
|
|
||||||
def schedule_get_order_details():
|
def schedule_get_order_details():
|
||||||
mws_settings = frappe.get_doc("Amazon MWS Settings")
|
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")
|
after_date = dateutil.parser.parse(mws_settings.after_date).strftime("%Y-%m-%d")
|
||||||
get_orders(after_date = after_date)
|
get_orders(after_date = after_date)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user