feat: finalize electronic invoicing role-based UI
This commit is contained in:
@@ -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"),
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user