From a98ba79ae4929fe31402d26b2fc312157116a292 Mon Sep 17 00:00:00 2001 From: skh Date: Tue, 31 May 2011 15:02:10 +0530 Subject: [PATCH 1/2] [FIX] product_visible_discount: Correction in the __openerp__.py for the dependency module and fix the code for the product pricelist item(Ref : Case 5998) bzr revid: skh@tinyerp.com-20110531093210-k75iw1zhx6u8z1l2 --- addons/product_visible_discount/__openerp__.py | 2 +- addons/product_visible_discount/product_visible_discount.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/product_visible_discount/__openerp__.py b/addons/product_visible_discount/__openerp__.py index 8e59bc395d7..0bbb9c1e2c5 100644 --- a/addons/product_visible_discount/__openerp__.py +++ b/addons/product_visible_discount/__openerp__.py @@ -30,7 +30,7 @@ If the check box is checked, we will have on the sale order line: Unit price=450, Discount=50,00, Net price=225 If the check box is unchecked, we will have on Sale Order and Invoice lines: Unit price=225, Discount=0,00, Net price=225 """, - "depends": ["sale"], + "depends": ["sale","purchase"], "demo_xml": [], "update_xml": ['product_visible_discount_view.xml'], "active": False, diff --git a/addons/product_visible_discount/product_visible_discount.py b/addons/product_visible_discount/product_visible_discount.py index b347321bebe..dcd2641b184 100644 --- a/addons/product_visible_discount/product_visible_discount.py +++ b/addons/product_visible_discount/product_visible_discount.py @@ -114,11 +114,10 @@ class account_invoice_line(osv.osv): product_obj = self.pool.get('product.product') template_obj = self.pool.get('product.template') field_name = 'list_price' - if res_dict.get('item_id',False) and res_dict['item_id'].get(pricelist,False): item = res_dict['item_id'].get(pricelist,False) - item_base = item_obj.read(cr, uid, [item], ['base'])[0]['base'] - if item_base > 0: + item_base = item_obj.read(cr, uid, [item], ['base']) + if item_base and item_base[0]['base'] > 0: field_name = price_type_obj.browse(cr, uid, item_base).field product = product_obj.browse(cr, uid, product_id, context) From 13b4cb8250419d53ff69be8a7fd7456c841f600b Mon Sep 17 00:00:00 2001 From: "Jay Vora (OpenERP)" Date: Wed, 1 Jun 2011 17:58:04 +0530 Subject: [PATCH 2/2] [FIX] l10n_ch : Correction made to look for customer invoices only on BVR import(Case 5493) bzr revid: jvo@tinyerp.com-20110601122804-9m5x99h62nz9xcbs --- addons/l10n_ch/wizard/bvr_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_ch/wizard/bvr_import.py b/addons/l10n_ch/wizard/bvr_import.py index 5fb7bda2a12..1fe8380b033 100644 --- a/addons/l10n_ch/wizard/bvr_import.py +++ b/addons/l10n_ch/wizard/bvr_import.py @@ -36,7 +36,7 @@ def _reconstruct_invoice_ref(cursor, user, reference, context=None): user_current=user_obj.browse(cursor, user, user) ## - cursor.execute("SELECT inv.id,inv.number from account_invoice AS inv where inv.company_id = %s" ,(user_current.company_id.id,)) + cursor.execute("SELECT inv.id,inv.number from account_invoice AS inv where inv.company_id = %s and type='out_invoice'" ,(user_current.company_id.id,)) result_invoice = cursor.fetchall() REF = re.compile('[^0-9]') for inv_id,inv_name in result_invoice: