[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:
Cedric Snauwaert
2013-09-05 17:33:17 +02:00
parent fdb3659a23
commit 6b68b2e704
4 changed files with 5 additions and 6 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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)