[FIX] website_sale: fallback on partner sales team if undefined on website
When a sale is done on the website, a corresponding sale order is created in the backend. By default the salesperson and sales team associated to the sale are as defined on the website. When we prepare values, we fallback on the partner sales team in a way that is coherent with the way it falls back on the partner for the salesperson. opw 1882640
This commit is contained in:
@@ -166,7 +166,7 @@ class Website(models.Model):
|
||||
'partner_id': partner.id,
|
||||
'pricelist_id': pricelist.id,
|
||||
'payment_term_id': self.sale_get_payment_term(partner),
|
||||
'team_id': self.salesteam_id.id,
|
||||
'team_id': self.salesteam_id.id or partner.parent_id.team_id.id or partner.team_id.id,
|
||||
'partner_invoice_id': addr['invoice'],
|
||||
'partner_shipping_id': addr['delivery'],
|
||||
'user_id': salesperson_id or self.salesperson_id.id or default_user_id,
|
||||
|
||||
Reference in New Issue
Block a user