🎉 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,33 @@
|
||||
#!/usr/bin/env python3
|
||||
import xmlrpc.client
|
||||
import os
|
||||
|
||||
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')
|
||||
|
||||
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'], 'order': 'default_code ASC'}
|
||||
)
|
||||
|
||||
out_file = '/root/.gemini/antigravity-ide/brain/4ef721a3-6674-4055-9705-38e237353959/productos_stock_cero.md'
|
||||
with open(out_file, 'w', encoding='utf-8') as f:
|
||||
f.write("# Productos que Odoo reporta con Stock 0 en Shopify\n\n")
|
||||
f.write("A continuación se listan las variantes que tienen stock 0 en Odoo y están vinculadas a Shopify. Debido a que Odoo es la Fuente de Verdad, el sistema envía este **0** a Shopify cada vez que se ejecuta la sincronización de inventario.\n\n")
|
||||
f.write("| SKU | Producto | Stock Odoo |\n")
|
||||
f.write("|---|---|---|\n")
|
||||
for p in products:
|
||||
f.write(f"| `{p['default_code']}` | {p['display_name']} | {p['qty_available']} |\n")
|
||||
|
||||
print(f"Reporte generado en {out_file} con {len(products)} variantes.")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user