[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
This commit is contained in:
skh
2011-05-31 15:02:10 +05:30
parent 9f2160bcac
commit a98ba79ae4
2 changed files with 3 additions and 4 deletions
@@ -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,
@@ -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)