mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[FIX] rma: sequence without force_company
This commit is contained in:
@@ -333,9 +333,8 @@ class RMA(models.Model):
|
|||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
if vals.get('name', _('New')) == _('New'):
|
if vals.get('name', _('New')) == _('New'):
|
||||||
if 'company_id' in vals:
|
if 'company_id' in vals:
|
||||||
vals['name'] = self.env['ir.sequence'].with_context(force_company=vals['company_id']).next_by_code('rma.rma') or _('New')
|
self = self.with_company(vals['company_id'])
|
||||||
else:
|
vals['name'] = self.env['ir.sequence'].next_by_code('rma.rma') or _('New')
|
||||||
vals['name'] = self.env['ir.sequence'].next_by_code('rma.rma') or _('New')
|
|
||||||
|
|
||||||
# Provide defaults on create (e.g. from portal)
|
# Provide defaults on create (e.g. from portal)
|
||||||
if vals.get('template_id'):
|
if vals.get('template_id'):
|
||||||
|
|||||||
Reference in New Issue
Block a user