feat: add performance logging to action_pos_order_paid to track execution time

This commit is contained in:
Suherdy Yacob 2026-05-07 13:09:17 +07:00
parent b56303083a
commit 3b18be513e

View File

@ -25,7 +25,15 @@ class PosOrder(models.Model):
def action_pos_order_paid(self):
"""Override to update the customer's membership level in the background."""
import time
start_time = time.time()
_logger.info("POS_PERF: Starting action_pos_order_paid for %s orders", len(self))
res = super().action_pos_order_paid()
mid_time = time.time()
_logger.info("POS_PERF: Super() action_pos_order_paid took %.4f seconds", mid_time - start_time)
for order in self:
if order.partner_id:
# Dispatch to background thread