From aa08fb971659ffd3e801db2954d06277238a6c25 Mon Sep 17 00:00:00 2001 From: igormbq Date: Wed, 4 Nov 2020 11:40:57 -0300 Subject: [PATCH] Add location on Asset to use make_demo --- erpnext/demo/data/asset.json | 21 ++++++++++++++------- erpnext/demo/data/location.json | 22 ++++++++++++++++++++++ erpnext/demo/setup/manufacture.py | 1 + erpnext/demo/user/stock.py | 2 +- 4 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 erpnext/demo/data/location.json diff --git a/erpnext/demo/data/asset.json b/erpnext/demo/data/asset.json index 23029ca5e3..44db2ae9e1 100644 --- a/erpnext/demo/data/asset.json +++ b/erpnext/demo/data/asset.json @@ -4,48 +4,55 @@ "item_code": "Computer", "gross_purchase_amount": 100000, "asset_owner": "Company", - "available_for_use_date": "2017-01-02" + "available_for_use_date": "2017-01-02", + "location": "Main Location" }, { "asset_name": "Macbook Air - 1", "item_code": "Computer", "gross_purchase_amount": 60000, "asset_owner": "Company", - "available_for_use_date": "2017-10-02" + "available_for_use_date": "2017-10-02", + "location": "Avg Location" }, { "asset_name": "Conferrence Table", "item_code": "Table", "gross_purchase_amount": 30000, "asset_owner": "Company", - "available_for_use_date": "2018-10-02" + "available_for_use_date": "2018-10-02", + "location": "Zany Location" }, { "asset_name": "Lunch Table", "item_code": "Table", "gross_purchase_amount": 20000, "asset_owner": "Company", - "available_for_use_date": "2018-06-02" + "available_for_use_date": "2018-06-02", + "location": "Fletcher Location" }, { "asset_name": "ERPNext", "item_code": "ERP", "gross_purchase_amount": 100000, "asset_owner": "Company", - "available_for_use_date": "2018-09-02" + "available_for_use_date": "2018-09-02", + "location":"Main Location" }, { "asset_name": "Chair 1", "item_code": "Chair", "gross_purchase_amount": 10000, "asset_owner": "Company", - "available_for_use_date": "2018-07-02" + "available_for_use_date": "2018-07-02", + "location": "Zany Location" }, { "asset_name": "Chair 2", "item_code": "Chair", "gross_purchase_amount": 10000, "asset_owner": "Company", - "available_for_use_date": "2018-07-02" + "available_for_use_date": "2018-07-02", + "location": "Avg Location" } ] diff --git a/erpnext/demo/data/location.json b/erpnext/demo/data/location.json new file mode 100644 index 0000000000..b521aa08c4 --- /dev/null +++ b/erpnext/demo/data/location.json @@ -0,0 +1,22 @@ +[ + { + "location_name": "Main Location", + "latitude": 40.0, + "longitude": 20.0 + }, + { + "location_name": "Avg Location", + "latitude": 63.0, + "longitude": 99.3 + }, + { + "location_name": "Zany Location", + "latitude": 47.5, + "longitude": 10.0 + }, + { + "location_name": "Fletcher Location", + "latitude": 100.90, + "longitude": 80 + } +] \ No newline at end of file diff --git a/erpnext/demo/setup/manufacture.py b/erpnext/demo/setup/manufacture.py index d3846369cd..7d6b5012ea 100644 --- a/erpnext/demo/setup/manufacture.py +++ b/erpnext/demo/setup/manufacture.py @@ -9,6 +9,7 @@ from erpnext.demo.domains import data from six import iteritems def setup_data(): + import_json("Location") import_json("Asset Category") setup_item() setup_workstation() diff --git a/erpnext/demo/user/stock.py b/erpnext/demo/user/stock.py index f95a6b8331..d44da7d127 100644 --- a/erpnext/demo/user/stock.py +++ b/erpnext/demo/user/stock.py @@ -79,7 +79,7 @@ def make_stock_reconciliation(): if item.qty: item.qty = item.qty - round(random.randint(1, item.qty)) try: - stock_reco.insert(ignore_permissions=True) + stock_reco.insert(ignore_permissions=True, ignore_mandatory=True) stock_reco.submit() frappe.db.commit() except OpeningEntryAccountError: