[FIX] rma: sequence without force_company

This commit is contained in:
Jared Kipe
2022-05-12 19:58:13 +00:00
parent 4096d1592f
commit effadc891a

View File

@@ -333,8 +333,7 @@ class RMA(models.Model):
def create(self, vals):
if vals.get('name', _('New')) == _('New'):
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')
else:
self = self.with_company(vals['company_id'])
vals['name'] = self.env['ir.sequence'].next_by_code('rma.rma') or _('New')
# Provide defaults on create (e.g. from portal)