[go: up one dir, main page]

Skip to content

fix(stock): Grab posting date/time from SABB

  File "apps/frappe/frappe/desk/form/save.py", line 39, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 1136, in run_before_save_methods
    self.run_method("validate")
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 238, in validate
    self.calculate_rate_and_amount()
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 777, in calculate_rate_and_amount
    self.set_basic_rate(reset_outgoing_rate, raise_error_if_no_rate)
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 819, in set_basic_rate
    d.basic_rate = get_valuation_rate(
  File "apps/erpnext/erpnext/stock/stock_ledger.py", line 1714, in get_valuation_rate
    batch_obj = BatchNoValuation(
			sle=frappe._dict(
				{
					"item_code": item_code,
					"warehouse": warehouse,
					"actual_qty": -1,
					"serial_and_batch_bundle": serial_and_batch_bundle,
					# HERE: Missing posting_date, posting_time
				}
			)
		)
  File "apps/erpnext/erpnext/stock/serial_batch_bundle.py", line 627, in __init__
    self.calculate_avg_rate()
  File "apps/erpnext/erpnext/stock/serial_batch_bundle.py", line 647, in calculate_avg_rate
    self.calculate_avg_rate_for_non_batchwise_valuation()
  File "apps/frappe/frappe/utils/deprecations.py", line 18, in wrapper
    return func(*args, **kwargs)
  File "apps/erpnext/erpnext/stock/deprecated_serial_batch.py", line 158, in calculate_avg_rate_for_non_batchwise_valuation
    self.set_balance_value_for_non_batchwise_valuation_batches()
  File "apps/frappe/frappe/utils/deprecations.py", line 18, in wrapper
    return func(*args, **kwargs)
  File "apps/erpnext/erpnext/stock/deprecated_serial_batch.py", line 190, in set_balance_value_for_non_batchwise_valuation_batches
    self.set_balance_value_from_sl_entries()
  File "apps/frappe/frappe/utils/deprecations.py", line 18, in wrapper
    return func(*args, **kwargs)
  File "apps/erpnext/erpnext/stock/deprecated_serial_batch.py", line 200, in set_balance_value_from_sl_entries
    posting_datetime = get_combine_datetime(self.sle.posting_date, self.sle.posting_time)
  File "apps/erpnext/erpnext/stock/utils.py", line 669, in get_combine_datetime
    return datetime.datetime.combine(posting_date, posting_time).replace(microsecond=0)
TypeError: combine() argument 1 must be datetime.date, not None
Edited by Corentin Forler

Merge request reports

Loading