Skip to content

[16.0] [FIX] fieldservice_sale: fall back to partner's primary service location#1549

Open
eLBati wants to merge 1 commit into
OCA:16.0from
eLBati:fix_service_location_id
Open

[16.0] [FIX] fieldservice_sale: fall back to partner's primary service location#1549
eLBati wants to merge 1 commit into
OCA:16.0from
eLBati:fix_service_location_id

Conversation

@eLBati

@eLBati eLBati commented Jun 11, 2026

Copy link
Copy Markdown
Member

When autofilling a Sale Order's Service Location, the location was only
resolved by matching an fsm.location whose related partner_id is the SO
customer, its shipping partner or its commercial partner. A customer that
is an ordinary contact (not itself a location) was left without a location,
even when its res.partner.service_location_id explicitly pointed at one.

Add service_location_id as a last-resort fallback in
_compute_fsm_location_id: the existing partner -> location matching still
takes precedence, and the customer's primary service location is used only
when no other match is found. service_location_id is added to the field's
depends so the SO location recomputes when it changes.

  When autofilling a Sale Order's Service Location, the location was only
  resolved by matching an fsm.location whose related partner_id is the SO
  customer, its shipping partner or its commercial partner. A customer that
  is an ordinary contact (not itself a location) was left without a location,
  even when its res.partner.service_location_id explicitly pointed at one.

  Add service_location_id as a last-resort fallback in
  _compute_fsm_location_id: the existing partner -> location matching still
  takes precedence, and the customer's primary service location is used only
  when no other match is found. service_location_id is added to the field's
  depends so the SO location recomputes when it changes.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @wolfhall, @max3903, @brian10048,
some modules you are maintaining are being modified, check this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:fieldservice_sale Module fieldservice_sale series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants