fix trigger on none

This commit is contained in:
Matthias Mair 2024-07-11 22:49:15 +02:00
parent 62c57e9447
commit dfd53d296a
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
1 changed files with 5 additions and 1 deletions

View File

@ -1107,7 +1107,11 @@ class StockItem(
item.add_tracking_entry(code, user, deltas, notes=notes)
trigger_event('stockitem.assignedtocustomer', id=self.id, customer=customer.id)
trigger_event(
'stockitem.assignedtocustomer',
id=self.id,
customer=customer.id if customer else None,
)
# Return the reference to the stock item
return item