From 6e948ccb54036e70c49f51df48dee8dd4a3de674 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Wed, 15 Jun 2011 16:29:40 +0530 Subject: [PATCH 1/3] [FIX] product:Now user can create unique UOM lp bug: https://launchpad.net/bugs/731035 fixed bzr revid: aag@tinyerp.co.in-20110615105940-ke84jj7rrgtpv02v --- addons/product/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index fa6796b3953..1db24e1bd32 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -122,7 +122,7 @@ class product_uom(osv.osv): _sql_constraints = [ ('factor_gt_zero', 'CHECK (factor!=0)', 'The conversion ratio for a unit of measure cannot be 0!'), - ('factor_category_id_uniq', 'unique (category_id, factor)', 'You can not have more than one UOM with same factor for same UOM category'), + ('uom_name_unique', 'unique (name)', 'You cannot have multiple Units of Measure with the same name'), ] def _compute_qty(self, cr, uid, from_uom_id, qty, to_uom_id=False): From 4b6c69f4219c2eeba85a4dc97369a0f34448396b Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Tue, 21 Jun 2011 18:03:55 +0530 Subject: [PATCH 2/3] [FIX] product :Remove _sql_constraints lp bug: https://launchpad.net/bugs/731035 fixed bzr revid: aag@tinyerp.co.in-20110621123355-rxwrb82jlckl622w --- addons/product/product.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index 1db24e1bd32..a6513522db2 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -122,7 +122,6 @@ class product_uom(osv.osv): _sql_constraints = [ ('factor_gt_zero', 'CHECK (factor!=0)', 'The conversion ratio for a unit of measure cannot be 0!'), - ('uom_name_unique', 'unique (name)', 'You cannot have multiple Units of Measure with the same name'), ] def _compute_qty(self, cr, uid, from_uom_id, qty, to_uom_id=False): From 645d0a870d32bec67b1fc3d40d6ece0d52df0d52 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Fri, 1 Jul 2011 17:26:28 +0530 Subject: [PATCH 3/3] [FIX] purchase,sale : one category can have several UoM references than it will not give error msg when open related Report lp bug: https://launchpad.net/bugs/731035 fixed bzr revid: aag@tinyerp.co.in-20110701115628-500ttalfgqlhifnx --- addons/purchase/report/purchase_report.py | 2 +- addons/sale/report/sale_report.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py index 6b68cecf1a5..c91920a0d86 100644 --- a/addons/purchase/report/purchase_report.py +++ b/addons/purchase/report/purchase_report.py @@ -93,7 +93,7 @@ class purchase_report(osv.osv): l.product_id, t.categ_id as category_id, (case when u.uom_type not in ('reference') then - (select id from product_uom where uom_type='reference' and category_id = 1) + (select id from product_uom where uom_type='reference' and category_id = 1 LIMIT 1) else u.id end) as product_uom, diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py index aaaec228d7b..ed457835fb6 100644 --- a/addons/sale/report/sale_report.py +++ b/addons/sale/report/sale_report.py @@ -91,7 +91,7 @@ class sale_report(osv.osv): select l.id as id, l.product_id as product_id, (case when u.uom_type not in ('reference') then - (select name from product_uom where uom_type='reference' and category_id=u.category_id) + (select name from product_uom where uom_type='reference' and category_id=u.category_id LIMIT 1) else u.name end) as uom_name,