Payment在采购订单,销售订单与销售发票中汉化调整

This commit is contained in:
余则霖
2026-02-04 23:56:26 +08:00
parent 39ff2f14d0
commit 1a5e35b581
6 changed files with 48 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ import frappe
patches_loaded = False patches_loaded = False
__version__ = '1.0.5' __version__ = '1.0.6'
def load_monkey_patches(): def load_monkey_patches():

View File

@@ -11,6 +11,12 @@ after_install = "erpnext_china.setup.install.after_install"
setup_wizard_requires = "assets/erpnext_china/js/setup_wizard.js" setup_wizard_requires = "assets/erpnext_china/js/setup_wizard.js"
doctype_js = {
"Purchase Order" : "public/js/purchase_order.js",
"Sales Order" : "public/js/sales_order.js",
"Sales Invoice" : "public/js/sales_invoice.js",
}
override_whitelisted_methods = { override_whitelisted_methods = {
"erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country": "erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country":
"erpnext_china.chart_of_accounts.custom_accounts.custom_account.get_charts_for_country", "erpnext_china.chart_of_accounts.custom_accounts.custom_account.get_charts_for_country",

View File

@@ -0,0 +1,13 @@
frappe.ui.form.on('Purchase Order', {
refresh: function(frm) {
// 使用 setTimeout 是因为 ERPNext 的按钮是动态渲染的
// 必须等核心代码渲染完,我们才能抓取到 DOM
setTimeout(() => {
// 定位:在“创建”按钮组下,寻找 data-label 为“付款”的选项
// 使用 decodeURIComponent 是为了增强可读性,也可以直接用 data-label="付款"
$(`.inner-group-button[data-label='${encodeURIComponent("创建")}']`)
.find(`.dropdown-item[data-label='${encodeURIComponent("付款")}']`)
.text(__('预付款'));
}, 200);
}
});

View File

@@ -0,0 +1,13 @@
frappe.ui.form.on('Sales Invoice', {
refresh: function(frm) {
// 使用 setTimeout 是因为 ERPNext 的按钮是动态渲染的
// 必须等核心代码渲染完,我们才能抓取到 DOM
setTimeout(() => {
// 定位:在“创建”按钮组下,寻找 data-label 为“付款”的选项
// 使用 decodeURIComponent 是为了增强可读性,也可以直接用 data-label="付款"
$(`.inner-group-button[data-label='${encodeURIComponent("创建")}']`)
.find(`.dropdown-item[data-label='${encodeURIComponent("付款")}']`)
.text(__('收款'));
}, 200);
}
});

View File

@@ -0,0 +1,13 @@
frappe.ui.form.on('Sales Order', {
refresh: function(frm) {
// 使用 setTimeout 是因为 ERPNext 的按钮是动态渲染的
// 必须等核心代码渲染完,我们才能抓取到 DOM
setTimeout(() => {
// 定位:在“创建”按钮组下,寻找 data-label 为“付款”的选项
// 使用 decodeURIComponent 是为了增强可读性,也可以直接用 data-label="付款"
$(`.inner-group-button[data-label='${encodeURIComponent("创建")}']`)
.find(`.dropdown-item[data-label='${encodeURIComponent("付款")}']`)
.text(__('预收款'));
}, 200);
}
});

View File

@@ -12134,4 +12134,5 @@ Right Column,右栏
Row {0}: Account {1} already in Row {2},行次 {0}:科目 {1} 已在行次 {2} 中使用。 Row {0}: Account {1} already in Row {2},行次 {0}:科目 {1} 已在行次 {2} 中使用。
Row {0}: '{1}' is not a valid row number,行次 {0}'{1}' 不是有效的数字。 Row {0}: '{1}' is not a valid row number,行次 {0}'{1}' 不是有效的数字。
{0}Row {1},{0}第 {1} 行 {0}Row {1},{0}第 {1} 行
{0}: Account {1} already in {2},{0}:科目 {1} 已在 {2} 中使用 {0}: Account {1} already in {2},{0}:科目 {1} 已在 {2} 中使用
Include Returned Invoices (Stand-alone),含独立红字发票
Can't render this file because it is too large.