odoo/odoo#192242

Created by fw-bot
Merged at 4b0ec47abd8c886b10e888ae73d5dff99a18aaa2

Statuses:

label
odoo-dev:saas-17.4-17.0-h-79599-feg-y0GN-fw
head
c4c8f961f40e7b3f1ef9b0cba422fe5acd72dacc
merged
9 months ago by Sales, Victor Feyens (vfe)
odoo/odoo
17.0 #181244
saas-17.2 #191674
saas-17.4 #192242
18.0 #192342
saas-18.1 #192472
saas-18.2
saas-18.3
saas-18.4
19.0
master #192614

[FW][FIX] sales: computing sales team in invoice

Versions
16.0+

Description of the issue/feature this PR addresses:

The issue occurs when selecting a partner in an invoice, the sales team is not correctly computed. The problem arises because the default_team_id is not passed as a parameter to the context when the partner is selected, which works correctly in sales orders but fails in invoices.

Current behavior before PR:

When modifying the partner_id in an invoice, the sales team is not recomputed, leading to incorrect or missing sales team assignment.

Desired behavior after PR is merged:

After this PR is merged, modifying the partner_id on an invoice will correctly recompute the sales team by passing the default_team_id in the context, ensuring consistent behavior between invoices and sales orders.

I will now provide a short video demonstrating the error. This issue is replicable if none of the sales teams have any members assigned.
https://drive.google.com/file/d/15mUpXvdlVpGZXW976PK7EVYH6X4sm2CJ/view?usp=sharing

PR of v16 #180961

Forward-Port-Of: #191674
Forward-Port-Of: #181244