purchase_packaging : add post_init_hook to correctly initialize product_purchase_qty

This commit is contained in:
Laetitia Gangloff
2016-04-01 16:18:21 +02:00
committed by Thomas Binsfeld
parent 2c915f3dce
commit d4b755d3a8
2 changed files with 6 additions and 0 deletions

View File

@@ -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""")

View File

@@ -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,