🎉 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,46 @@
|
||||
import xmlrpc.client
|
||||
|
||||
url = 'http://localhost:16001'
|
||||
db = 'hazard_new'
|
||||
username = 'admin'
|
||||
password = '123'
|
||||
|
||||
try:
|
||||
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url), allow_none=True)
|
||||
uid = common.authenticate(db, username, 'admin', {})
|
||||
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url), allow_none=True)
|
||||
|
||||
# IDs from previous run
|
||||
vendor_id = 277
|
||||
client_id = 278
|
||||
product_id = 10017
|
||||
|
||||
# 6. Crear Cotización (SO)
|
||||
so_id = models.execute_kw(db, uid, 'admin', 'sale.order', 'create', [{
|
||||
'partner_id': client_id,
|
||||
'order_line': [
|
||||
(0, 0, {
|
||||
'product_id': product_id,
|
||||
'product_uom_qty': 5.0,
|
||||
})
|
||||
]
|
||||
}])
|
||||
print("Cotización de Venta Creada:", so_id)
|
||||
|
||||
# 7. Crear Orden de Compra (PO)
|
||||
po_id = models.execute_kw(db, uid, 'admin', 'purchase.order', 'create', [{
|
||||
'partner_id': vendor_id,
|
||||
'order_line': [
|
||||
(0, 0, {
|
||||
'product_id': product_id,
|
||||
'product_qty': 5.0,
|
||||
'price_unit': 250.0,
|
||||
})
|
||||
]
|
||||
}])
|
||||
print("Orden de Compra Creada:", po_id)
|
||||
|
||||
print("--- ¡Datos complementarios creados exitosamente! ---")
|
||||
|
||||
except Exception as e:
|
||||
print("Error general:", e)
|
||||
Reference in New Issue
Block a user