if context is None:
context = {}
line_obj = self.pool.get('account.invoice.line')
- create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context=context)
+ create_ids = super(sale_order_line, self).invoice_line_create(cr, uid, ids, context=context)
i = 0
for line in self.browse(cr, uid, ids, context):
line_obj.write(cr, uid, [create_ids[i]], {'analytics_id': line.analytics_id.id})
sale_order_line()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
class sale_order_line(osv.osv):
def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
- tax_obj = self.pool.get('account.tax')
- cur_obj = self.pool.get('res.currency')
res = {}
context = context or {}
for line in self.browse(cr, uid, ids, context=context):
return invoice_line_ids
def onchange_sale_order_line_view(self, cr, uid, id, type, context={}, *args):
- temp = {}
- temp['value'] = {}
- if (not type):
- return {}
- 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'] = ' '
- if type == 'break':
- temp['value']['name'] = ' '
- if type == 'subtotal':
- temp['value']['name'] = 'Sub Total'
- return temp
+ temp = {}
+ temp['value'] = {}
+ if (not type):
return {}
+ 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'] = ' '
+ if type == 'break':
+ temp['value']['name'] = ' '
+ if type == 'subtotal':
+ temp['value']['name'] = 'Sub Total'
+ return temp
+ return {}
def create(self, cr, user, vals, context=None):
if vals.has_key('layout_type'):
default['layout_type'] = self.browse(cr, uid, id).layout_type
return super(sale_order_line, self).copy(cr, uid, id, default, context)
-
- _name = "sale.order.line"
_order = "order_id, sequence asc"
_description = "Sale Order line"
_inherit = "sale.order.line"
##############################################################################
from osv import fields, osv
-from tools import config
class sale_order_line(osv.osv):
_inherit = "sale.order.line"
return super(account_invoice_line, self).create(cr, uid, vals, context)
account_invoice_line()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: