1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Prevent expense or task invoice item from creating a product

This commit is contained in:
Hillel Coren 2016-07-11 20:17:41 +03:00
parent 986487b4c9
commit 243005b667

View File

@ -539,7 +539,7 @@ class InvoiceRepository extends BaseRepository
}
if ($productKey = trim($item['product_key'])) {
if (\Auth::user()->account->update_products && ! strtotime($productKey)) {
if (\Auth::user()->account->update_products && ! strtotime($productKey) && ! $task && ! $expense) {
$product = Product::findProductByKey($productKey);
if (!$product) {
if (Auth::user()->can('create', ENTITY_PRODUCT)) {