From 3c0443a9d366ee64fcc1cb1561e17dbcc68bb2bc Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Thu, 15 Apr 2010 14:57:22 +0530 Subject: [PATCH 01/84] [IMP] product:convert the price_list wizard into osv_memory wizard bzr revid: sbh@tinyerp.com-20100415092722-snzdrw61zoolk367 --- addons/product/__terp__.py | 2 +- addons/product/product_wizard.xml | 11 ---- addons/product/wizard/__init__.py | 2 +- addons/product/wizard/product_price.py | 67 ++++++++++++++++++++ addons/product/wizard/product_price_view.xml | 33 ++++++++++ addons/product/wizard/wizard_price.py | 59 ----------------- 6 files changed, 102 insertions(+), 72 deletions(-) delete mode 100644 addons/product/product_wizard.xml create mode 100644 addons/product/wizard/product_price.py create mode 100644 addons/product/wizard/product_price_view.xml delete mode 100644 addons/product/wizard/wizard_price.py diff --git a/addons/product/__terp__.py b/addons/product/__terp__.py index 4128e992c82..b3e18ced10a 100644 --- a/addons/product/__terp__.py +++ b/addons/product/__terp__.py @@ -49,13 +49,13 @@ 'update_xml': [ 'security/product_security.xml', 'security/ir.model.access.csv', + 'wizard/product_price_view.xml', 'product_data.xml', 'product_report.xml', 'product_view.xml', 'pricelist_view.xml', 'partner_view.xml', 'company_view.xml', - 'product_wizard.xml', 'process/product_process.xml' ], 'installable': True, diff --git a/addons/product/product_wizard.xml b/addons/product/product_wizard.xml deleted file mode 100644 index f226cd4e543..00000000000 --- a/addons/product/product_wizard.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/addons/product/wizard/__init__.py b/addons/product/wizard/__init__.py index fed1bcf3783..47f5f2641fc 100644 --- a/addons/product/wizard/__init__.py +++ b/addons/product/wizard/__init__.py @@ -18,7 +18,7 @@ # along with this program. If not, see . # ############################################################################## -import wizard_price +import product_price # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product/wizard/product_price.py b/addons/product/wizard/product_price.py new file mode 100644 index 00000000000..e5d73945c13 --- /dev/null +++ b/addons/product/wizard/product_price.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv, fields +from tools.translate import _ + + +class product_price_list(osv.osv_memory): + _name = 'product.price_list' + _description = 'Product Price List' + + _columns = { + 'price_list': fields.many2one('product.pricelist', 'PriceList', required=True), + 'qty1': fields.integer('Quantity-1'), + 'qty2': fields.integer('Quantity-2'), + 'qty3': fields.integer('Quantity-3'), + 'qty4': fields.integer('Quantity-4'), + 'qty5': fields.integer('Quantity-5'), + } + _defaults = { + 'qty1': lambda *a: 0, + 'qty2': lambda *a: 0, + 'qty3': lambda *a: 0, + 'qty4': lambda *a: 0, + 'qty5': lambda *a: 0, + } + + def print_report(self, cr, uid, ids, context=None): + + """ + To get the date and print the report + @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 : return report + """ + datas = {'ids': context.get('active_ids', [])} + res = self.read(cr, uid, ids, ['price_list','qty1', 'qty2','qty3','qty4','qty5'], context) + res = res and res[0] or {} + datas['form'] = res + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'product.pricelist', + 'datas': datas, + } +product_price_list() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/product/wizard/product_price_view.xml b/addons/product/wizard/product_price_view.xml new file mode 100644 index 00000000000..17d9010ed43 --- /dev/null +++ b/addons/product/wizard/product_price_view.xml @@ -0,0 +1,33 @@ + + + + + + + + Price List + product.price_list + form + +
+ + + + + + +