- 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
27 lines
979 B
Python
27 lines
979 B
Python
#!/usr/bin/env python3
|
|
import xmlrpc.client
|
|
|
|
ODOO_URL = 'http://localhost:16001'
|
|
ODOO_DB = 'hazard_new'
|
|
ODOO_USER = 'admin'
|
|
ODOO_PASS = 'admin'
|
|
|
|
def main():
|
|
common = xmlrpc.client.ServerProxy(f'{ODOO_URL}/xmlrpc/2/common')
|
|
uid = common.authenticate(ODOO_DB, ODOO_USER, ODOO_PASS, {})
|
|
models = xmlrpc.client.ServerProxy(f'{ODOO_URL}/xmlrpc/2/object')
|
|
|
|
print("Buscando productos vinculados a Shopify con stock 0 en Odoo...")
|
|
products = models.execute_kw(ODOO_DB, uid, ODOO_PASS,
|
|
'product.product', 'search_read',
|
|
[[('shopify_inventory_item_id', '!=', False), ('qty_available', '<=', 0)]],
|
|
{'fields': ['display_name', 'default_code', 'qty_available']}
|
|
)
|
|
|
|
print(f"\nSe encontraron {len(products)} variantes vinculadas a Shopify que en Odoo tienen 0 (o menos) de stock:\n")
|
|
for p in products:
|
|
print(f"[{p['default_code']}] {p['display_name']} -> Stock Odoo: {p['qty_available']}")
|
|
|
|
if __name__ == '__main__':
|
|
main()
|