Skip to content

Commit 1056b61

Browse files
tafaRUbrian10048
authored andcommitted
[IMP] Fill customer_id with that of location
1 parent 3c05ca0 commit 1056b61

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fieldservice_account_analytic/models/fsm_order.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2018 - TODAY, Open Source Integrators
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
33

4-
from odoo import fields, models
4+
from odoo import api, fields, models
55

66

77
class FSMOrder(models.Model):
@@ -21,6 +21,10 @@ class FSMOrder(models.Model):
2121
tracking=True,
2222
)
2323

24+
@api.onchange("location_id")
25+
def _onchange_location_id(self):
26+
self.customer_id = self.location_id.customer_id
27+
2428
def _compute_total_cost(self):
2529
"""To be overridden as needed from other modules"""
2630
for order in self:

0 commit comments

Comments
 (0)