From 0e84b97c89024fa2c1d8d28dad1927ae07a8bb87 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Tue, 31 Mar 2026 23:01:26 -0400 Subject: [PATCH] fix: sync never changes product map state from mapped Price conflicts and sync errors were setting woo.product.map state to 'conflict'/'error', making products disappear from the mapped list. Conflicts are now tracked only in woo.conflict model. Map state stays 'mapped' as long as the product link exists. Co-Authored-By: Claude Opus 4.6 (1M context) --- fusion-woo-odoo/fusion_woocommerce/models/woo_instance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fusion-woo-odoo/fusion_woocommerce/models/woo_instance.py b/fusion-woo-odoo/fusion_woocommerce/models/woo_instance.py index be116ec0..fbdcc0e6 100644 --- a/fusion-woo-odoo/fusion_woocommerce/models/woo_instance.py +++ b/fusion-woo-odoo/fusion_woocommerce/models/woo_instance.py @@ -793,7 +793,7 @@ class WooInstance(models.Model): 'woo_value': str(wc_price), 'company_id': self.company_id.id, }) - pm.state = 'conflict' + # Keep state as mapped — conflict is tracked separately self._log_sync( 'product', 'woo_to_odoo', pm.product_id.display_name, 'conflict', f'Price conflict: Odoo=${odoo_price}, WC=${wc_price}', @@ -821,7 +821,7 @@ class WooInstance(models.Model): "Product price sync failed for %s (WC#%s): %s", pm.product_id.display_name, pm.woo_product_id, e, ) - pm.state = 'error' + # Don't change map state on sync errors — keep it mapped self._log_sync( 'product', 'odoo_to_woo', pm.product_id.display_name, 'failed', str(e),