From 5a04479129920749b07cdab043103655f12e1162 Mon Sep 17 00:00:00 2001 From: "watcha.h@almacom.co.th" Date: Tue, 4 Aug 2015 18:24:37 +0700 Subject: [PATCH] update tracking of journal entry --- .../migrations/update_account_tracking.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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()