From 2b2b639492fd4a5e7b7f0b8a639c1ae319d3b83b Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 20 Mar 2015 14:18:09 +0530 Subject: [PATCH] fixes --- erpnext/controllers/accounts_controller.py | 4 ++++ erpnext/projects/doctype/time_log/time_log.py | 3 +-- erpnext/public/css/erpnext.css | 1 + erpnext/public/less/erpnext.less | 1 + erpnext/setup/page/setup_wizard/setup_wizard.py | 3 ++- erpnext/stock/doctype/stock_entry/stock_entry.py | 10 ++++++++-- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 6ba2be8832..c622478728 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -121,6 +121,10 @@ class AccountsController(TransactionBase): args.update(item.as_dict()) if not args.get("transaction_date"): args["transaction_date"] = args.get("posting_date") + + if self.get("is_subcontracted"): + args["is_subcontracted"] = self.is_subcontracted + ret = get_item_details(args) for fieldname, value in ret.items(): diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py index 311746756b..98cfcc54a4 100644 --- a/erpnext/projects/doctype/time_log/time_log.py +++ b/erpnext/projects/doctype/time_log/time_log.py @@ -6,7 +6,6 @@ import frappe, json from frappe import _ from frappe.utils import cstr, flt, get_datetime, get_time, getdate from dateutil.relativedelta import relativedelta -from dateutil.parser import parse class OverlapError(frappe.ValidationError): pass class OverProductionLoggedError(frappe.ValidationError): pass @@ -176,7 +175,7 @@ class TimeLog(Document): """If in overlap, set start as the end point of the overlapping time log""" overlapping = self.get_overlap_for("workstation") if overlapping: - self.from_time = parse(overlapping.to_time) + relativedelta(minutes=10) + self.from_time = get_datetime(overlapping.to_time) + relativedelta(minutes=10) def get_time_log_summary(self): """Returns 'Actual Operating Time'. """ diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css index 7259580b6a..b5f2a2d1e2 100644 --- a/erpnext/public/css/erpnext.css +++ b/erpnext/public/css/erpnext.css @@ -39,6 +39,7 @@ padding-bottom: 100%; background-size: cover; border: 1px solid transparent; + background-position: top center; } .pos-item-area { border: 1px solid #d1d8dd; diff --git a/erpnext/public/less/erpnext.less b/erpnext/public/less/erpnext.less index dde04a4202..830902ad15 100644 --- a/erpnext/public/less/erpnext.less +++ b/erpnext/public/less/erpnext.less @@ -49,6 +49,7 @@ padding-bottom: 100%; background-size: cover; border: 1px solid transparent; + background-position: top center; } .pos-item-area { diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index b07e372e93..51920ccf5b 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -75,9 +75,10 @@ def setup_account(args=None): login_as_first_user(args) - frappe.clear_cache() frappe.db.commit() + frappe.clear_cache() + except: if args: traceback = frappe.get_traceback() diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 823d21e0d4..e93658295e 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -153,10 +153,16 @@ class StockEntry(StockController): frappe.throw(_("Atleast one warehouse is mandatory")) if self.purpose in source_mandatory and not d.s_warehouse: - frappe.throw(_("Source warehouse is mandatory for row {0}").format(d.idx)) + if self.from_warehouse: + d.s_warehouse = self.from_warehouse + else: + frappe.throw(_("Source warehouse is mandatory for row {0}").format(d.idx)) if self.purpose in target_mandatory and not d.t_warehouse: - frappe.throw(_("Target warehouse is mandatory for row {0}").format(d.idx)) + if self.to_warehouse: + d.t_warehouse = self.to_warehouse + else: + frappe.throw(_("Target warehouse is mandatory for row {0}").format(d.idx)) if self.purpose in ["Manufacture", "Repack"]: if validate_for_manufacture_repack: