update
This commit is contained in:
parent
699bb65076
commit
8fd27ac314
@ -34,7 +34,9 @@ def parse_arguments():
|
||||
parser.add_argument("db_name", help="Database name")
|
||||
parser.add_argument("base_model", help="Model to delete records from")
|
||||
parser.add_argument("--host", default=DEFAULT_HOST, help="Odoo server host")
|
||||
parser.add_argument("--port", type=int, default=DEFAULT_PORT, help="Odoo server port")
|
||||
parser.add_argument(
|
||||
"--port", type=int, default=DEFAULT_PORT, help="Odoo server port"
|
||||
)
|
||||
parser.add_argument("--username", default=DEFAULT_USERNAME, help="Odoo username")
|
||||
parser.add_argument("--password", default=DEFAULT_PASSWORD, help="Odoo password")
|
||||
parser.add_argument("--domain", default=DEFAULT_DOMAIN, help="Domain filter")
|
||||
@ -200,7 +202,9 @@ def delete_batch(odoo, batch, model_name, related_models, process_id, force, sof
|
||||
def main():
|
||||
"""Orchestrate the deletion process."""
|
||||
args = parse_arguments()
|
||||
odoo = connect_to_odoo(args.host, args.port, args.db_name, args.username, args.password)
|
||||
odoo = connect_to_odoo(
|
||||
args.host, args.port, args.db_name, args.username, args.password
|
||||
)
|
||||
domain = parse_domain(args.domain)
|
||||
|
||||
model = odoo.env[args.base_model]
|
||||
@ -243,4 +247,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user