diff --git a/purchase_packaging/__init__.py b/purchase_packaging/__init__.py index cde864bae..e09445c76 100755 --- a/purchase_packaging/__init__.py +++ b/purchase_packaging/__init__.py @@ -1,3 +1,8 @@ # -*- coding: utf-8 -*- from . import models + + +def set_product_purchase_qty(cr, registry): + cr.execute("""update purchase_order_line + set product_purchase_qty = product_qty""") diff --git a/purchase_packaging/__openerp__.py b/purchase_packaging/__openerp__.py index 093fe13e4..732f2b0fd 100755 --- a/purchase_packaging/__openerp__.py +++ b/purchase_packaging/__openerp__.py @@ -33,6 +33,7 @@ "data": ["views/product_views.xml", "views/purchase_views.xml", ], + "post_init_hook": "set_product_purchase_qty", "license": "AGPL-3", "installable": True, "application": False,