🎉 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,32 @@
|
||||
#!/usr/bin/env python3
|
||||
import xmlrpc.client
|
||||
import sys
|
||||
|
||||
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("Consultando TODOS los productos (activos e inactivos) en Odoo...")
|
||||
products = models.execute_kw(ODOO_DB, uid, ODOO_PASS,
|
||||
'product.product', 'search_read',
|
||||
[['|', ('active', '=', True), ('active', '=', False), ('barcode', '!=', False)]],
|
||||
{'fields': ['display_name', 'default_code', 'barcode', 'active']}
|
||||
)
|
||||
|
||||
wrong_barcodes = []
|
||||
for p in products:
|
||||
if not p['barcode'].startswith('200001'):
|
||||
wrong_barcodes.append(p)
|
||||
|
||||
print(f"\nSe encontraron {len(wrong_barcodes)} productos con barcode que NO empieza con 200001:\n")
|
||||
for p in wrong_barcodes:
|
||||
print(f"[{'ACTIVO' if p['active'] else 'INACTIVO'}] Producto: {p['display_name']} | SKU: {p['default_code']} | Barcode: {p['barcode']}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user