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,
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)