fix: patch
This commit is contained in:
parent
c85c243f9c
commit
1358443cdb
@ -406,8 +406,7 @@ class StockController(AccountsController):
|
|||||||
def set_rate_of_stock_uom(self):
|
def set_rate_of_stock_uom(self):
|
||||||
if self.doctype in ["Purchase Receipt", "Purchase Invoice", "Purchase Order", "Sales Invoice", "Sales Order", "Delivery Note", "Quotation"]:
|
if self.doctype in ["Purchase Receipt", "Purchase Invoice", "Purchase Order", "Sales Invoice", "Sales Order", "Delivery Note", "Quotation"]:
|
||||||
for d in self.get("items"):
|
for d in self.get("items"):
|
||||||
if d.conversion_factor:
|
d.stock_uom_rate = d.rate / (d.conversion_factor or 1)
|
||||||
d.stock_uom_rate = d.rate / d.conversion_factor
|
|
||||||
|
|
||||||
def validate_internal_transfer(self):
|
def validate_internal_transfer(self):
|
||||||
if self.doctype in ('Sales Invoice', 'Delivery Note', 'Purchase Invoice', 'Purchase Receipt') \
|
if self.doctype in ('Sales Invoice', 'Delivery Note', 'Purchase Invoice', 'Purchase Receipt') \
|
||||||
|
@ -20,9 +20,11 @@ def execute():
|
|||||||
frappe.clear_cache()
|
frappe.clear_cache()
|
||||||
frappe.flags.warehouse_account_map = {}
|
frappe.flags.warehouse_account_map = {}
|
||||||
|
|
||||||
|
company_wise_data = {}
|
||||||
|
|
||||||
data = frappe.db.sql('''
|
data = frappe.db.sql('''
|
||||||
SELECT
|
SELECT
|
||||||
name, item_code, warehouse, voucher_type, voucher_no, posting_date, posting_time
|
name, item_code, warehouse, voucher_type, voucher_no, posting_date, posting_time, company
|
||||||
FROM
|
FROM
|
||||||
`tabStock Ledger Entry`
|
`tabStock Ledger Entry`
|
||||||
WHERE
|
WHERE
|
||||||
@ -36,6 +38,9 @@ def execute():
|
|||||||
total_sle = len(data)
|
total_sle = len(data)
|
||||||
i = 0
|
i = 0
|
||||||
for d in data:
|
for d in data:
|
||||||
|
if d.company not in company_wise_data:
|
||||||
|
company_wise_data[d.company] = True
|
||||||
|
|
||||||
update_entries_after({
|
update_entries_after({
|
||||||
"item_code": d.item_code,
|
"item_code": d.item_code,
|
||||||
"warehouse": d.warehouse,
|
"warehouse": d.warehouse,
|
||||||
@ -53,7 +58,9 @@ def execute():
|
|||||||
|
|
||||||
print("Reposting General Ledger Entries...")
|
print("Reposting General Ledger Entries...")
|
||||||
|
|
||||||
|
if data:
|
||||||
for row in frappe.get_all('Company', filters= {'enable_perpetual_inventory': 1}):
|
for row in frappe.get_all('Company', filters= {'enable_perpetual_inventory': 1}):
|
||||||
|
if company_wise_data.get(row.name):
|
||||||
update_gl_entries_after(posting_date, posting_time, company=row.name)
|
update_gl_entries_after(posting_date, posting_time, company=row.name)
|
||||||
|
|
||||||
frappe.db.auto_commit_on_many_writes = 0
|
frappe.db.auto_commit_on_many_writes = 0
|
||||||
|
@ -124,7 +124,7 @@ def repost_entries():
|
|||||||
return
|
return
|
||||||
|
|
||||||
for d in frappe.get_all('Company', filters= {'enable_perpetual_inventory': 1}):
|
for d in frappe.get_all('Company', filters= {'enable_perpetual_inventory': 1}):
|
||||||
check_if_stock_and_account_balance_synced(today(), d.company)
|
check_if_stock_and_account_balance_synced(today(), d.name)
|
||||||
|
|
||||||
def get_repost_item_valuation_entries():
|
def get_repost_item_valuation_entries():
|
||||||
date = add_to_date(today(), hours=-12)
|
date = add_to_date(today(), hours=-12)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user