update
This commit is contained in:
parent
56217678ff
commit
12f395fad4
@ -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}")
|
||||
|
Loading…
Reference in New Issue
Block a user