Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release v15 #39245

Merged
merged 66 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
aad39cf
fix: Ignore UP on "allowed to transact with" (#39103)
ankush Jan 3, 2024
40ec5ff
fix(UX): dont override framework's permission check messages (backpor…
mergify[bot] Jan 3, 2024
54a0df5
fix: typerror on multi select dialog
ruthra-kumar Jan 3, 2024
bc529b5
Merge pull request #39122 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Jan 3, 2024
0784488
fix: Add name to Hungary - Chart of Accounts for Microenterprises json
monolithonadmin Jan 3, 2024
18575e1
Merge pull request #39129 from monolithonadmin/version-15-hotfix
deepeshgarg007 Jan 4, 2024
9e1b443
fix: ignore cancelled payments in Sales/Purchase Register
ruthra-kumar Jan 3, 2024
7640fea
fix: Subscription update patch
deepeshgarg007 Jan 4, 2024
b834abb
Merge pull request #39139 from frappe/mergify/bp/version-15-hotfix/pr…
deepeshgarg007 Jan 4, 2024
7a5a4be
Merge pull request #39137 from frappe/mergify/bp/version-15-hotfix/pr…
deepeshgarg007 Jan 4, 2024
2db1e1a
fix: serial / batch barcode scanner (backport #39114) (#39143)
mergify[bot] Jan 4, 2024
b192ddd
feat: provision to close SCO (backport #39127) (#39144)
mergify[bot] Jan 4, 2024
6020c8e
fix(Employee): treeview (#39126)
barredterra Jan 4, 2024
0454ded
Merge pull request #39148 from frappe/mergify/bp/version-15-hotfix/pr…
barredterra Jan 4, 2024
82b96d3
fix: inventory dimension negative stock validation (backport #39149) …
mergify[bot] Jan 4, 2024
5e46937
fix: Creating Asset Activity while Importing Asset (#39113)
auliabismar Jan 5, 2024
f3882a8
fix: don't set rate for non-stock item in Internal Transfer (backport…
mergify[bot] Jan 6, 2024
f0bc0aa
refactor: prevent permissions by always processing in background
ruthra-kumar Jan 5, 2024
51d8a7a
fix: incorrect outstanding amt validation on advance as liability
ruthra-kumar Jan 5, 2024
1eee52c
Merge pull request #39181 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Jan 8, 2024
c912e4c
Merge pull request #39182 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Jan 8, 2024
00d36d1
refactor: allow sales invoice in Bank Reconciliation tool
ruthra-kumar Jan 5, 2024
f1d2570
Merge pull request #39183 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Jan 8, 2024
16269b0
fix: possible key error on Financial ratios report
ruthra-kumar Jan 8, 2024
83288fe
Merge pull request #39187 from ruthra-kumar/backport_37613
ruthra-kumar Jan 8, 2024
e89dce7
fix: improved validation message
nabinhait Jan 5, 2024
d6d54ed
fix: Purchase date and amount is not mandatory for composite asset cr…
nabinhait Jan 5, 2024
926850d
fix: update Maintenance Schedule status on Maintenance Visit submit (…
mergify[bot] Jan 8, 2024
672e6d6
fix: duplicate entry for serial / batch creation (backport #39188) (#…
mergify[bot] Jan 8, 2024
b064944
fix: add expected_start_date in sort by
shariquerik Jan 8, 2024
80a2b79
chore: linter fix
shariquerik Jan 8, 2024
1f64b8f
chore: linter fix
shariquerik Jan 8, 2024
8cc9dda
chore: linter fix
shariquerik Jan 8, 2024
58357f8
Merge pull request #39206 from frappe/mergify/bp/version-15-hotfix/pr…
shariquerik Jan 8, 2024
3caf462
fix: flaky demo test case (backport #39135) (#39198)
mergify[bot] Jan 8, 2024
abc99f8
fix: FG Item incorrect qty in the work order (backport #39200) (#39211)
mergify[bot] Jan 8, 2024
50300b9
fix: Show maintain-stock and is-fixed-asset checkbox in item quick en…
nabinhait Jan 8, 2024
1d2e831
fix: Introduced company field to show amounts in company currency
nabinhait Jan 8, 2024
97a5148
Merge pull request #39219 from frappe/mergify/bp/version-15-hotfix/pr…
nabinhait Jan 8, 2024
277aa7b
fix: bank transction status upon reconciliation
ruthra-kumar Jan 8, 2024
53eb612
refactor: remove 'Bank Trasaction' logic from status_update
ruthra-kumar Jan 8, 2024
ec7a60b
Merge pull request #39234 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Jan 9, 2024
756c062
fix: total allocated percentage for sales team issue
ruthra-kumar Jan 9, 2024
d0688e7
Merge pull request #39241 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Jan 9, 2024
0898ea5
fix: BOM replace tool does not update exploded items of root (backpor…
mergify[bot] Jan 9, 2024
a147e29
fix: update status on manual allocation
ruthra-kumar Jan 9, 2024
e62dd0d
fix: add read permission to Buying Settings
s-aga-r Jan 5, 2024
4ad61fc
Merge pull request #39253 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Jan 9, 2024
bb6025c
fix: TypeError is pricing rules (backport #39252) (#39260)
mergify[bot] Jan 9, 2024
9f793b9
fix: incorrect indicator title for portal sales order (backport #3924…
mergify[bot] Jan 9, 2024
a326876
Merge pull request #39258 from frappe/mergify/bp/version-15-hotfix/pr…
barredterra Jan 9, 2024
78c65f2
fix: Duplicate Closing Stock Balance (backport #39262) (#39264)
mergify[bot] Jan 9, 2024
f00a6f6
fix: skip rate validation for return `DN Items` with `Moving Average`…
mergify[bot] Jan 9, 2024
4fa978e
test: fix wrong fieldname (#39270)
barredterra Jan 10, 2024
5d6bc96
fix: projects website list visible for guests and all logged in custo…
mergify[bot] Jan 10, 2024
f0070b4
fix: Set asset purchase amount based on qty and valuation_rate
nabinhait Jan 9, 2024
87d1b0f
fix: Ignore asset qty and status validation while cancelling LCV
nabinhait Jan 8, 2024
fec892c
fix: possible typeerror on transaction.js
ruthra-kumar Jan 10, 2024
afefae0
fix: Resolved conflict
nabinhait Jan 10, 2024
cd57bbc
Merge pull request #39284 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Jan 10, 2024
0c0be03
Merge pull request #39218 from frappe/mergify/bp/version-15-hotfix/pr…
nabinhait Jan 10, 2024
24cfcf3
Merge pull request #39276 from frappe/mergify/bp/version-15-hotfix/pr…
nabinhait Jan 10, 2024
38c1350
Merge pull request #39279 from frappe/mergify/bp/version-15-hotfix/pr…
nabinhait Jan 10, 2024
f821251
Merge pull request #39190 from frappe/mergify/bp/version-15-hotfix/pr…
nabinhait Jan 10, 2024
fe973a4
fix: set parent doctype on chart (backport #39286) (#39288)
mergify[bot] Jan 10, 2024
2598f8e
fix: Show timesheet table after fetching data from timesheet (backpor…
mergify[bot] Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"country_code": "hu",
"name": "Hungary - Chart of Accounts for Microenterprises",
"tree": {
"SZ\u00c1MLAOSZT\u00c1LY BEFEKTETETT ESZK\u00d6Z\u00d6K": {
"account_number": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{
"fieldname": "company",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"in_list_view": 1,
"label": "Company",
"options": "Company",
Expand All @@ -19,7 +20,7 @@
],
"istable": 1,
"links": [],
"modified": "2020-05-01 12:32:34.044911",
"modified": "2024-01-03 11:13:02.669632",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Allowed To Transact With",
Expand All @@ -28,5 +29,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ def reconcile_vouchers(bank_transaction_name, vouchers):
vouchers = json.loads(vouchers)
transaction = frappe.get_doc("Bank Transaction", bank_transaction_name)
transaction.add_payment_entries(vouchers)
transaction.validate_duplicate_references()
transaction.allocate_payment_entries()
transaction.update_allocated_amount()
transaction.set_status()
transaction.save()

return transaction
Expand Down
35 changes: 23 additions & 12 deletions erpnext/accounts/doctype/bank_transaction/bank_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@

import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt

from erpnext.controllers.status_updater import StatusUpdater


class BankTransaction(StatusUpdater):
class BankTransaction(Document):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.

Expand Down Expand Up @@ -50,6 +49,15 @@ def before_validate(self):
def validate(self):
self.validate_duplicate_references()

def set_status(self):
if self.docstatus == 2:
self.db_set("status", "Cancelled")
elif self.docstatus == 1:
if self.unallocated_amount > 0:
self.db_set("status", "Unreconciled")
elif self.unallocated_amount <= 0:
self.db_set("status", "Reconciled")

def validate_duplicate_references(self):
"""Make sure the same voucher is not allocated twice within the same Bank Transaction"""
if not self.payment_entries:
Expand Down Expand Up @@ -83,12 +91,13 @@ def before_update_after_submit(self):
self.validate_duplicate_references()
self.allocate_payment_entries()
self.update_allocated_amount()
self.set_status()

def on_cancel(self):
for payment_entry in self.payment_entries:
self.clear_linked_payment_entry(payment_entry, for_cancel=True)

self.set_status(update=True)
self.set_status()

def add_payment_entries(self, vouchers):
"Add the vouchers with zero allocation. Save() will perform the allocations and clearance"
Expand Down Expand Up @@ -366,15 +375,17 @@ def set_voucher_clearance(doctype, docname, clearance_date, self):
and len(get_reconciled_bank_transactions(doctype, docname)) < 2
):
return
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)

elif doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doctype, parent=docname),
"clearance_date",
clearance_date,
)
if doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doctype, parent=docname),
"clearance_date",
clearance_date,
)
return

frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)

elif doctype == "Bank Transaction":
# For when a second bank transaction has fixed another, e.g. refund
Expand Down
4 changes: 4 additions & 0 deletions erpnext/accounts/doctype/payment_entry/payment_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@ frappe.ui.form.on('Payment Entry', {
args["get_orders_to_be_billed"] = true;
}

if (frm.doc.book_advance_payments_in_separate_party_account) {
args["book_advance_payments_in_separate_party_account"] = true;
}

frappe.flags.allocate_payment_amount = filters['allocate_payment_amount'];

return frappe.call({
Expand Down
8 changes: 7 additions & 1 deletion erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def validate_allocated_amount_with_latest_data(self):
"get_outstanding_invoices": True,
"get_orders_to_be_billed": True,
"vouchers": vouchers,
"book_advance_payments_in_separate_party_account": self.book_advance_payments_in_separate_party_account,
},
validate=True,
)
Expand Down Expand Up @@ -1614,11 +1615,16 @@ def get_outstanding_reference_documents(args, validate=False):
outstanding_invoices = []
negative_outstanding_invoices = []

if args.get("book_advance_payments_in_separate_party_account"):
party_account = get_party_account(args.get("party_type"), args.get("party"), args.get("company"))
else:
party_account = args.get("party_account")

if args.get("get_outstanding_invoices"):
outstanding_invoices = get_outstanding_invoices(
args.get("party_type"),
args.get("party"),
get_party_account(args.get("party_type"), args.get("party"), args.get("company")),
party_account,
common_filter=common_filter,
posting_date=posting_and_due_date,
min_outstanding=args.get("outstanding_amt_greater_than"),
Expand Down
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/pricing_rule/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def get_qty_amount_data_for_cumulative(pr_doc, doc, items=None):
values.extend(warehouses)

if items:
condition = " and `tab{child_doc}`.{apply_on} in ({items})".format(
condition += " and `tab{child_doc}`.{apply_on} in ({items})".format(
child_doc=child_doctype, apply_on=apply_on, items=",".join(["%s"] * len(items))
)

Expand Down
26 changes: 11 additions & 15 deletions erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,17 +1084,6 @@ def make_item_gl_entries(self, gl_entries):
item=item,
)
)

# update gross amount of asset bought through this document
assets = frappe.db.get_all(
"Asset", filters={"purchase_invoice": self.name, "item_code": item.item_code}
)
for asset in assets:
frappe.db.set_value("Asset", asset.name, "gross_purchase_amount", flt(item.valuation_rate))
frappe.db.set_value(
"Asset", asset.name, "purchase_receipt_amount", flt(item.valuation_rate)
)

if (
self.auto_accounting_for_stock
and self.is_opening == "No"
Expand Down Expand Up @@ -1134,17 +1123,24 @@ def make_item_gl_entries(self, gl_entries):
item.item_tax_amount, item.precision("item_tax_amount")
)

if item.is_fixed_asset and item.landed_cost_voucher_amount:
self.update_gross_purchase_amount_for_linked_assets(item)

def update_gross_purchase_amount_for_linked_assets(self, item):
assets = frappe.db.get_all(
"Asset",
filters={"purchase_invoice": self.name, "item_code": item.item_code},
fields=["name", "asset_quantity"],
)
for asset in assets:
purchase_amount = flt(item.valuation_rate) * asset.asset_quantity
frappe.db.set_value(
"Asset", asset.name, "gross_purchase_amount", flt(item.valuation_rate) * asset.asset_quantity
)
frappe.db.set_value(
"Asset", asset.name, "purchase_receipt_amount", flt(item.valuation_rate) * asset.asset_quantity
"Asset",
asset.name,
{
"gross_purchase_amount": purchase_amount,
"purchase_receipt_amount": purchase_amount,
},
)

def make_stock_adjustment_entry(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1227,11 +1227,11 @@ def test_deferred_expense_via_journal_entry(self):

@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_gain_loss_with_advance_entry(self):
unlink_enabled = frappe.db.get_value(
"Accounts Settings", "Accounts Settings", "unlink_payment_on_cancel_of_invoice"
unlink_enabled = frappe.db.get_single_value(
"Accounts Settings", "unlink_payment_on_cancellation_of_invoice"
)

frappe.db.set_single_value("Accounts Settings", "unlink_payment_on_cancel_of_invoice", 1)
frappe.db.set_single_value("Accounts Settings", "unlink_payment_on_cancellation_of_invoice", 1)

original_account = frappe.db.get_value("Company", "_Test Company", "exchange_gain_loss_account")
frappe.db.set_value(
Expand Down Expand Up @@ -1422,7 +1422,7 @@ def test_gain_loss_with_advance_entry(self):
pay.cancel()

frappe.db.set_single_value(
"Accounts Settings", "unlink_payment_on_cancel_of_invoice", unlink_enabled
"Accounts Settings", "unlink_payment_on_cancellation_of_invoice", unlink_enabled
)
frappe.db.set_value("Company", "_Test Company", "exchange_gain_loss_account", original_account)

Expand Down
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/sales_invoice/sales_invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,8 @@ frappe.ui.form.on('Sales Invoice', {
frm.events.append_time_log(frm, timesheet, 1.0);
}
});
frm.refresh_field("timesheets");
frm.trigger("calculate_timesheet_totals");
frm.refresh();
},

async get_exchange_rate(frm, from_currency, to_currency) {
Expand Down
14 changes: 5 additions & 9 deletions erpnext/accounts/party.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,12 @@ def _get_party_details(
set_account_and_due_date(party, account, party_type, company, posting_date, bill_date, doctype)
)
party = party_details[party_type.lower()]
party = frappe.get_doc(party_type, party)

if not ignore_permissions and not (
frappe.has_permission(party_type, "read", party)
or frappe.has_permission(party_type, "select", party)
):
frappe.throw(_("Not permitted for {0}").format(party), frappe.PermissionError)
if not ignore_permissions:
ptype = "select" if frappe.only_has_select_perm(party_type) else "read"
frappe.has_permission(party_type, ptype, party, throw=True)

party = frappe.get_doc(party_type, party)
currency = party.get("default_currency") or currency or get_company_currency(company)

party_address, shipping_address = set_address_details(
Expand Down Expand Up @@ -637,9 +635,7 @@ def get_due_date_from_template(template_name, posting_date, bill_date):
return due_date


def validate_due_date(
posting_date, due_date, party_type, party, company=None, bill_date=None, template_name=None
):
def validate_due_date(posting_date, due_date, bill_date=None, template_name=None):
if getdate(due_date) < getdate(posting_date):
frappe.throw(_("Due Date cannot be before Posting / Supplier Invoice Date"))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ def add_solvency_ratios(
return_on_equity_ratio = {"ratio": "Return on Equity Ratio"}

for year in years:
profit_after_tax = total_income[year] + total_expense[year]
share_holder_fund = total_asset[year] - total_liability[year]
profit_after_tax = flt(total_income.get(year)) + flt(total_expense.get(year))
share_holder_fund = flt(total_asset.get(year)) - flt(total_liability.get(year))

debt_equity_ratio[year] = calculate_ratio(
total_liability.get(year), share_holder_fund, precision
Expand Down
5 changes: 4 additions & 1 deletion erpnext/accounts/report/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def get_journal_entries(filters, args):
)
.where(
(je.voucher_type == "Journal Entry")
& (je.docstatus == 1)
& (journal_account.party == filters.get(args.party))
& (journal_account.account.isin(args.party_account))
)
Expand Down Expand Up @@ -281,7 +282,9 @@ def get_payment_entries(filters, args):
pe.cost_center,
)
.where(
(pe.party == filters.get(args.party)) & (pe[args.account_fieldname].isin(args.party_account))
(pe.docstatus == 1)
& (pe.party == filters.get(args.party))
& (pe[args.account_fieldname].isin(args.party_account))
)
.orderby(pe.posting_date, pe.name, order=Order.desc)
)
Expand Down
12 changes: 9 additions & 3 deletions erpnext/assets/doctype/asset/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,16 @@ frappe.ui.form.on('Asset', {
indicator: 'red'
});
}
frm.set_value('gross_purchase_amount', item.base_net_rate + item.item_tax_amount);
frm.set_value('purchase_receipt_amount', item.base_net_rate + item.item_tax_amount);
item.asset_location && frm.set_value('location', item.asset_location);
var is_grouped_asset = frappe.db.get_value('Item', item.item_code, 'is_grouped_asset');
var asset_quantity = is_grouped_asset ? item.qty : 1;
var purchase_amount = flt(item.valuation_rate * asset_quantity, precision('gross_purchase_amount'));

frm.set_value('gross_purchase_amount', purchase_amount);
frm.set_value('purchase_receipt_amount', purchase_amount);
frm.set_value('asset_quantity', asset_quantity);
frm.set_value('cost_center', item.cost_center || purchase_doc.cost_center);
if(item.asset_location) { frm.set_value('location', item.asset_location); }

},

set_depreciation_rate: function(frm, row) {
Expand Down
12 changes: 6 additions & 6 deletions erpnext/assets/doctype/asset/asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@
"fieldname": "purchase_date",
"fieldtype": "Date",
"label": "Purchase Date",
"mandatory_depends_on": "eval:!doc.is_existing_asset",
"read_only": 1,
"read_only_depends_on": "eval:!doc.is_existing_asset && !doc.is_composite_asset",
"reqd": 1
"read_only_depends_on": "eval:!doc.is_existing_asset && !doc.is_composite_asset"
},
{
"fieldname": "disposal_date",
Expand All @@ -227,15 +227,15 @@
"fieldname": "gross_purchase_amount",
"fieldtype": "Currency",
"label": "Gross Purchase Amount",
"mandatory_depends_on": "eval:(!doc.is_composite_asset || doc.docstatus==1)",
"options": "Company:company:default_currency",
"read_only_depends_on": "eval:!doc.is_existing_asset",
"reqd": 1
"read_only_depends_on": "eval:!doc.is_existing_asset"
},
{
"fieldname": "available_for_use_date",
"fieldtype": "Date",
"label": "Available-for-use Date",
"reqd": 1
"mandatory_depends_on": "eval:(!doc.is_composite_asset || doc.docstatus==1)"
},
{
"default": "0",
Expand Down Expand Up @@ -590,7 +590,7 @@
"link_fieldname": "target_asset"
}
],
"modified": "2023-12-21 16:46:20.732869",
"modified": "2024-01-05 17:36:53.131512",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset",
Expand Down
Loading
Loading