[FIX] stock: on stock picking invoicing, allow to pick a journal if no move line

This commit is contained in:
Denis Ledoux 2014-11-27 13:25:54 +01:00
parent 043f7b84b8
commit 2080ea0f0a
1 changed files with 17 additions and 16 deletions

View File

@ -46,8 +46,8 @@ class stock_invoice_onshipping(osv.osv_memory):
browse_picking = model_pool.browse(cr, uid, res_ids, context=context)
for pick in browse_picking:
if not pick.move_lines:
continue
domain = [('type', 'in', ['sale', 'sale_refund', 'purchase', 'purchase_refund'])]
if pick.move_lines:
src_usage = pick.move_lines[0].location_id.usage
dest_usage = pick.move_lines[0].location_dest_id.usage
type = pick.type
@ -61,8 +61,9 @@ class stock_invoice_onshipping(osv.osv_memory):
journal_type = 'sale_refund'
else:
journal_type = 'sale'
domain = [('type', '=', journal_type)]
value = journal_obj.search(cr, uid, [('type', '=',journal_type )])
value = journal_obj.search(cr, uid, domain)
for jr_type in journal_obj.browse(cr, uid, value, context=context):
t1 = jr_type.id,jr_type.name
if t1 not in vals: