[fixes] for tests
This commit is contained in:
parent
82c258948d
commit
131866a11a
@ -188,7 +188,7 @@ def make_purchase_invoice(asset, item_code, gross_purchase_amount, company, post
|
||||
pi = frappe.new_doc("Purchase Invoice")
|
||||
pi.company = company
|
||||
pi.currency = frappe.db.get_value("Company", company, "default_currency")
|
||||
pi.set_posting_date = 1
|
||||
pi.set_posting_time = 1
|
||||
pi.posting_date = posting_date
|
||||
pi.append("items", {
|
||||
"item_code": item_code,
|
||||
|
@ -1046,7 +1046,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
def create_sales_invoice(**args):
|
||||
si = frappe.new_doc("Sales Invoice")
|
||||
args = frappe._dict(args)
|
||||
if si.posting_date:
|
||||
if args.posting_date:
|
||||
si.set_posting_date = 1
|
||||
si.posting_date = args.posting_date or nowdate()
|
||||
|
||||
|
@ -9,6 +9,9 @@ def make_stock_entry(**args):
|
||||
s = frappe.new_doc("Stock Entry")
|
||||
args = frappe._dict(args)
|
||||
|
||||
if args.posting_date or args.posting_time:
|
||||
s.set_posting_time = 1
|
||||
|
||||
if args.posting_date:
|
||||
s.posting_date = args.posting_date
|
||||
if args.posting_time:
|
||||
|
@ -18,7 +18,7 @@ class TransactionBase(StatusUpdater):
|
||||
frappe.db.get_value("Notification Control", None, dt + "_message"))
|
||||
|
||||
def validate_posting_time(self):
|
||||
if not getattr(self, 'set_posting_time', False):
|
||||
if not getattr(self, 'set_posting_time', None):
|
||||
now = now_datetime()
|
||||
self.posting_date = now.strftime('%Y-%m-%d')
|
||||
self.posting_time = now.strftime('%H:%M:%S')
|
||||
|
Loading…
x
Reference in New Issue
Block a user