update
Some checks are pending
Setup Native Action / native (3.12.7) (push) Waiting to run
Setup Native Action / docker (3.12.7) (push) Waiting to run

This commit is contained in:
KaySar12 2025-03-20 11:17:41 +07:00
parent 699bb65076
commit 8fd27ac314

View File

@ -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()