[FIX]action_invoice_create return a list and not a dict + fix dependencies for delivery
bzr revid: csn@openerp.com-20130905153317-tledb2ht933pwt28
This commit is contained in:
@@ -33,7 +33,7 @@ class stock_picking(osv.osv):
|
||||
'''Return ids of created invoices for the pickings'''
|
||||
res = super(stock_picking,self).action_invoice_create(cr, uid, ids, journal_id, group, type, context=context)
|
||||
if type == 'in_refund':
|
||||
for inv in self.pool.get('account.invoice').browse(cr, uid, res.values(), context=context):
|
||||
for inv in self.pool.get('account.invoice').browse(cr, uid, res, context=context):
|
||||
for ol in inv.invoice_line:
|
||||
if ol.product_id:
|
||||
oa = ol.product_id.property_stock_account_output and ol.product_id.property_stock_account_output.id
|
||||
@@ -45,7 +45,7 @@ class stock_picking(osv.osv):
|
||||
self.pool.get('account.invoice.line').write(cr, uid, [ol.id], {'account_id': a})
|
||||
|
||||
elif type == 'in_invoice':
|
||||
for inv in self.pool.get('account.invoice').browse(cr, uid, res.values(), context=context):
|
||||
for inv in self.pool.get('account.invoice').browse(cr, uid, res, context=context):
|
||||
for ol in inv.invoice_line:
|
||||
if ol.product_id:
|
||||
oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id
|
||||
|
||||
@@ -32,7 +32,7 @@ You can define your own carrier and delivery grids for prices. When creating
|
||||
invoices from picking, OpenERP is able to add and compute the shipping line.
|
||||
""",
|
||||
'author': 'OpenERP SA',
|
||||
'depends': ['sale', 'purchase', 'stock'],
|
||||
'depends': ['sale', 'purchase', 'stock_account'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'delivery_report.xml',
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -127,8 +127,8 @@ class stock_picking(osv.osv):
|
||||
result = super(stock_picking, self).action_invoice_create(cr, uid,
|
||||
ids, journal_id=journal_id, group=group, type=type,
|
||||
context=context)
|
||||
for picking in picking_obj.browse(cr, uid, result.keys(), context=context):
|
||||
invoice = invoice_obj.browse(cr, uid, result[picking.id], context=context)
|
||||
for picking in picking_obj.browse(cr, uid, result, context=context):
|
||||
invoice = invoice_obj.browse(cr, uid, picking.id, context=context)
|
||||
invoice_line = self._prepare_shipping_invoice_line(cr, uid, picking, invoice, context=context)
|
||||
if invoice_line:
|
||||
invoice_line_obj.create(cr, uid, invoice_line)
|
||||
|
||||
Reference in New Issue
Block a user