Compare commits

..

41 Commits

Author SHA1 Message Date
mergify[bot]
6ad2684121 fix: dont fetch entire barcode table in get_item_details (#30131) (#30667)
(cherry picked from commit 64905188c4)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-04-10 11:53:28 +05:30
Rohit Waghchaure
1413af8f3a Merge branch 'v12-pre-release' into version-12 2022-02-15 22:29:43 +05:30
Rohit Waghchaure
9a1afeb13b bumped to version 12.29.0 2022-02-15 22:49:43 +05:50
rohitwaghchaure
13a9b304b7 Merge pull request #29817 from rohitwaghchaure/change-log-for-v12-29
chore: change log for v12.29.0
2022-02-15 22:27:38 +05:30
Rohit Waghchaure
ee7ac93ff3 chore: change log for v12.29.0 2022-02-15 19:49:04 +05:30
rohitwaghchaure
3aa4411a0d Merge pull request #29602 from rohitwaghchaure/merge-branch-hotfix-to-pre-release-for-12-29
chore: merge branch 'version-12-hotfix' into 'v12-pre-release'
2022-02-03 13:06:56 +05:30
Rohit Waghchaure
7db947550b chore: merge branch 'version-12-hotfix' into 'v12-pre-release' 2022-02-02 23:20:27 +05:30
Rohit Waghchaure
54cb62c7bf Merge branch 'v12-pre-release' into version-12 2022-01-02 23:41:11 +05:30
Rohit Waghchaure
11ad77f491 bumped to version 12.28.0 2022-01-03 00:01:11 +05:50
rohitwaghchaure
95b0c743d4 Merge pull request #29097 from rohitwaghchaure/change-log-for-v12-28
chore: change log for v12.28.0
2022-01-02 23:38:20 +05:30
Rohit Waghchaure
fee83e8ba4 chore: change log for v12.28.0 2022-01-02 23:28:09 +05:30
rohitwaghchaure
4c5b5607ba Merge pull request #29074 from rohitwaghchaure/merge-hotfix-to-pre-release-for-12-28
chore: Merge branch 'version-12-hotfix' into 'v12-pre-release'
2021-12-30 11:27:41 +05:30
Rohit Waghchaure
00b40c0f3c fix: failing test case 2021-12-30 10:14:14 +05:30
Rohit Waghchaure
ac08379f2b chore: Merge branch 'version-12-hotfix' into 'v12-pre-release' 2021-12-29 23:40:23 +05:30
Rohit Waghchaure
bbffb5d91e Merge branch 'v12-pre-release' into version-12 2021-12-02 20:30:31 +05:30
Rohit Waghchaure
260b9c1885 bumped to version 12.27.0 2021-12-02 20:50:31 +05:50
rohitwaghchaure
034e8bd028 Merge pull request #28695 from rohitwaghchaure/change-log-for-v12-27
chore: change log for v12.27
2021-12-02 20:28:59 +05:30
Rohit Waghchaure
eb8b03f590 chore: change log for v12.27 2021-12-02 20:26:13 +05:30
rohitwaghchaure
a6fd5a69e8 Merge pull request #28674 from rohitwaghchaure/merge-hotfix-to-pre-release-for-12-27
chore: Merge branch 'version-12-hotfix' into 'v12-pre-release'
2021-12-02 11:03:53 +05:30
Rohit Waghchaure
849c795113 fix: test case for fiscal year 2021-12-02 00:03:25 +05:30
Rohit Waghchaure
3647a24f60 chore: Merge branch 'version-12-hotfix' into 'v12-pre-release' 2021-12-01 23:03:34 +05:30
Rohit Waghchaure
52ed3c219b Merge branch 'v12-pre-release' into version-12 2021-10-30 15:04:29 +05:30
Rohit Waghchaure
1e378cfde0 bumped to version 12.26.0 2021-10-30 15:24:29 +05:50
rohitwaghchaure
29f5d434d8 Merge pull request #28158 from rohitwaghchaure/v12-change-log-fix
fix: change log
2021-10-30 15:01:51 +05:30
Rohit Waghchaure
aa0e21e84b fix: change log 2021-10-30 15:00:32 +05:30
rohitwaghchaure
34bf2004bb Merge pull request #28157 from rohitwaghchaure/v12-pre-release
chore: change log for v12.26.0
2021-10-30 14:58:19 +05:30
Rohit Waghchaure
7ac656d737 chore: change log for v12.26.0 2021-10-30 14:44:31 +05:30
rohitwaghchaure
a0e4708470 Merge pull request #28130 from rohitwaghchaure/merge-v12-hotfix-into-pre-release-for-v12-26
chore: Merge branch 'version-12-hotfix' into 'v12-pre-release'
2021-10-29 00:48:30 +05:30
Rohit Waghchaure
e60d7ac09e fix: python2 string formatting 2021-10-28 23:11:53 +05:30
Rohit Waghchaure
d6555e8632 Merge branch 'version-12-hotfix' into 'v12-pre-release' 2021-10-28 22:19:15 +05:30
Rohit Waghchaure
bc960ab35f Merge branch 'v12-pre-release' into version-12 2021-09-20 16:33:16 +05:30
Rohit Waghchaure
f9e9c5f637 bumped to version 12.25.0 2021-09-20 16:53:16 +05:50
rohitwaghchaure
fbc8fb36dd Merge pull request #27599 from rohitwaghchaure/added-change-log-v12-25-0
chore: change log for v12.25.0
2021-09-20 16:31:22 +05:30
Rohit Waghchaure
6359e69503 chore: change log for v12.25.0 2021-09-20 16:28:15 +05:30
rohitwaghchaure
1d68d12b7a Merge pull request #27590 from rohitwaghchaure/merge-v12-hotfix-pre-release-for-v12-24-0
chore: merge version-12-hotfix into version-12-pre-release
2021-09-20 13:26:44 +05:30
Rohit Waghchaure
b7a74aa578 Merge branch 'version-12-hotfix' into merge-v12-hotfix-pre-release-for-v12-24-0 2021-09-20 12:23:03 +05:30
Rohit Waghchaure
73666982c7 Merge branch 'v12-pre-release' into version-12 2021-08-19 20:20:08 +05:30
Rohit Waghchaure
48bd1965e4 bumped to version 12.24.0 2021-08-19 20:40:07 +05:50
rohitwaghchaure
ab84579b0e Merge pull request #27041 from rohitwaghchaure/change-log-v12-24
chore: change log for v12.24.0
2021-08-19 20:18:05 +05:30
Rohit Waghchaure
8064792b8c chore: change log for v12.24.0 2021-08-19 18:46:16 +05:30
rohitwaghchaure
fe6c96cab9 Merge pull request #27037 from rohitwaghchaure/merge-v12-hotfix-to-pre-release
chore: merge v12 hotfix to v12 pre-release
2021-08-19 17:44:46 +05:30
22 changed files with 452 additions and 461 deletions

View File

@@ -16,11 +16,11 @@ jobs:
include:
- name: "Python 2.7 Server Side Test"
python: 2.7
script: bench --site test_site run-tests --app erpnext
script: bench --site test_site run-tests --app erpnext --coverage
- name: "Python 3.6 Server Side Test"
python: 3.6
script: bench --site test_site run-tests --app erpnext
script: bench --site test_site run-tests --app erpnext --coverage
- name: "Python 2.7 Patch Test"
python: 2.7
@@ -74,3 +74,8 @@ install:
- bench get-app erpnext $TRAVIS_BUILD_DIR
- bench start &
- bench --site test_site reinstall --yes
after_script:
- pip install coverage==4.5.4
- pip install python-coveralls
- coveralls -b apps/erpnext -d ../../sites/.coverage

View File

@@ -44,8 +44,6 @@ GNU/General Public License (see [license.txt](license.txt))
The ERPNext code is licensed as GNU General Public License (v3) and the Documentation is licensed as Creative Commons (CC-BY-SA-3.0) and the copyright is owned by Frappe Technologies Pvt Ltd (Frappe) and Contributors.
By contributing to ERPNext, you agree that your contributions will be licensed under its GNU General Public License (v3).
---
## Contributing

View File

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

View File

@@ -29,13 +29,13 @@ class TestFiscalYear(unittest.TestCase):
def test_record_generator():
test_records = [
{
"doctype": "Fiscal Year",
"year": "_Test Short Fiscal Year 2011",
"is_short_year": 1,
"year_end_date": "2011-04-01",
"year_start_date": "2011-12-31"
}
{
"doctype": "Fiscal Year",
"year": "_Test Short Fiscal Year 2011",
"is_short_year": 1,
"year_end_date": "2011-04-01",
"year_start_date": "2011-12-31"
}
]
start = 2012

View File

@@ -1,8 +1,7 @@
{%- from "templates/print_formats/standard_macros.html" import add_header, render_field, print_value -%}
{%- set einvoice = json.loads(doc.signed_einvoice) -%}
<div class="page-break">
{% if doc.signed_einvoice %}
{%- set einvoice = json.loads(doc.signed_einvoice) -%}
<div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}>
{% if letter_head and not no_letterhead %}
<div class="letter-head">{{ letter_head }}</div>
@@ -164,10 +163,4 @@
</tbody>
</table>
</div>
{% else %}
<div class="text-center" style="color: #98A1A9; font-size: 14px;">
You must generate IRN before you can preview GST E-Invoice.
</div>
{% endif %}
</div>
</div>

View File

@@ -49,7 +49,10 @@ class TestAccountBalance(unittest.TestCase):
},
]
self.assertEqual(expected_data, report[1])
expected_data = sorted(expected_data, key=lambda k:k['account'])
output = sorted(report[1], key=lambda k:k['account'])
self.assertEqual(expected_data, output)
def make_sales_invoice():
frappe.set_user("Administrator")

View File

@@ -0,0 +1,13 @@
## Version 12.24.0 Release Notes
### Fixes & Enhancements
- Sales order qty update fails in "Update Items" button ([#26992](https://github.com/frappe/erpnext/pull/26992))
- Speed up validate_account_for_perpetual_inventory ([#26730](https://github.com/frappe/erpnext/pull/26730))
- Deadlock while doing payment reconciliation ([#26674](https://github.com/frappe/erpnext/pull/26674))
- Remove incorrect condition in GLE comparison ([#26713](https://github.com/frappe/erpnext/pull/26713))
- Cannot cancel invoice if IRN cancelled on portal ([#26880](https://github.com/frappe/erpnext/pull/26880))
- Item name is missing into job card ([#26956](https://github.com/frappe/erpnext/pull/26956))
- Removed company filter for Loan Type ([#26463](https://github.com/frappe/erpnext/pull/26463))
- Exchange rate revaluation posting date and precision fixes ([#26629](https://github.com/frappe/erpnext/pull/26629))
- Fixed clearing issue of payment references on setting cost center ([#26548](https://github.com/frappe/erpnext/pull/26548))
- Increase number of supported currency exchanges ([#25722](https://github.com/frappe/erpnext/pull/25722))

View File

@@ -0,0 +1,10 @@
## Version 12.25.0 Release Notes
### Fixes & Enhancements
- Multiple price rules margin. ([#24844](https://github.com/frappe/erpnext/pull/24844))
- Document naming rule not working for subscription invoices ([#27394](https://github.com/frappe/erpnext/pull/27394))
- Prematurely referenced variable in buying controller for subcontracting ([#27333](https://github.com/frappe/erpnext/pull/27333))
- Calculation of gross profit percentage in Gross Profit Report ([#26713](https://github.com/frappe/erpnext/pull/27045))
- Price list rate not fetched for return sales invoice fixed ([#26593](https://github.com/frappe/erpnext/pull/26593))
- Set production plan to completed even on over production ([#27027](https://github.com/frappe/erpnext/pull/27027))
- Add `total_billing_hours` to Sales Invoice ([#26652](https://github.com/frappe/erpnext/pull/26652))

View File

@@ -0,0 +1,8 @@
## ERPNext Version 12.26.0 Release Notes
### Fixes & Enhancements
- Make Gross Profit Report more readable ([#27124](https://github.com/frappe/erpnext/pull/27124))
- Set item uom as stock_uom if it isn't set ([#27623](https://github.com/frappe/erpnext/pull/27623))
- Adding empty row on new maintenance visit ([#27626](https://github.com/frappe/erpnext/pull/27626))
- Employee Leave Balance report should only consider ledgers of transaction type Leave Allocation ([#28017](https://github.com/frappe/erpnext/pull/28017))
- Validate if item exists on uploading items in stock reco ([#27538](https://github.com/frappe/erpnext/pull/27538))

View File

@@ -0,0 +1,9 @@
## ERPNext Version 12.27.0 Release Notes
### Fixes & Enhancements
- Always expect signature in webhook requests for WooCommerce ([#28367](https://github.com/frappe/erpnext/pull/28367))
- Debit & Credit currency in bank transaction ([#28574](https://github.com/frappe/erpnext/pull/28574))
- Incorrect balance in "Warehouse Wise Item Balance and Age" report ([#28583](https://github.com/frappe/erpnext/pull/28583))
- Check if gst_category exists while validating GSTIN ([#28065](https://github.com/frappe/erpnext/pull/28065))
- Skip empty rows while updating unsaved BOM cost ([#28136](https://github.com/frappe/erpnext/pull/28136))
- Remove warehouse filter on Batch field for Material Receipt ([#28195](https://github.com/frappe/erpnext/pull/28195))

View File

@@ -0,0 +1,7 @@
## ERPNext Version 12.28.0 Release Notes
### Fixes & Enhancements
- Set cost center for credit entries while posting Depreciation Entries ([#28908](https://github.com/frappe/erpnext/pull/28908))
- Incorrect amount based on Payment Days in timesheet based salary slip ([#28884](https://github.com/frappe/erpnext/pull/28884))
- Removed rename feature for the Warehouse document ([#28712](https://github.com/frappe/erpnext/pull/28712))
- Actual tax conversion in case of multicurrency invoices ([#28539](https://github.com/frappe/erpnext/pull/28539))

View File

@@ -0,0 +1,5 @@
## ERPNext Version 12.29.0 Release Notes
### Fixes & Enhancements
- Display 'Make Depreciation Entry' only for submitted or partially depreciated Assets ([#29291](https://github.com/frappe/erpnext/pull/29291))

View File

@@ -226,7 +226,7 @@ def new_bank_transaction(transaction):
try:
tags += transaction["category"]
tags += ["Plaid Cat. {}".format(transaction["category_id"])]
except (KeyError, TypeError):
except KeyError:
pass
if not frappe.db.exists("Bank Transaction", dict(transaction_id=transaction["transaction_id"])):
@@ -273,4 +273,4 @@ def automatic_synchronization():
@frappe.whitelist()
def get_link_token_for_update(access_token):
plaid = PlaidConnector(access_token)
return plaid.get_link_token(update_mode=True)
return plaid.get_link_token(update_mode=True)

View File

@@ -696,7 +696,7 @@ class SalarySlip(TransactionBase):
# apply rounding
if frappe.get_cached_value("Salary Component", row.salary_component, "round_to_the_nearest_integer"):
amount, additional_amount = rounded(amount or 0), rounded(additional_amount or 0)
amount, additional_amount = rounded(amount), rounded(additional_amount)
return amount, additional_amount

View File

@@ -138,8 +138,6 @@ def update_employee(employee, details, date=None, cancel=False):
new_data = getdate(new_data)
elif fieldtype =="Datetime" and new_data:
new_data = get_datetime(new_data)
elif fieldtype in ["Currency", "Float"] and new_data:
new_data = flt(new_data)
setattr(employee, item.fieldname, new_data)
if item.fieldname in ["department", "designation", "branch"]:
internal_work_history[item.fieldname] = item.new

View File

@@ -9,10 +9,6 @@
"section_break_2",
"sandbox_mode",
"credentials",
"advanced_settings_section",
"client_id",
"column_break_8",
"client_secret",
"auth_token",
"token_expiry"
],
@@ -52,32 +48,12 @@
"fieldname": "sandbox_mode",
"fieldtype": "Check",
"label": "Sandbox Mode"
},
{
"collapsible": 1,
"fieldname": "advanced_settings_section",
"fieldtype": "Section Break",
"label": "Advanced Settings"
},
{
"fieldname": "client_id",
"fieldtype": "Data",
"label": "Client ID"
},
{
"fieldname": "client_secret",
"fieldtype": "Password",
"label": "Client Secret"
},
{
"fieldname": "column_break_8",
"fieldtype": "Column Break"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-11-16 19:50:28.029517",
"modified": "2021-01-13 12:04:49.449199",
"modified_by": "Administrator",
"module": "Regional",
"name": "E Invoice Settings",

View File

@@ -23,5 +23,9 @@
"StateCesAmt": "{item.state_cess_amount}",
"StateCesNonAdvlAmt": "{item.state_cess_nadv_amount}",
"OthChrg": "{item.other_charges}",
"TotItemVal": "{item.total_value}"
"TotItemVal": "{item.total_value}",
"BchDtls": {{
"Nm": "{item.batch_no}",
"ExpDt": "{item.batch_expiry_date}"
}}
}}

View File

@@ -36,7 +36,6 @@ def validate_eligibility(doc):
return False
invalid_company = not frappe.db.get_value('E Invoice User', { 'company': doc.get('company') })
invalid_company_gstin = not frappe.db.get_value('E Invoice User', {'gstin': doc.get('company_gstin')})
invalid_supply_type = doc.get('gst_category') not in ['Registered Regular', 'SEZ', 'Overseas', 'Deemed Export']
company_transaction = doc.get('billing_address_gstin') == doc.get('company_gstin')
@@ -45,7 +44,7 @@ def validate_eligibility(doc):
no_taxes_applied = not doc.get('taxes') and not doc.get('gst_category') == 'Overseas'
has_non_gst_item = any(d for d in doc.get('items', []) if d.get('is_non_gst'))
if invalid_company or invalid_company_gstin or invalid_supply_type or company_transaction or no_taxes_applied or has_non_gst_item:
if invalid_company or invalid_supply_type or company_transaction or no_taxes_applied or has_non_gst_item:
return False
return True
@@ -201,6 +200,8 @@ def get_item_list(invoice):
item.taxable_value = abs(item.taxable_value)
item.discount_amount = 0
item.batch_expiry_date = frappe.db.get_value('Batch', d.batch_no, 'expiry_date') if d.batch_no else None
item.batch_expiry_date = format_date(item.batch_expiry_date, 'dd/mm/yyyy') if item.batch_expiry_date else None
item.is_service_item = 'Y' if item.gst_hsn_code and item.gst_hsn_code[:2] == "99" else 'N'
item.serial_no = ""
@@ -307,7 +308,7 @@ def update_other_charges(tax_row, invoice_value_details, gst_accounts_list, invo
def get_payment_details(invoice):
payee_name = invoice.company
mode_of_payment = ""
mode_of_payment = ', '.join([d.mode_of_payment for d in invoice.payments])
paid_amount = invoice.base_paid_amount
outstanding_amount = invoice.outstanding_amount
@@ -458,16 +459,10 @@ def make_einvoice(invoice):
try:
einvoice = safe_json_load(einvoice)
einvoice = santize_einvoice_fields(einvoice)
except json.JSONDecodeError:
raise
except Exception:
show_link_to_error_log(invoice, einvoice)
try:
validate_totals(einvoice)
except Exception:
log_error(einvoice)
raise
validate_totals(einvoice)
return einvoice
@@ -539,14 +534,7 @@ def safe_json_load(json_string):
pos = e.pos
start, end = max(0, pos-20), min(len(json_string)-1, pos+20)
snippet = json_string[start:end]
frappe.throw(
_(
"Error in input data. Please check for any special characters near following input: <br> {}"
).format(snippet),
title=_("Invalid JSON"),
exc=e,
)
frappe.throw(_("Error in input data. Please check for any special characters near following input: <br> {}").format(snippet))
def throw_error_list(errors, title):
if len(errors) > 1:
@@ -623,17 +611,10 @@ class GSPConnector():
request_log.save(ignore_permissions=True)
frappe.db.commit()
def get_client_credentials(self):
if self.e_invoice_settings.client_id and self.e_invoice_settings.client_secret:
return self.e_invoice_settings.client_id, self.e_invoice_settings.get_password('client_secret')
return frappe.conf.einvoice_client_id, frappe.conf.einvoice_client_secret
def fetch_auth_token(self):
client_id, client_secret = self.get_client_credentials()
headers = {
'gspappid': client_id,
'gspappsecret': client_secret
'gspappid': frappe.conf.einvoice_client_id,
'gspappsecret': frappe.conf.einvoice_client_secret
}
res = {}
try:
@@ -776,13 +757,12 @@ class GSPConnector():
headers = self.get_headers()
eway_bill_details = get_eway_bill_details(args)
data = json.dumps({
'Irn': args.irn,
'Distance': cint(eway_bill_details.distance),
'TransMode': eway_bill_details.mode_of_transport,
'TransId': eway_bill_details.gstin,
'TransName': eway_bill_details.name,
'TransName': eway_bill_details.transporter,
'TrnDocDt': eway_bill_details.document_date,
'TrnDocNo': eway_bill_details.document_name,
'VehNo': eway_bill_details.vehicle_no,
@@ -874,7 +854,7 @@ class GSPConnector():
if errors:
throw_error_list(errors, title)
else:
link_to_error_list = '<a href="desk#List/Error Log/List?method=E Invoice Request Failed" target="_blank">Error Log</a>'
link_to_error_list = '<a href="desk#List/Error Log/List?method=E Invoice Request Failed">Error Log</a>'
frappe.msgprint(
_('An error occurred while making e-invoicing request. Please check {} for more information.').format(link_to_error_list),
title=title,

View File

@@ -32,15 +32,6 @@ class TestWarehouse(unittest.TestCase):
self.assertEqual(p_warehouse.name, child_warehouse.parent_warehouse)
self.assertEqual(child_warehouse.is_group, 0)
def test_naming(self):
company = "Wind Power LLC"
warehouse_name = "Named Warehouse - WP"
wh = frappe.get_doc(doctype="Warehouse", warehouse_name=warehouse_name, company=company).insert()
self.assertEqual(wh.name, warehouse_name)
warehouse_name = "Unnamed Warehouse"
wh = frappe.get_doc(doctype="Warehouse", warehouse_name=warehouse_name, company=company).insert()
self.assertIn(warehouse_name, wh.name)
def create_warehouse(warehouse_name, properties=None, company=None):
if not company:

View File

@@ -19,9 +19,8 @@ class Warehouse(NestedSet):
suffix = " - " + frappe.get_cached_value('Company', self.company, "abbr")
if not self.warehouse_name.endswith(suffix):
self.name = self.warehouse_name + suffix
return
self.name = self.warehouse_name
else:
self.name = self.warehouse_name
def onload(self):
'''load account name for General Ledger Report'''

View File

@@ -368,7 +368,7 @@ class update_entries_after(object):
batch = self.stock_queue[index]
if qty_to_pop >= batch[0]:
# consume current batch
qty_to_pop = _round_off_if_near_zero(qty_to_pop - batch[0])
qty_to_pop = qty_to_pop - batch[0]
self.stock_queue.pop(index)
if not self.stock_queue and qty_to_pop:
# stock finished, qty still remains to be withdrawn
@@ -382,8 +382,8 @@ class update_entries_after(object):
batch[0] = batch[0] - qty_to_pop
qty_to_pop = 0
stock_value = _round_off_if_near_zero(sum((flt(batch[0]) * flt(batch[1]) for batch in self.stock_queue)))
stock_qty = _round_off_if_near_zero(sum((flt(batch[0]) for batch in self.stock_queue)))
stock_value = sum((flt(batch[0]) * flt(batch[1]) for batch in self.stock_queue))
stock_qty = sum((flt(batch[0]) for batch in self.stock_queue))
if stock_qty:
self.valuation_rate = stock_value / flt(stock_qty)
@@ -549,12 +549,3 @@ def get_valuation_rate(item_code, warehouse, voucher_type, voucher_no,
frappe.throw(msg=msg, title=_("Valuation Rate Missing"))
return valuation_rate
def _round_off_if_near_zero(number, precision = 7):
"""Rounds off the number to zero only if number is close to zero for decimal
specified in precision. Precision defaults to 7.
"""
if abs(0.0 - flt(number)) < (1.0 / (10**precision)):
return 0.0
return flt(number)

File diff suppressed because it is too large Load Diff