Skip to content

Commit

Permalink
Merge branch 'develop' into multiple_slas
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib authored Jun 3, 2021
2 parents dfc17ba + f899b3a commit cc8467c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion erpnext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from erpnext.hooks import regional_overrides
from frappe.utils import getdate

__version__ = '13.4.0'
__version__ = '13.4.1'

def get_default_company(user=None):
'''Get default company for user'''
Expand Down
11 changes: 6 additions & 5 deletions erpnext/controllers/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals

if "description" in searchfields:
searchfields.remove("description")

columns = ''
extra_searchfields = [field for field in searchfields
if not field in ["name", "item_group", "description"]]
Expand All @@ -216,9 +216,10 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals
if not field in searchfields]
searchfields = " or ".join([field + " like %(txt)s" for field in searchfields])

if filters.get('supplier'):
item_group_list = frappe.get_all('Supplier Item Group', filters = {'supplier': filters.get('supplier')}, fields = ['item_group'])

if filters and isinstance(filters, dict) and filters.get('supplier'):
item_group_list = frappe.get_all('Supplier Item Group',
filters = {'supplier': filters.get('supplier')}, fields = ['item_group'])

item_groups = []
for i in item_group_list:
item_groups.append(i.item_group)
Expand All @@ -227,7 +228,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals

if item_groups:
filters['item_group'] = ['in', item_groups]

description_cond = ''
if frappe.db.count('Item', cache=True) < 50000:
# scan description only if items are less than 50000
Expand Down
29 changes: 14 additions & 15 deletions erpnext/healthcare/doctype/patient/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,20 @@ def after_insert(self):
self.reload() # self.notify_update()

def on_update(self):
if self.customer:
customer = frappe.get_doc('Customer', self.customer)
if self.customer_group:
customer.customer_group = self.customer_group
if self.territory:
customer.territory = self.territory

customer.customer_name = self.patient_name
customer.default_price_list = self.default_price_list
customer.default_currency = self.default_currency
customer.language = self.language
customer.ignore_mandatory = True
customer.save(ignore_permissions=True)
else:
if frappe.db.get_single_value('Healthcare Settings', 'link_customer_to_patient'):
if frappe.db.get_single_value('Healthcare Settings', 'link_customer_to_patient'):
if self.customer:
customer = frappe.get_doc('Customer', self.customer)
if self.customer_group:
customer.customer_group = self.customer_group
if self.territory:
customer.territory = self.territory
customer.customer_name = self.patient_name
customer.default_price_list = self.default_price_list
customer.default_currency = self.default_currency
customer.language = self.language
customer.ignore_mandatory = True
customer.save(ignore_permissions=True)
else:
create_customer(self)

def set_full_name(self):
Expand Down
5 changes: 1 addition & 4 deletions erpnext/payroll/doctype/salary_slip/salary_slip.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,16 +621,13 @@ def update_component_row(self, component_data, amount, component_type, additiona

component_row = self.append(component_type)
for attr in (
'depends_on_payment_days', 'salary_component',
'depends_on_payment_days', 'salary_component', 'abbr',
'do_not_include_in_total', 'is_tax_applicable',
'is_flexible_benefit', 'variable_based_on_taxable_salary',
'exempted_from_income_tax'
):
component_row.set(attr, component_data.get(attr))

abbr = component_data.get('abbr') or component_data.get('salary_component_abbr')
component_row.set('abbr', abbr)

if additional_salary:
component_row.default_amount = 0
component_row.additional_amount = amount
Expand Down

0 comments on commit cc8467c

Please sign in to comment.