From 394cfd398ff22013612228db0e36c785f83c8a04 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Tue, 21 Dec 2010 12:46:53 +0530 Subject: [PATCH 1/2] [FIX]: Fixed problem of zero division in action_consume of move bzr revid: rpa@tinyerp.com-20101221071653-ksfh0unorhuuk3e7 --- addons/stock/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 76fb97b6b71..81efdbca71e 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2272,6 +2272,8 @@ class stock_move(osv.osv): res = [] for move in self.browse(cr, uid, ids, context=context): move_qty = move.product_qty + if move_qty <= 0: + raise osv.except_osv(_('Error!'), _('Can not consume a move with negative or zero quantity !')) quantity_rest = move.product_qty quantity_rest -= quantity From 5a0a79f5d5bdfc9f4d19afe6af6f49d04acfbbe8 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Tue, 21 Dec 2010 12:29:25 +0100 Subject: [PATCH 2/2] [IMP] product: suppliers info and pricelist usability improvements bzr revid: qdp-launchpad@tinyerp.com-20101221112925-6ph8bln9x8stnzyn --- addons/product/pricelist.py | 2 +- addons/product/product.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index e2c4f6735b2..836ac207d29 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -538,7 +538,7 @@ class product_pricelist_item(osv.osv): 'categ_id': fields.many2one('product.category', 'Product Category', ondelete='cascade', help="Set a category of product if this rule only apply to products of a category and his childs. Keep empty for all products"), 'min_quantity': fields.integer('Min. Quantity', required=True, help="The rule only applies if the partner buys/sells more than this quantity."), - 'sequence': fields.integer('Sequence', required=True, help="Gives the sequence order when displaying a list of pricelist items."), + 'sequence': fields.integer('Sequence', required=True, help="Gives the order in which the pricelist items will be checked. The evaluation gives highest priority to lowest sequence and stops as soon as a matching item is found."), 'base': fields.selection(_price_field_get, 'Based on', required=True, size=-1, help="The mode for computing the price for this rule."), 'base_pricelist_id': fields.many2one('product.pricelist', 'If Other Pricelist'), diff --git a/addons/product/product.py b/addons/product/product.py index fae54f36933..4fc03d0b2b8 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -706,7 +706,7 @@ class product_supplierinfo(osv.osv): 'product_code': fields.char('Supplier Product Code', size=64, help="This supplier's product code will be used when printing a request for quotation. Keep empty to use the internal one."), 'sequence' : fields.integer('Sequence', help="Assigns the priority to the list of product supplier."), 'product_uom': fields.many2one('product.uom', string="UOM", help="Supplier Product UoM."), - 'min_qty': fields.float('Minimal Quantity', required=True, help="The minimal quantity to purchase to this supplier, expressed in the default unit of measure."), + 'min_qty': fields.float('Minimal Quantity', required=True, help="The minimal quantity to purchase to this supplier, expressed in the supplier Product UoM if not empty, in the default unit of measure of the product otherwise."), 'qty': fields.function(_calc_qty, method=True, store=True, type='float', string='Quantity', multi="qty", help="This is a quantity which is converted into Default Uom."), 'product_id' : fields.many2one('product.template', 'Product', required=True, ondelete='cascade', select=True), 'delay' : fields.integer('Delivery Lead Time', required=True, help="Lead time in days between the confirmation of the purchase order and the reception of the products in your warehouse. Used by the scheduler for automatic computation of the purchase order planning."), @@ -775,7 +775,7 @@ class pricelist_partnerinfo(osv.osv): _columns = { 'name': fields.char('Description', size=64), 'suppinfo_id': fields.many2one('product.supplierinfo', 'Partner Information', required=True, ondelete='cascade'), - 'min_quantity': fields.float('Quantity', required=True), + 'min_quantity': fields.float('Quantity', required=True, help="The minimal quantity to trigger this rule, expressed in the default UoM of the product."), 'price': fields.float('Unit Price', required=True, digits_compute=dp.get_precision('Purchase Price'), help="This price will be considered as a price for default Unit of Measure of the product"), } _order = 'min_quantity asc'