Skip to content

Commit

Permalink
fix: dont run invoice hooks if unicommerce isn't enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Jun 5, 2023
1 parent 7e39281 commit cb5853f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ecommerce_integrations/unicommerce/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ def update_cancellation_status(so_data, so) -> bool:


def on_submit(self, method=None):
settings = frappe.get_cached_doc(SETTINGS_DOCTYPE)
if not settings.is_enabled():
return

sales_order = self.get("items")[0].sales_order
unicommerce_order_code = frappe.db.get_value("Sales Order", sales_order, "unicommerce_order_code")
if unicommerce_order_code:
Expand Down

0 comments on commit cb5853f

Please sign in to comment.