[IMP] sale: add a default_section_id in the context to create invoice
bzr revid: chm@openerp.com-20130521131906-ck1nslkrbuymubhw
This commit is contained in:
parent
c810905bdf
commit
d8b6bc245d
|
@ -22,9 +22,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<separator string="Sales Teams Configuration"/>
|
||||
<separator string="Sales Teams"/>
|
||||
<group>
|
||||
<label for="id" string="Use Sales Teams"/>
|
||||
<label for="id" string="Manage Sales Teams"/>
|
||||
<div>
|
||||
<field name="group_multi_salesteams" class="oe_inline"/>
|
||||
<label for="group_multi_salesteams"/>
|
||||
|
|
|
@ -402,6 +402,8 @@ class sale_order(osv.osv):
|
|||
obj_invoice_line = self.pool.get('account.invoice.line')
|
||||
if context is None:
|
||||
context = {}
|
||||
if order.section_id:
|
||||
context.update({'default_section_id': order.section_id.id})
|
||||
invoiced_sale_line_ids = self.pool.get('sale.order.line').search(cr, uid, [('order_id', '=', order.id), ('invoiced', '=', True)], context=context)
|
||||
from_line_invoice_ids = []
|
||||
for invoiced_sale_line_id in self.pool.get('sale.order.line').browse(cr, uid, invoiced_sale_line_ids, context=context):
|
||||
|
@ -439,7 +441,7 @@ class sale_order(osv.osv):
|
|||
view of one of the newly created invoices
|
||||
"""
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
|
||||
|
||||
# create invoices through the sales orders' workflow
|
||||
inv_ids0 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)
|
||||
self.signal_manual_invoice(cr, uid, ids)
|
||||
|
|
Loading…
Reference in New Issue