🎉 Initial commit - Hazard Odoo 16 project
- Custom modules: hazard_shopify, hazard_inventory_report, hazard_website - Third-party modules: bi_sql_editor, query_deluxe, sql_request_abstract, l10n_mx_sat_sync_itadmin_ee - Docker setup: Odoo 16 + PostgreSQL 17 - Utility scripts: backup_hazard.sh, update_module.py - Agent configuration: .agents/AGENTS.md - Security: Enterprise modules, credentials, backups and production data excluded via .gitignore
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import psycopg2
|
||||
import json
|
||||
|
||||
conn = psycopg2.connect(dbname="hazard_new", user="odoo", password="odoo", host="localhost", port="5432")
|
||||
cur = conn.cursor()
|
||||
|
||||
ref = 'HRS-GLV-CABRET-U-WHT-L'
|
||||
cur.execute("""
|
||||
SELECT pt.id, pt.name, pp.id, pp.default_code
|
||||
FROM product_product pp
|
||||
JOIN product_template pt ON pp.product_tmpl_id = pt.id
|
||||
WHERE pp.default_code = %s
|
||||
""", (ref,))
|
||||
|
||||
for row in cur.fetchall():
|
||||
print("Template ID:", row[0])
|
||||
print("Template Name (JSONb):", row[1])
|
||||
print("Product ID:", row[2])
|
||||
|
||||
cur.close()
|
||||
conn.close()
|
||||
Reference in New Issue
Block a user