diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py index 9e0a65718fa..762e89c4614 100644 --- a/addons/mrp/__terp__.py +++ b/addons/mrp/__terp__.py @@ -64,6 +64,7 @@ 'wizard/make_procurement_view.xml', 'wizard/change_production_qty_view.xml', 'wizard/orderpoint_procurement_view.xml', + 'wizard/mrp_price_view.xml', 'mrp_view.xml', 'wizard/schedulers_all_view.xml', 'mrp_wizard.xml', diff --git a/addons/mrp/mrp_wizard.xml b/addons/mrp/mrp_wizard.xml index f42409559ba..88e4e047e50 100644 --- a/addons/mrp/mrp_wizard.xml +++ b/addons/mrp/mrp_wizard.xml @@ -4,14 +4,14 @@ - - - - - Product Cost Structure - - - + + + + + + + + diff --git a/addons/mrp/wizard/__init__.py b/addons/mrp/wizard/__init__.py index b18384fd0b2..5cf8a7187eb 100644 --- a/addons/mrp/wizard/__init__.py +++ b/addons/mrp/wizard/__init__.py @@ -23,7 +23,7 @@ import mrp_product_produce import orderpoint_procurement import wizard_procurement import schedulers_all -import wizard_price +import mrp_price import wizard_workcenter_load import wizard_track_prod import change_production_qty diff --git a/addons/mrp/wizard/wizard_price.py b/addons/mrp/wizard/mrp_price.py similarity index 51% rename from addons/mrp/wizard/wizard_price.py rename to addons/mrp/wizard/mrp_price.py index dd84ad23be2..5d3c16cbaa5 100644 --- a/addons/mrp/wizard/wizard_price.py +++ b/addons/mrp/wizard/mrp_price.py @@ -19,31 +19,37 @@ # ############################################################################## -import wizard +from osv import fields, osv -price_form = ''' -
- -''' - -price_fields = { - 'number': {'string':'Number of products to produce', 'type':'integer', 'required':True}, -} - -class wizard_price(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':price_form, 'fields':price_fields, 'state':[('end','Cancel'),('price','Print product price') ]} - }, - 'price': { - 'actions': [], - 'result': {'type':'print', 'report':'product.price', 'state':'end'} - } +class mrp_price(osv.osv_memory): + _name = 'mrp.product_price' + _description = 'Product Price' + _columns = { + 'number': fields.integer('Number of products to produce', required=True), } -wizard_price('product_price') - + + def print_report(self, cr, uid, ids, context=None): + """ + To print the report of Product cost structure + + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param context: A standard dictionary + + @return : Report + """ + datas = {'ids' : context.get('active_ids',[])} + res = self.read(cr, uid, ids, ['number']) + res = res and res[0] or {} + datas['form'] = res + + return { + 'type' : 'ir.actions.report.xml', + 'report_name':'product.price', + 'datas' : datas, + } +mrp_price() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/mrp/wizard/mrp_price_view.xml b/addons/mrp/wizard/mrp_price_view.xml new file mode 100644 index 00000000000..e2e294c5739 --- /dev/null +++ b/addons/mrp/wizard/mrp_price_view.xml @@ -0,0 +1,33 @@ + + + + + + + + Product Cost Structure + mrp.product_price + form + +
+ + + +