* fix demo

* Update asset.json
This commit is contained in:
Saurabh 2018-06-06 15:05:31 +05:30 committed by Nabin Hait
parent cff14793d8
commit eb579a11e1
3 changed files with 18 additions and 10 deletions

View File

@ -3,42 +3,49 @@
"asset_name": "Macbook Pro - 1", "asset_name": "Macbook Pro - 1",
"item_code": "Computer", "item_code": "Computer",
"gross_purchase_amount": 100000, "gross_purchase_amount": 100000,
"asset_owner": "Company" "asset_owner": "Company",
"available_for_use_date": "2017-01-02"
}, },
{ {
"asset_name": "Macbook Air - 1", "asset_name": "Macbook Air - 1",
"item_code": "Computer", "item_code": "Computer",
"gross_purchase_amount": 60000, "gross_purchase_amount": 60000,
"asset_owner": "Company" "asset_owner": "Company",
"available_for_use_date": "2017-10-02"
}, },
{ {
"asset_name": "Conferrence Table", "asset_name": "Conferrence Table",
"item_code": "Table", "item_code": "Table",
"gross_purchase_amount": 30000, "gross_purchase_amount": 30000,
"asset_owner": "Company" "asset_owner": "Company",
"available_for_use_date": "2018-10-02"
}, },
{ {
"asset_name": "Lunch Table", "asset_name": "Lunch Table",
"item_code": "Table", "item_code": "Table",
"gross_purchase_amount": 20000, "gross_purchase_amount": 20000,
"asset_owner": "Company" "asset_owner": "Company",
"available_for_use_date": "2018-06-02"
}, },
{ {
"asset_name": "ERPNext", "asset_name": "ERPNext",
"item_code": "ERP", "item_code": "ERP",
"gross_purchase_amount": 100000, "gross_purchase_amount": 100000,
"asset_owner": "Company" "asset_owner": "Company",
"available_for_use_date": "2018-09-02"
}, },
{ {
"asset_name": "Chair 1", "asset_name": "Chair 1",
"item_code": "Chair", "item_code": "Chair",
"gross_purchase_amount": 10000, "gross_purchase_amount": 10000,
"asset_owner": "Company" "asset_owner": "Company",
"available_for_use_date": "2018-07-02"
}, },
{ {
"asset_name": "Chair 2", "asset_name": "Chair 2",
"item_code": "Chair", "item_code": "Chair",
"gross_purchase_amount": 10000, "gross_purchase_amount": 10000,
"asset_owner": "Company" "asset_owner": "Company",
"available_for_use_date": "2018-07-02"
} }
] ]

View File

@ -58,6 +58,7 @@ def setup_asset():
asset.set_missing_values() asset.set_missing_values()
asset.make_depreciation_schedule() asset.make_depreciation_schedule()
asset.flags.ignore_validate = True asset.flags.ignore_validate = True
asset.flags.ignore_mandatory = True
asset.save() asset.save()
asset.submit() asset.submit()
@ -66,7 +67,7 @@ def setup_item():
for i in items: for i in items:
item = frappe.new_doc('Item') item = frappe.new_doc('Item')
item.update(i) 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') 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) warehouse = frappe.get_all('Warehouse', filters={'warehouse_name': item.item_defaults[0].default_warehouse}, limit=1)
if warehouse: if warehouse:

View File

@ -40,7 +40,7 @@ class SalaryStructure(Document):
flexi_amount += max_of_component flexi_amount += max_of_component
if have_a_flexi and self.max_benefits == 0: if have_a_flexi and self.max_benefits == 0:
frappe.throw(_("Max benefits should be greater than zero to despense flexi")) 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 \ frappe.throw(_("Total flexi component amount {0} should not be less \
than max benefits {1}").format(flexi_amount, self.max_benefits)) than max benefits {1}").format(flexi_amount, self.max_benefits))
if not have_a_flexi and self.max_benefits > 0: if not have_a_flexi and self.max_benefits > 0: