Merge branch 'version-13-hotfix' into item-tax-templates
This commit is contained in:
commit
572b6df0f2
@ -185,10 +185,10 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
|
||||
for d in gl_map:
|
||||
if d.account == round_off_account:
|
||||
round_off_gle = d
|
||||
if d.debit_in_account_currency:
|
||||
debit_credit_diff -= flt(d.debit_in_account_currency)
|
||||
if d.debit:
|
||||
debit_credit_diff -= flt(d.debit)
|
||||
else:
|
||||
debit_credit_diff += flt(d.credit_in_account_currency)
|
||||
debit_credit_diff += flt(d.credit)
|
||||
round_off_account_exists = True
|
||||
|
||||
if round_off_account_exists and abs(debit_credit_diff) <= (1.0 / (10**precision)):
|
||||
|
@ -4,6 +4,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import erpnext
|
||||
import json
|
||||
from frappe.desk.reportview import get_match_cond, get_filters_cond
|
||||
from frappe.utils import nowdate, getdate
|
||||
from collections import defaultdict
|
||||
@ -198,6 +199,9 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False):
|
||||
conditions = []
|
||||
|
||||
if isinstance(filters, str):
|
||||
filters = json.loads(filters)
|
||||
|
||||
#Get searchfields from meta and use in Item Link field query
|
||||
meta = frappe.get_meta("Item", cached=True)
|
||||
searchfields = meta.get_search_fields()
|
||||
|
@ -280,7 +280,6 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:",
|
||||
"fieldname": "territory",
|
||||
"fieldtype": "Link",
|
||||
"label": "Territory",
|
||||
@ -431,7 +430,7 @@
|
||||
"icon": "fa fa-info-sign",
|
||||
"idx": 195,
|
||||
"links": [],
|
||||
"modified": "2021-01-06 19:42:46.190051",
|
||||
"modified": "2021-06-04 10:11:22.831139",
|
||||
"modified_by": "Administrator",
|
||||
"module": "CRM",
|
||||
"name": "Opportunity",
|
||||
|
@ -332,7 +332,9 @@ scheduler_events = {
|
||||
"erpnext.projects.doctype.project.project.collect_project_status",
|
||||
"erpnext.hr.doctype.shift_type.shift_type.process_auto_attendance_for_all_shifts",
|
||||
"erpnext.support.doctype.issue.issue.set_service_level_agreement_variance",
|
||||
"erpnext.erpnext_integrations.connectors.shopify_connection.sync_old_orders",
|
||||
"erpnext.erpnext_integrations.connectors.shopify_connection.sync_old_orders"
|
||||
],
|
||||
"hourly_long": [
|
||||
"erpnext.stock.doctype.repost_item_valuation.repost_item_valuation.repost_entries"
|
||||
],
|
||||
"daily": [
|
||||
|
@ -497,7 +497,7 @@ class PurchaseReceipt(BuyingController):
|
||||
def update_billing_status(self, update_modified=True):
|
||||
updated_pr = [self.name]
|
||||
for d in self.get("items"):
|
||||
if d.purchase_invoice and d.purchase_invoice_item:
|
||||
if d.get("purchase_invoice") and d.get("purchase_invoice_item"):
|
||||
d.db_set('billed_amt', d.amount, update_modified=update_modified)
|
||||
elif d.purchase_order_item:
|
||||
updated_pr += update_billed_amount_based_on_po(d.purchase_order_item, update_modified)
|
||||
@ -748,4 +748,3 @@ def get_item_account_wise_additional_cost(purchase_document):
|
||||
account.base_amount * item.get(based_on_field) / total_item_cost
|
||||
|
||||
return item_account_wise_cost
|
||||
|
||||
|
@ -37,6 +37,9 @@ class RepostItemValuation(Document):
|
||||
self.db_set('status', status)
|
||||
|
||||
def on_submit(self):
|
||||
if not frappe.flags.in_test:
|
||||
return
|
||||
|
||||
frappe.enqueue(repost, timeout=1800, queue='long',
|
||||
job_name='repost_sle', now=frappe.flags.in_test, doc=self)
|
||||
|
||||
@ -115,12 +118,6 @@ def notify_error_to_stock_managers(doc, traceback):
|
||||
frappe.sendmail(recipients=recipients, subject=subject, message=message)
|
||||
|
||||
def repost_entries():
|
||||
job_log = frappe.get_all('Scheduled Job Log', fields = ['status', 'creation'],
|
||||
filters = {'scheduled_job_type': 'repost_item_valuation.repost_entries'}, order_by='creation desc', limit=1)
|
||||
|
||||
if job_log and job_log[0]['status'] == 'Start' and time_diff_in_hours(now(), job_log[0]['creation']) < 2:
|
||||
return
|
||||
|
||||
riv_entries = get_repost_item_valuation_entries()
|
||||
|
||||
for row in riv_entries:
|
||||
@ -135,9 +132,7 @@ def repost_entries():
|
||||
check_if_stock_and_account_balance_synced(today(), d.name)
|
||||
|
||||
def get_repost_item_valuation_entries():
|
||||
date = add_to_date(now(), hours=-3)
|
||||
|
||||
return frappe.db.sql(""" SELECT name from `tabRepost Item Valuation`
|
||||
WHERE status != 'Completed' and creation <= %s and docstatus = 1
|
||||
ORDER BY timestamp(posting_date, posting_time) asc, creation asc
|
||||
""", date, as_dict=1)
|
||||
""", now(), as_dict=1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user