mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 14:54:34 -04:00
don't link entities when we are in a transaction
This commit is contained in:
parent
3ec81ea04b
commit
4108868b19
@ -304,8 +304,9 @@ class BaseRepository
|
|||||||
if (! $model->design_id)
|
if (! $model->design_id)
|
||||||
$model->design_id = $this->decodePrimaryKey($client->getSetting('invoice_design_id'));
|
$model->design_id = $this->decodePrimaryKey($client->getSetting('invoice_design_id'));
|
||||||
|
|
||||||
//links tasks and expenses back to the invoice.
|
//links tasks and expenses back to the invoice, but only if we are not in the middle of a transaction.
|
||||||
$model->service()->linkEntities()->save();
|
if (\DB::transactionLevel() == 0)
|
||||||
|
$model->service()->linkEntities()->save();
|
||||||
|
|
||||||
if($this->new_model)
|
if($this->new_model)
|
||||||
event('eloquent.created: App\Models\Invoice', $model);
|
event('eloquent.created: App\Models\Invoice', $model);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user