From 098b92a207f685f1e6b8beb36ca970d4efe48c25 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 10 Dec 2010 16:56:34 +0100 Subject: [PATCH] [IMP] removed pricelist_sale & pricelist_purchase bzr revid: fp@tinyerp.com-20101210155634-u44ao84d1prge4cx --- addons/sale/__init__.py | 3 +- addons/sale/product.py | 72 ------------------------------- addons/sale/sale_demo.xml | 41 ------------------ addons/sale/test/data_test.yml | 4 -- addons/sale_mrp/test/sale_mrp.yml | 4 +- 5 files changed, 2 insertions(+), 122 deletions(-) delete mode 100644 addons/sale/product.py diff --git a/addons/sale/__init__.py b/addons/sale/__init__.py index 62fcf516a6b..3c7af56e808 100644 --- a/addons/sale/__init__.py +++ b/addons/sale/__init__.py @@ -26,9 +26,8 @@ import sale import stock import sale_installer -import product import wizard import report import company -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/product.py b/addons/sale/product.py deleted file mode 100644 index cf86f49f583..00000000000 --- a/addons/sale/product.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- 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 fields, osv - -class product_product(osv.osv): - _inherit = 'product.product' - - def _pricelist_calculate(self, cr, uid, ids, name, arg, context=None): - result = {} - pricelist_obj = self.pool.get('product.pricelist') - if context is None: - context = {} - if name == 'pricelist_purchase': - pricelist_ids = pricelist_obj.search(cr, uid, [('type', '=', 'purchase')]) - else: - pricelist_ids = pricelist_obj.search(cr, uid, [('type', '=', 'sale')]) - pricelist_browse = pricelist_obj.browse(cr, uid, pricelist_ids) - for product in self.browse(cr, uid, ids, context): - result[product.id] = "" - for pricelist in pricelist_browse: - for version in pricelist.version_id: - cr.execute("""select min_quantity from product_pricelist_item where price_version_id = %s""", [version.id]) - items_lines = cr.fetchall() - for line in items_lines: - qty = line[0] - try: - prices = pricelist_obj.price_get(cr, uid, [pricelist.id], product.id, qty, partner=None, context=None) - price = prices.get(pricelist.id) or 0.0 - except: - price = 0.0 - result[product.id] += "%s (%.2f) : %.2f\n" % (pricelist.name, qty or 0.0, price) - break - break - return result - - _columns = { - 'pricelist_sale':fields.function( - _pricelist_calculate, - method=True, - string='Sale Pricelists', - store=True, - type="text"), - 'pricelist_purchase':fields.function( - _pricelist_calculate, - method=True, - string='Purchase Pricelists', - store=True, - type="text"), - } - -product_product() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml index e0ac09c7421..a92afc69da6 100644 --- a/addons/sale/sale_demo.xml +++ b/addons/sale/sale_demo.xml @@ -193,48 +193,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/addons/sale/test/data_test.yml b/addons/sale/test/data_test.yml index 4a9eb489500..9fbecf7c58e 100644 --- a/addons/sale/test/data_test.yml +++ b/addons/sale/test/data_test.yml @@ -234,8 +234,6 @@ list_price: 170.0 mes_type: fixed name: LG Viewty Smart - pricelist_purchase: 'Default Purchase Pricelist (0.00) : 160.00\n' - pricelist_sale: 'Public Pricelist (0.00) : 170.00\n' procure_method: make_to_order property_account_expense: sale.account_account_payable1 property_account_income: sale.account_account_receivable0 @@ -274,8 +272,6 @@ list_price: 200 mes_type: fixed name: Slider Mobile - pricelist_purchase: 'Default Purchase Pricelist (0.00) : 500.0.00\n' - pricelist_sale: 'Public Pricelist (0.00) : 510.00\n' procure_method: make_to_order property_account_expense: sale.account_account_payable1 property_account_income: sale.account_account_receivable0 diff --git a/addons/sale_mrp/test/sale_mrp.yml b/addons/sale_mrp/test/sale_mrp.yml index cb0b5f9c433..081b65e4611 100644 --- a/addons/sale_mrp/test/sale_mrp.yml +++ b/addons/sale_mrp/test/sale_mrp.yml @@ -34,8 +34,6 @@ list_price: 200.0 mes_type: fixed name: Slider Mobile - pricelist_purchase: 'Default Purchase Pricelist (0.00) : 189.00\n' - pricelist_sale: 'Public Pricelist (0.00) : 200.00\n' procure_method: make_to_order seller_delay: '1' seller_ids: @@ -142,4 +140,4 @@ so = self.browse(cr, uid, ref("sale_order_so0")) mnf_obj=self.pool.get('mrp.production') mnf_id=mnf_obj.search(cr, uid, [('sale_ref','=',so.client_order_ref)]) - assert mnf_id, _('Sale Reference is not bind with the value') \ No newline at end of file + assert mnf_id, _('Sale Reference is not bind with the value')