From 4fb327a7053e080c97840e69f6c4c8031124fe9d Mon Sep 17 00:00:00 2001 From: Marc Durepos Date: Mon, 20 Nov 2023 15:53:14 -0500 Subject: [PATCH] Added migration script to move to 16.0.1.5.0 for sports clinic module. --- bemade_sports_clinic/__manifest__.py | 2 +- .../16.0.1.5.0/end-migrate_create_patient_partners.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 bemade_sports_clinic/migrations/16.0.1.5.0/end-migrate_create_patient_partners.py diff --git a/bemade_sports_clinic/__manifest__.py b/bemade_sports_clinic/__manifest__.py index 583dea1..8b604e0 100644 --- a/bemade_sports_clinic/__manifest__.py +++ b/bemade_sports_clinic/__manifest__.py @@ -18,7 +18,7 @@ # { 'name': 'Sports Clinic Management', - 'version': '16.0.1.4.0', + 'version': '16.0.1.5.0', 'summary': 'Manage the patients of a sports medicine clinic.', 'description': """ Adds the notion of sports teams, players (patients), coaches and treatment diff --git a/bemade_sports_clinic/migrations/16.0.1.5.0/end-migrate_create_patient_partners.py b/bemade_sports_clinic/migrations/16.0.1.5.0/end-migrate_create_patient_partners.py new file mode 100644 index 0000000..ff5274f --- /dev/null +++ b/bemade_sports_clinic/migrations/16.0.1.5.0/end-migrate_create_patient_partners.py @@ -0,0 +1,10 @@ +from odoo import api, SUPERUSER_ID + + +def migrate(cr, version): + env = api.Environment(cr, SUPERUSER_ID, {}) + patients = env['sports.patient'].search([('partner_id', '=', False)]) + for patient in patients: + env['res.partner'].create({ + 'name': patient._get_name_from_first_and_last(patient.first_name, patient.last_name) + }) \ No newline at end of file