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