diff --git a/netforce_clinic/migrations/update_account_tracking.py b/netforce_clinic/migrations/update_account_tracking.py index feaeb38..f9405d2 100644 --- a/netforce_clinic/migrations/update_account_tracking.py +++ b/netforce_clinic/migrations/update_account_tracking.py @@ -17,11 +17,21 @@ class Migration(migration.Migration): line.write({ 'track_id': track_id, }) + if payment.move_id: + for line in payment.move_id.lines: + line.write({ + 'track_id': track_id, + }) for invoice in hdcase.invoices: for line in invoice.lines: line.write({ 'track_id': track_id, }) + if invoice.move_id: + for line in invoice.move_id.lines: + line.write({ + 'track_id': track_id, + }) for shop in get_model('clinic.shop').search_browse([]): track_id=shop.branch_id.track_id.id for payment in hdcase.payments: @@ -29,10 +39,20 @@ class Migration(migration.Migration): line.write({ 'track_id': track_id, }) + if payment.move_id: + for line in payment.move_id.lines: + line.write({ + 'track_id': track_id, + }) for invoice in hdcase.invoices: for line in invoice.lines: line.write({ 'track_id': track_id, }) + if invoice.move_id: + for line in invoice.move_id.lines: + line.write({ + 'track_id': track_id, + }) Migration.register()