From b5456a4438602d6499833a000f30e0bc7774dde4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20Sch=C3=BCle?=
Date: Tue, 12 Nov 2024 13:14:48 +0100
Subject: [PATCH] fix(Inventory/EditDialog): only add invoiceRecordPicker if
Sales is available
---
tine20/Inventory/js/InventoryItemEditDialog.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tine20/Inventory/js/InventoryItemEditDialog.js b/tine20/Inventory/js/InventoryItemEditDialog.js
index 08fcc29d15..dd951f2b30 100644
--- a/tine20/Inventory/js/InventoryItemEditDialog.js
+++ b/tine20/Inventory/js/InventoryItemEditDialog.js
@@ -58,7 +58,7 @@ Tine.Inventory.InventoryItemEditDialog = Ext.extend(Tine.widgets.dialog.EditDial
* @private
*/
getFormItems: function() {
- if (Tine.Sales.Model?.PurchaseInvoice) {
+ if (Tine.Sales && Tine.Tinebase.common.hasRight('run', 'Sales') && Tine.Sales.Model?.PurchaseInvoice) {
const app = Tine.Tinebase.appMgr.get('Sales')
this.invoiceRecordPicker = Tine.widgets.form.RecordPickerManager.get('Sales', 'PurchaseInvoice', {
fieldLabel: app.i18n._('Purchase Invoice'),
@@ -77,7 +77,7 @@ Tine.Inventory.InventoryItemEditDialog = Ext.extend(Tine.widgets.dialog.EditDial
hideMode: 'offsets'
},
items: [{
- //Start first tab
+ // Start first tab
title: this.app.i18n._('General'),
border: false,
frame: true,