feat: finalize electronic invoicing role-based UI

This commit is contained in:
Julien Denizot
2026-06-21 16:13:13 +00:00
parent 22628835df
commit 19ffc45fbc
+20 -1
View File
@@ -151,6 +151,22 @@ function render_einvoice_summary(frm) {
}
function canReadElectronicInvoicing() {
return (
frappe.user.has_role("System Manager")
|| frappe.user.has_role(
"Facturation électronique - Lecture"
)
|| frappe.user.has_role(
"Facturation électronique - Opérateur"
)
|| frappe.user.has_role(
"Facturation électronique - Responsable"
)
);
}
function canOperateElectronicInvoicing() {
return (
frappe.user.has_role("System Manager")
@@ -168,7 +184,10 @@ function add_einvoice_buttons(frm) {
const group =
__("Facturation électronique");
if (frm.doc.einvoice_exchange) {
if (
frm.doc.einvoice_exchange
&& canReadElectronicInvoicing()
) {
frm.add_custom_button(
__("Ouvrir l’échange"),
() => {