[FIX] sale: have online salesperson default working

A sales order on the website will have as salesperson:

- the contact salesperson, and if not set

But if it's not a new address, the "Online orders" > "Salesperson" is
not used.

With this changeset, the "Online orders" > "Salesperson" is used by
default if there is no salesperson on the partner as was the intention.

opw-2274665
closes #52933

closes odoo/odoo#52939

X-original-commit: 957361a5c44b3797318657ce2486a3eff2a3f651
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2020-06-12 17:29:03 +00:00
parent d49d1e4437
commit b4b0828e25
+1 -1
View File
@@ -370,7 +370,7 @@ class SaleOrder(models.Model):
user_id = partner_user.id
if not self.env.context.get('not_self_saleperson'):
user_id = user_id or self.env.uid
if self.user_id.id != user_id:
if user_id and self.user_id.id != user_id:
values['user_id'] = user_id
if self.env['ir.config_parameter'].sudo().get_param('account.use_invoice_terms') and self.env.company.invoice_terms: