diff --git a/erpnext/demo/data/asset.json b/erpnext/demo/data/asset.json index 8d76c0d775..23029ca5e3 100644 --- a/erpnext/demo/data/asset.json +++ b/erpnext/demo/data/asset.json @@ -3,42 +3,49 @@ "asset_name": "Macbook Pro - 1", "item_code": "Computer", "gross_purchase_amount": 100000, - "asset_owner": "Company" + "asset_owner": "Company", + "available_for_use_date": "2017-01-02" }, { "asset_name": "Macbook Air - 1", "item_code": "Computer", "gross_purchase_amount": 60000, - "asset_owner": "Company" + "asset_owner": "Company", + "available_for_use_date": "2017-10-02" }, { "asset_name": "Conferrence Table", "item_code": "Table", "gross_purchase_amount": 30000, - "asset_owner": "Company" + "asset_owner": "Company", + "available_for_use_date": "2018-10-02" }, { "asset_name": "Lunch Table", "item_code": "Table", "gross_purchase_amount": 20000, - "asset_owner": "Company" + "asset_owner": "Company", + "available_for_use_date": "2018-06-02" }, { "asset_name": "ERPNext", "item_code": "ERP", "gross_purchase_amount": 100000, - "asset_owner": "Company" + "asset_owner": "Company", + "available_for_use_date": "2018-09-02" }, { "asset_name": "Chair 1", "item_code": "Chair", "gross_purchase_amount": 10000, - "asset_owner": "Company" + "asset_owner": "Company", + "available_for_use_date": "2018-07-02" }, { "asset_name": "Chair 2", "item_code": "Chair", "gross_purchase_amount": 10000, - "asset_owner": "Company" + "asset_owner": "Company", + "available_for_use_date": "2018-07-02" } -] \ No newline at end of file +] diff --git a/erpnext/demo/setup/manufacture.py b/erpnext/demo/setup/manufacture.py index 4db510a18d..d3846369cd 100644 --- a/erpnext/demo/setup/manufacture.py +++ b/erpnext/demo/setup/manufacture.py @@ -58,6 +58,7 @@ def setup_asset(): asset.set_missing_values() asset.make_depreciation_schedule() asset.flags.ignore_validate = True + asset.flags.ignore_mandatory = True asset.save() asset.submit() @@ -66,7 +67,7 @@ def setup_item(): for i in items: item = frappe.new_doc('Item') item.update(i) - if item.item_defaults[0].default_warehouse: + if hasattr(item, 'item_defaults') and item.item_defaults[0].default_warehouse: item.item_defaults[0].company = data.get("Manufacturing").get('company_name') warehouse = frappe.get_all('Warehouse', filters={'warehouse_name': item.item_defaults[0].default_warehouse}, limit=1) if warehouse: diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index 12e3445d3a..35df8dfd51 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -40,7 +40,7 @@ class SalaryStructure(Document): flexi_amount += max_of_component if have_a_flexi and self.max_benefits == 0: frappe.throw(_("Max benefits should be greater than zero to despense flexi")) - if self.max_benefits > flexi_amount: + if have_a_flexi and self.max_benefits > flexi_amount: frappe.throw(_("Total flexi component amount {0} should not be less \ than max benefits {1}").format(flexi_amount, self.max_benefits)) if not have_a_flexi and self.max_benefits > 0: