fix(fusion_clock): NFC kiosk location domain + test isolation
Add domain filter on x_fclk_nfc_kiosk_location_id so the dropdown only shows locations belonging to the current company in multi-company setups. Replace shared-company mutation in test with a fresh company to prevent cross-test state leakage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ class ResCompany(models.Model):
|
|||||||
x_fclk_nfc_kiosk_location_id = fields.Many2one(
|
x_fclk_nfc_kiosk_location_id = fields.Many2one(
|
||||||
'fusion.clock.location',
|
'fusion.clock.location',
|
||||||
string='NFC Kiosk Location',
|
string='NFC Kiosk Location',
|
||||||
|
domain="[('company_id', '=', id)]",
|
||||||
help="Designates which fusion.clock.location is bound to the NFC kiosk "
|
help="Designates which fusion.clock.location is bound to the NFC kiosk "
|
||||||
"for this company. Required when NFC kiosk is enabled.",
|
"for this company. Required when NFC kiosk is enabled.",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class TestNfcAttendanceFields(TransactionCase):
|
|||||||
class TestNfcKioskCompanyField(TransactionCase):
|
class TestNfcKioskCompanyField(TransactionCase):
|
||||||
|
|
||||||
def test_company_has_nfc_kiosk_location(self):
|
def test_company_has_nfc_kiosk_location(self):
|
||||||
company = self.env.company
|
company = self.env['res.company'].create({'name': 'NFC Test Co Plant'})
|
||||||
location = self.env['fusion.clock.location'].create({
|
location = self.env['fusion.clock.location'].create({
|
||||||
'name': 'Plant 1',
|
'name': 'Plant 1',
|
||||||
'latitude': 43.65,
|
'latitude': 43.65,
|
||||||
|
|||||||
Reference in New Issue
Block a user