[IMP] removed pricelist_sale & pricelist_purchase

bzr revid: fp@tinyerp.com-20101210155634-u44ao84d1prge4cx
This commit is contained in:
Fabien Pinckaers 2010-12-10 16:56:34 +01:00
parent 5b67a3154e
commit 098b92a207
5 changed files with 2 additions and 122 deletions

View File

@ -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:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,72 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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:

View File

@ -193,48 +193,7 @@
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/>
</record>
<record id="product.product_product_rearpanelarm0" model="product.product">
<field eval="'Public Pricelist (0.00) : 1.00
One-shot customers (0.00) : 1.00
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
</record>
<record id="product.product_product_rearpanelarm1" model="product.product">
<field eval="'Public Pricelist (0.00) : 1.00
One-shot customers (0.00) : 1.00
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
</record>
<record id="product.product_product_sidepanel0" model="product.product">
<field eval="'Public Pricelist (0.00) : 1.00
One-shot customers (0.00) : 1.00
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
</record>
<record id="product.product_product_shelf0" model="product.product">
<field eval="'Public Pricelist (0.00) : 1.00
One-shot customers (0.00) : 1.00
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
</record>
<record id="product.product_product_shelf1" model="product.product">
<field eval="'Public Pricelist (0.00) : 1.00
One-shot customers (0.00) : 1.00
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
</record>
<record id="product.product_product_woodlintelm0" model="product.product">
<field eval="'Public Pricelist (0.00) : 1.00
One-shot customers (0.00) : 1.00
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
</record>
<record id="product.product_product_metalcleats0" model="product.product">
<field eval="'Public Pricelist (0.00) : 1.00
One-shot customers (0.00) : 1.00
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
</record>
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('base.group_sale_salesman'))]" name="groups_id"/>
</record>

View File

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

View File

@ -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')
assert mnf_id, _('Sale Reference is not bind with the value')