feat: clickable WooCommerce product links in mapping UI

Product names in the mapped table are now links that open the WC product
page in a new tab. Added woo_permalink field, stored during fetch,
returned by search endpoint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-03-31 23:06:27 -04:00
parent 0e84b97c89
commit b1e4ed5ec8
5 changed files with 32 additions and 1 deletions

View File

@@ -202,6 +202,8 @@ class WooInstance(models.Model):
except (ValueError, TypeError):
pass
wc_permalink = wc_prod.get('permalink', '')
ProductMap.create({
'instance_id': self.id,
'product_id': odoo_product.id if odoo_product else False,
@@ -209,6 +211,7 @@ class WooInstance(models.Model):
'woo_product_name': wc_name,
'woo_sku': wc_sku,
'woo_price': wc_price,
'woo_permalink': wc_permalink,
'woo_product_type': wc_type if wc_type in ('simple', 'variable', 'grouped', 'external') else 'simple',
'state': match_state,
'company_id': self.company_id.id,