1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# -*- encoding:utf-8 -*- # __author__ = jeff@openerp.cn from osv import osv class sale_order(osv.osv): _name = "sale.order" _inherit = "sale.order" def has_lower_price(self, cr, uid, ids): for order in self.browse(cr, uid, ids): for order_line in order.order_line: if order_line.product_id and order_line.product_id.product_tmpl_id.list_price > order_line.price_unit: return True return False sale_order() |