- 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
21 lines
799 B
Python
21 lines
799 B
Python
import xmlrpc.client
|
|
|
|
url = "http://localhost:16001"
|
|
db = "postgres"
|
|
username = "odoo"
|
|
password = "odoo"
|
|
|
|
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
|
|
uid = common.authenticate(db, username, password, {})
|
|
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))
|
|
|
|
domain = [('name', '=', 'NAVY RED STRIPED POLO')]
|
|
templates = models.execute_kw(db, uid, password, 'product.template', 'search_read', [domain], {'fields': ['id', 'name', 'product_variant_ids']})
|
|
|
|
for t in templates:
|
|
print("Template:", t['id'], t['name'])
|
|
variants = models.execute_kw(db, uid, password, 'product.product', 'search_read', [[('id', 'in', t['product_variant_ids'])]], {'fields': ['id', 'default_code', 'shopify_variant_id']})
|
|
for v in variants:
|
|
print("Variant:", v)
|
|
|