From f33da7f56ef211cc397188e09caf2816f1e1001a Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Thu, 17 Sep 2009 11:07:04 +0200 Subject: [PATCH] Migrate packing* objects and tables to shipment* --- purchase.py | 9 +++++++++ purchase.xml | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/purchase.py b/purchase.py index 43a2852b9f..29d32edd81 100644 --- a/purchase.py +++ b/purchase.py @@ -12,6 +12,15 @@ class Purchase(ModelSQL, ModelView): 'purchase.purchase-ignored-account.invoice.line', 'purchase', 'invoice', 'Invoice Lines Ignored', readonly=True) + def init(self, cursor, module_name): + # Migration from 1.2: packing renamed into shipment + cursor.execute("UPDATE ir_model_data "\ + "SET fs_id = REPLACE(fs_id, 'packing', 'shipment') "\ + "WHERE fs_id like '%%packing%%' "\ + "AND module = %s", (module_name,)) + + super(Purchase, self).init(cursor, module_name) + def create_invoice(self, cursor, user, purchase_id, context=None): invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') diff --git a/purchase.xml b/purchase.xml index 4898a4429a..c562f3b0f9 100644 --- a/purchase.xml +++ b/purchase.xml @@ -32,11 +32,11 @@ this repository contains the full copyright notices and license terms. --> + id="purchase_transition_waiting_invoice_shipment_invoice_shipment_done"> + ref="purchase.purchase_activity_waiting_invoice_shipment"/> + ref="purchase.purchase_activity_invoice_shipment_done"/> account.invoice.line [x.id for x in invoice_lines] invoice_paid