[FIX] Sale_Layout : Improved and Changed the code of the onchange method for the...
authorskh <skh@tinyerp.com>
Wed, 20 Jul 2011 11:17:13 +0000 (16:47 +0530)
committerskh <skh@tinyerp.com>
Wed, 20 Jul 2011 11:17:13 +0000 (16:47 +0530)
bzr revid: skh@tinyerp.com-20110720111713-j1hufj1mrvmk2ecy

1  2 
addons/sale_layout/sale_layout.py

@@@ -48,33 -48,33 +48,30 @@@ class sale_order_line(osv.osv)
          return invoice_line_ids
  
      def onchange_sale_order_line_view(self, cr, uid, id, type, context={}, *args):
--        temp = {}
--        temp['value'] = {}
--        if (not type):
--            return {}
++        temp = {
++        'value': {
++            'name':'',
++            'product_id': False,
++            'uos_id': False,
++            'account_id': False,
++            'price_unit': 0.0,
++            'price_subtotal': 0.0,
++            'quantity': 0,
++            'discount': 0.0,
++            'invoice_line_tax_id': False,
++            'account_analytic_id': False,
++            'product_uom_qty': 0.0,
++            },
++        }
          if type != 'article':
--            temp = {
--                'value': {
--                'product_id': False,
--                'uos_id': False,
--                'account_id': False,
--                'price_unit': 0.0,
--                'price_subtotal': 0.0,
--                'quantity': 0,
--                'discount': 0.0,
--                'invoice_line_tax_id': False,
--                'account_analytic_id': False,
--                'product_uom_qty': 0.0,
--                },
--            }
              if type == 'line':
-                 temp['value']['name'] = ' '
+                 temp['value']['name'] = '___'
              if type == 'break':
-                 temp['value']['name'] = ' '
+                 temp['value']['name'] = '·····Page Break·····'
              if type == 'subtotal':
                  temp['value']['name'] = 'Sub Total'
              return temp
--        return {}
++        return temp
  
      def create(self, cr, user, vals, context=None):
          if vals.has_key('layout_type'):