Compare commits

...

37 Commits

Author SHA1 Message Date
Ameya Shenoy
8cafb5fbbb Merge branch 'staging-fixes' into staging 2018-10-08 07:27:35 +00:00
Ameya Shenoy
0bd254b02b bumped to version 11.0.3-beta.8 2018-10-08 07:27:35 +00:00
rohitwaghchaure
5e466bace4 Removed update_job_card_reference method (#15614) 2018-10-08 12:36:45 +05:30
Shreya Shah
c2857fd2cc fix(setup_taxes): Pop if frappe.message_log (#15611) 2018-10-08 12:35:18 +05:30
Jamsheer
063cf9c582 Jam staging fixes (#15608)
* Test Inpatient Record - Fix

* Test Inpatient Record - Fix
2018-10-08 10:48:42 +05:30
Ameya Shenoy
36be62b927 Merge branch 'staging-fixes' into staging 2018-10-07 07:59:34 +00:00
Ameya Shenoy
cfdd629fd7 bumped to version 11.0.3-beta.7 2018-10-07 07:59:34 +00:00
Ameya Shenoy
272956980d Merge pull request #15606 from codingCoffee/abc
fix: make location from warehouse patch
2018-10-07 13:25:05 +05:30
Ameya Shenoy
f7b5b7beb4 fix: make location from warehouse patch
- optimization by preventing patch execution if Asset doesn't exist
2018-10-07 13:08:00 +05:30
Ameya Shenoy
39903647ae Merge branch 'staging-fixes' into staging 2018-10-07 06:23:22 +00:00
Ameya Shenoy
cd9be8f0a6 bumped to version 11.0.3-beta.6 2018-10-07 06:23:22 +00:00
Shreya Shah
5615cb4735 Set default only if customer_address not found (#15605)
* Set default only if customer_address not found

* Similar fix for Purchase Invoice and shipping_address
2018-10-07 11:42:07 +05:30
Shreya Shah
e7e269d4a4 [Error] Display appropriate msg if company is different for TDS (#15601)
* fix(tds): Display appropriate msg if company is different

* Update tax_withholding_category.py
2018-10-06 17:56:21 +05:30
Ameya Shenoy
b8c1897a80 Merge pull request #15603 from Zlash65/rectify
[Minor] Deferred Expense
2018-10-06 16:43:22 +05:30
Zlash65
58a080a1b1 add voucher detail no while creating gl entry 2018-10-06 16:34:58 +05:30
Ameya Shenoy
29fe8ce114 Merge branch 'staging-fixes' into staging 2018-10-05 09:09:53 +00:00
Ameya Shenoy
538678afc4 bumped to version 11.0.3-beta.5 2018-10-05 09:09:53 +00:00
Ameya Shenoy
ad908779be Merge branch 'master' into staging-fixes 2018-10-05 08:54:58 +00:00
Ameya Shenoy
5eafa5a487 Merge branch 'hotfix' 2018-10-05 08:54:46 +00:00
Ameya Shenoy
97dbb4d125 bumped to version 10.1.56 2018-10-05 08:54:46 +00:00
Shreya Shah
5cff01634e Merge pull request #15593 from Zlash65/fix-mod
[Minor] Item master - get_query for deferred accounts
2018-10-05 14:14:46 +05:30
Shreya Shah
32206029ac Fix Codacy 2018-10-05 14:14:33 +05:30
Shreya Shah
deb9f0e03c Merge pull request #15594 from shreyashah115/tds-report
Handle IndexError if no data found
2018-10-05 14:11:43 +05:30
Shreya Shah
db5ffce742 Merge pull request #15592 from shreyashah115/jv
Allow Reverse JV for all submitted docs
2018-10-05 13:33:11 +05:30
Shreya
0d7bd43367 Handle IndexError if no data found 2018-10-05 13:22:09 +05:30
Zlash65
2123b97d31 add get_query for revenue and expense account 2018-10-05 12:26:32 +05:30
Shreya
4f5214a136 Allow reverse jv for all submitted docs 2018-10-05 12:19:09 +05:30
Saif
00a16a9337 set_item_default was referencing a variable company of "company" (#15576) 2018-10-05 11:54:03 +05:30
Shreya Shah
17ac38ff29 Enable save before saving to update form after save (#15579) 2018-10-05 11:51:13 +05:30
Jamsheer
be6e426fe0 Healthcare Service Unit - added company abbr as suffix (#15590) 2018-10-05 11:38:15 +05:30
Ranjith Kurungadam
dc2bab2b72 fix healthcare patch (#15584) 2018-10-05 11:36:58 +05:30
Valmik
4c61861163 Add Delivery Trip to Delivery Note dashboard (#15587) 2018-10-05 11:36:31 +05:30
Saif
4faea037bb Remove Test Letter Head from GSTR-1 (#15591) 2018-10-05 11:35:01 +05:30
Ameya Shenoy
c4ebbd1322 Merge branch 'staging-fixes' into staging 2018-10-04 13:14:29 +00:00
Ameya Shenoy
2291558c5f bumped to version 11.0.3-beta.4 2018-10-04 13:14:29 +00:00
rohitwaghchaure
d69dc954c7 Merge pull request #15580 from sagarvora/fix-TabError
fix TabError in install_fixtures.py
2018-10-04 17:22:44 +05:30
Sagar Vora
b13b9b4ed3 fix TabError in install_fixtures.py 2018-10-04 11:39:20 +05:30
25 changed files with 584 additions and 561 deletions

View File

@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '10.1.55'
__version__ = '10.1.56'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -157,6 +157,7 @@ def book_deferred_income_or_expense(doc, start_date=None, end_date=None):
"credit": base_amount,
"credit_in_account_currency": amount,
"cost_center": item.cost_center,
"voucher_detail_no": item.name,
'posting_date': booking_end_date,
'project': project
}, account_currency)

View File

@@ -24,7 +24,7 @@ frappe.ui.form.on("Journal Entry", {
}, "fa fa-table");
}
if(frm.doc.docstatus==1 && frm.doc.naming_series=="JV-") {
if(frm.doc.docstatus==1) {
frm.add_custom_button(__('Reverse Journal Entry'), function() {
return erpnext.journal_entry.reverse_journal_entry(frm);
});

View File

@@ -19,6 +19,9 @@ def get_party_tax_withholding_details(ref_doc):
fy = get_fiscal_year(ref_doc.posting_date, company=ref_doc.company)
tax_details = get_tax_withholding_details(tax_withholding_category, fy[0], ref_doc.company)
if not tax_details:
frappe.throw(_('Please set associated account in Tax Withholding Category {0} against Company {1}')
.format(tax_withholding_category, ref_doc.company))
tds_amount = get_tds_amount(ref_doc, tax_details, fy)
tax_row = get_tax_row(tax_details, tds_amount)
return tax_row

View File

@@ -22,17 +22,18 @@ class DuplicatePartyAccountError(frappe.ValidationError): pass
@frappe.whitelist()
def get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True):
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True, party_address=None):
if not party:
return {}
if not frappe.db.exists(party_type, party):
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
return _get_party_details(party, account, party_type,
company, posting_date, bill_date, price_list, currency, doctype, ignore_permissions, fetch_payment_terms_template)
company, posting_date, bill_date, price_list, currency, doctype, ignore_permissions, fetch_payment_terms_template, party_address)
def _get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True):
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False,
fetch_payment_terms_template=True, party_address=None, shipping_address=None):
out = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, bill_date, doctype))
party = out[party_type.lower()]
@@ -45,7 +46,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_group)
out["payment_terms_template"] = get_pyt_term_template(party.name, party_type, company)
set_address_details(out, party, party_type, doctype, company)
set_address_details(out, party, party_type, doctype, company, party_address, shipping_address)
set_contact_details(out, party, party_type)
set_other_values(out, party, party_type)
set_price_list(out, party, party_type, price_list)
@@ -71,19 +72,17 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
return out
def set_address_details(out, party, party_type, doctype=None, company=None):
def set_address_details(out, party, party_type, doctype=None, company=None, party_address=None, shipping_address=None):
billing_address_field = "customer_address" if party_type == "Lead" \
else party_type.lower() + "_address"
out[billing_address_field] = get_default_address(party_type, party.name)
out[billing_address_field] = party_address or get_default_address(party_type, party.name)
if doctype:
out.update(get_fetch_values(doctype, billing_address_field, out[billing_address_field]))
# address display
out.address_display = get_address_display(out[billing_address_field])
# shipping address
if party_type in ["Customer", "Lead"]:
out.shipping_address_name = get_party_shipping_address(party_type, party.name)
out.shipping_address_name = shipping_address or get_party_shipping_address(party_type, party.name)
out.shipping_address = get_address_display(out["shipping_address_name"])
if doctype:
out.update(get_fetch_values(doctype, 'shipping_address_name', out.shipping_address_name))

View File

@@ -8,6 +8,7 @@ frappe.query_reports["TDS Computation Summary"] = {
"fieldname":"company",
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default('company')
},
{

View File

@@ -41,8 +41,10 @@ def get_result(filters):
for supplier in filters.supplier:
tds = frappe.get_doc("Tax Withholding Category", supplier.tax_withholding_category)
rate = [d.tax_withholding_rate for d in tds.rates if d.fiscal_year == filters.fiscal_year][0]
account = [d.account for d in tds.accounts if d.company == filters.company][0]
try:
account = [d.account for d in tds.accounts if d.company == filters.company][0]
except IndexError:
account = []
total_invoiced_amount, tds_deducted = get_invoice_and_tds_amount(supplier.name, account,
filters.company, filters.from_date, filters.to_date)

View File

@@ -68,7 +68,8 @@ class BuyingController(StockController):
# set contact and address details for supplier, if they are not mentioned
if getattr(self, "supplier", None):
self.update_if_missing(get_party_details(self.supplier, party_type="Supplier", ignore_permissions=self.flags.ignore_permissions, doctype=self.doctype, company=self.company))
self.update_if_missing(get_party_details(self.supplier, party_type="Supplier", ignore_permissions=self.flags.ignore_permissions,
doctype=self.doctype, company=self.company, party_address=self.supplier_address))
self.set_missing_item_details(for_validate)

View File

@@ -44,6 +44,7 @@ class SellingController(StockController):
set_default_income_account_for_item(self)
def set_missing_values(self, for_validate=False):
super(SellingController, self).set_missing_values(for_validate)
# set contact and address details for customer, if they are not mentioned
@@ -61,10 +62,10 @@ class SellingController(StockController):
party_details = _get_party_details(self.customer,
ignore_permissions=self.flags.ignore_permissions,
doctype=self.doctype, company=self.company,
fetch_payment_terms_template=fetch_payment_terms_template)
fetch_payment_terms_template=fetch_payment_terms_template,
party_address=self.customer_address, shipping_address=self.shipping_address)
if not self.meta.get_field("sales_team"):
party_details.pop("sales_team")
self.update_if_missing(party_details)
elif getattr(self, "lead", None):

View File

@@ -5,10 +5,19 @@
from __future__ import unicode_literals
from frappe.utils.nestedset import NestedSet
import frappe
class HealthcareServiceUnit(NestedSet):
nsm_parent_field = 'parent_healthcare_service_unit'
def autoname(self):
if self.company:
suffix = " - " + frappe.get_cached_value('Company', self.company, "abbr")
if not self.healthcare_service_unit_name.endswith(suffix):
self.name = self.healthcare_service_unit_name + suffix
else:
self.name = self.healthcare_service_unit_name
def on_update(self):
super(HealthcareServiceUnit, self).on_update()
self.validate_one_root()

View File

@@ -105,7 +105,9 @@ def get_healthcare_service_unit():
parent_service_unit.healthcare_service_unit_name = "All Healthcare Service Units"
parent_service_unit.is_group = 1
parent_service_unit.save(ignore_permissions = True)
service_unit.parent_healthcare_service_unit = "All Healthcare Service Units"
service_unit.parent_healthcare_service_unit = parent_service_unit.name
else:
service_unit.parent_healthcare_service_unit = service_unit_parent_name[0][0]
service_unit.save(ignore_permissions = True)
return service_unit.name
return service_unit

View File

@@ -142,6 +142,7 @@ frappe.ui.form.on('Patient Appointment', {
frm.set_value('service_unit', btn_selected.attr('data-service-unit') || '');
frm.set_value('duration', btn_selected.attr('data-duration'));
d.hide();
frm.enable_save();
frm.save();
frm.enable_save();
}

View File

@@ -12,7 +12,7 @@ app_license = "GNU General Public License (v3)"
source_link = "https://github.com/frappe/erpnext"
develop_version = '11.x.x-develop'
staging_version = '11.0.3-beta.3'
staging_version = '11.0.3-beta.8'
error_report_email = "support@erpnext.com"

View File

@@ -141,9 +141,6 @@ class JobCard(Document):
self.db_set('status', status)
def update_job_card_reference(name, fieldname, value):
frappe.db.set_value('Job Card', name, fieldname, value)
@frappe.whitelist()
def make_material_request(source_name, target_doc=None):
def update_item(obj, target, source_parent):

View File

@@ -6,6 +6,7 @@ import frappe
from frappe.utils.nestedset import rebuild_tree
def execute():
if not frappe.db.get_value('Asset', {'docstatus': ('<', 2) }, 'name'): return
frappe.reload_doc('assets', 'doctype', 'location')
frappe.reload_doc('stock', 'doctype', 'warehouse')

View File

@@ -15,7 +15,7 @@ def execute():
frappe.reload_doc('accounts', 'doctype', 'loyalty_program')
frappe.reload_doc('accounts', 'doctype', 'sales_invoice_item')
if "healthcare" not in frappe.get_active_domains():
if "Healthcare" not in frappe.get_active_domains():
return
healthcare_custom_field_in_sales_invoice()
@@ -34,24 +34,25 @@ def execute():
frappe.reload_doc(get_doctype_module("Sales Invoice"), 'doctype', 'sales_invoice')
for doc_id in doc_list:
invoice_id = frappe.db.get_value(si_ref_doc, doc_id[0], sales_invoice_referenced_doc[si_ref_doc])
invoice = frappe.get_doc("Sales Invoice", invoice_id)
if invoice.items:
marked = False
if not marked:
if frappe.db.exists("Sales Invoice", invoice_id):
if si_ref_doc == "Lab Test":
template = frappe.db.get_value("Lab Test", doc_id[0], "template")
if template:
item = frappe.db.get_value("Lab Test Template", template, "item")
if item:
frappe.db.sql("""update `tabSales Invoice Item` set reference_dt = '{0}',
reference_dn = '{1}' where parent = '{2}' and item_code='{3}'""".format\
(si_ref_doc, doc_id[0], invoice_id, item))
else:
invoice = frappe.get_doc("Sales Invoice", invoice_id)
for item_line in invoice.items:
marked = True
frappe.db.sql("""
update `tabSales Invoice Item`
set reference_dt = '{0}', reference_dn = '{1}'
where name = '{2}'
""".format(si_ref_doc, doc_id[0], item_line.name))
if not item_line.reference_dn:
item_line.db_set({"reference_dt":si_ref_doc, "reference_dn": doc_id[0]})
break
# Documents mark invoiced for submitted sales invoice
frappe.db.sql("""
update `tab{0}` doc, `tabSales Invoice` si
set doc.invoiced = 1
where si.docstatus = 1 and doc.{1} = si.name
""".format(si_ref_doc, sales_invoice_referenced_doc[si_ref_doc]))
frappe.db.sql("""update `tab{0}` doc, `tabSales Invoice` si
set doc.invoiced = 1 where si.docstatus = 1 and doc.{1} = si.name
""".format(si_ref_doc, sales_invoice_referenced_doc[si_ref_doc]))
def healthcare_custom_field_in_sales_invoice():
frappe.reload_doc('healthcare', 'doctype', 'patient')

View File

@@ -7,7 +7,6 @@
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
"letter_head": "test",
"modified": "2018-01-02 17:56:15.379347",
"modified_by": "Administrator",
"module": "Regional",
@@ -27,4 +26,4 @@
"role": "Auditor"
}
]
}
}

View File

@@ -320,7 +320,7 @@ def add_sale_stages():
{"doctype": "Sales Stage", "stage_name": _("Proposal/Price Quote")},
{"doctype": "Sales Stage", "stage_name": _("Negotiation/Review")}
]
make_fixture_records(records)
make_fixture_records(records)
def make_fixture_records(records):
from frappe.modules import scrub

View File

@@ -50,7 +50,7 @@ def make_tax_account(company, account_name, tax_rate):
"tax_rate": flt(tax_rate) if tax_rate else None
}).insert(ignore_permissions=True, ignore_mandatory=True)
except frappe.NameError:
frappe.message_log.pop()
if frappe.message_log: frappe.message_log.pop()
abbr = frappe.get_cached_value('Company', company, 'abbr')
account = '{0} - {1}'.format(account_name, abbr)
return frappe.get_doc('Account', account)

View File

@@ -14,7 +14,7 @@ def get_data():
'transactions': [
{
'label': _('Related'),
'items': ['Sales Invoice', 'Packing Slip']
'items': ['Sales Invoice', 'Packing Slip', 'Delivery Trip']
},
{
'label': _('Reference'),

View File

@@ -271,6 +271,24 @@ $.extend(erpnext.item, {
}
}
frm.fields_dict['deferred_revenue_account'].get_query = function() {
return {
filters: {
'root_type': 'Liability',
"is_group": 0
}
}
}
frm.fields_dict['deferred_expense_account'].get_query = function() {
return {
filters: {
'root_type': 'Asset',
"is_group": 0
}
}
}
frm.fields_dict.customer_items.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) {
return { query: "erpnext.controllers.queries.customer_query" }
}
@@ -707,4 +725,4 @@ frappe.ui.form.on("UOM Conversion Detail", {
});
}
}
})
})

View File

@@ -951,7 +951,7 @@ def set_item_default(item_code, company, fieldname, value):
return
# no row found, add a new row for the company
d = item.append('item_defaults', {fieldname: value, company: company})
d = item.append('item_defaults', {fieldname: value, "company": company})
d.db_insert()
item.clear_cache()

View File

@@ -15,7 +15,6 @@ from erpnext.controllers.buying_controller import BuyingController
from erpnext.manufacturing.doctype.work_order.work_order import get_item_details
from erpnext.buying.utils import check_for_closed_status, validate_for_items
from erpnext.stock.doctype.item.item import get_item_defaults
from erpnext.manufacturing.doctype.job_card.job_card import update_job_card_reference
from six import string_types
@@ -93,9 +92,6 @@ class MaterialRequest(BuyingController):
if self.material_request_type == 'Purchase':
self.validate_budget()
if self.job_card:
update_job_card_reference(self.job_card, 'material_request', self.name)
def before_save(self):
self.set_status(update=True)
@@ -148,8 +144,6 @@ class MaterialRequest(BuyingController):
def on_cancel(self):
self.update_requested_qty()
self.update_requested_qty_in_production_plan()
if self.job_card:
update_job_card_reference(self.job_card, 'material_request', None)
def update_completed_qty(self, mr_items=None, update_modified=True):
if self.material_request_type == "Purchase":

View File

@@ -17,7 +17,6 @@ from erpnext.stock.utils import get_bin
from erpnext.stock.doctype.serial_no.serial_no import update_serial_nos_after_submit, get_serial_nos
import json
from erpnext.manufacturing.doctype.job_card.job_card import update_job_card_reference
from six import string_types, itervalues, iteritems
@@ -89,10 +88,6 @@ class StockEntry(StockController):
if self.work_order and self.purpose == "Manufacture":
self.update_so_in_serial_number()
if self.job_card:
update_job_card_reference(self.job_card, 'stock_entry', self.name)
def on_cancel(self):
if self.purchase_order and self.purpose == "Subcontract":
@@ -107,9 +102,6 @@ class StockEntry(StockController):
self.make_gl_entries_on_cancel()
self.update_cost_in_project()
if self.job_card:
update_job_card_reference(self.job_card, 'stock_entry', None)
def set_job_card_data(self):
if self.job_card and not self.work_order:
data = frappe.db.get_value('Job Card',