update
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped

This commit is contained in:
KaySar12 2025-03-24 12:14:24 +07:00
parent 56217678ff
commit 12f395fad4

View File

@ -20,7 +20,7 @@ import odoorpc
import color_log
# Default configuration
DEFAULT_HOST = "localhost"
DEFAULT_HOST = "10.1.1.34"
DEFAULT_PORT = 8069
DEFAULT_USERNAME = "admin"
DEFAULT_PASSWORD = "admin"
@ -167,12 +167,12 @@ def process_batch(
# Check references
if not args.force:
referenced = any(
odoo.env[rel_model].search_count([(field, "=", record_id)])
for rel_model, fields in related.items()
for field in fields
)
if referenced:
# referenced = any(
# odoo.env[rel_model].search_count([(field, "=", record_id)])
# for rel_model, fields in related.items()
# for field in fields
# )
# if referenced:
model.write([record_id], {"active": False})
archived += 1
color_log.Show(OK, f"Archived {args.base_model} ID {record_id}")