[FIX] sale: pass context when creating Sale Order name

Without passing the context, this is not possible
to force the company (`force_company`)

Closes #7242
This commit is contained in:
Peter Alabaster 2015-05-21 16:52:03 +01:00 committed by Denis Ledoux
parent d0952f5ad3
commit e17166183d
1 changed files with 1 additions and 1 deletions

View File

@ -352,7 +352,7 @@ class sale_order(osv.osv):
if context is None:
context = {}
if vals.get('name', '/') == '/':
vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'sale.order') or '/'
vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'sale.order', context=context) or '/'
if vals.get('partner_id') and any(f not in vals for f in ['partner_invoice_id', 'partner_shipping_id', 'pricelist_id', 'fiscal_position']):
defaults = self.onchange_partner_id(cr, uid, [], vals['partner_id'], context=context)['value']
if not vals.get('fiscal_position') and vals.get('partner_shipping_id'):