update
This commit is contained in:
parent
56217678ff
commit
12f395fad4
@ -20,7 +20,7 @@ import odoorpc
|
|||||||
import color_log
|
import color_log
|
||||||
|
|
||||||
# Default configuration
|
# Default configuration
|
||||||
DEFAULT_HOST = "localhost"
|
DEFAULT_HOST = "10.1.1.34"
|
||||||
DEFAULT_PORT = 8069
|
DEFAULT_PORT = 8069
|
||||||
DEFAULT_USERNAME = "admin"
|
DEFAULT_USERNAME = "admin"
|
||||||
DEFAULT_PASSWORD = "admin"
|
DEFAULT_PASSWORD = "admin"
|
||||||
@ -167,12 +167,12 @@ def process_batch(
|
|||||||
|
|
||||||
# Check references
|
# Check references
|
||||||
if not args.force:
|
if not args.force:
|
||||||
referenced = any(
|
# referenced = any(
|
||||||
odoo.env[rel_model].search_count([(field, "=", record_id)])
|
# odoo.env[rel_model].search_count([(field, "=", record_id)])
|
||||||
for rel_model, fields in related.items()
|
# for rel_model, fields in related.items()
|
||||||
for field in fields
|
# for field in fields
|
||||||
)
|
# )
|
||||||
if referenced:
|
# if referenced:
|
||||||
model.write([record_id], {"active": False})
|
model.write([record_id], {"active": False})
|
||||||
archived += 1
|
archived += 1
|
||||||
color_log.Show(OK, f"Archived {args.base_model} ID {record_id}")
|
color_log.Show(OK, f"Archived {args.base_model} ID {record_id}")
|
||||||
|
Loading…
Reference in New Issue
Block a user