From 8e708bf2c43323532b8ea4514dfe30611a2e4961 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Thu, 14 May 2026 00:40:28 -0400 Subject: [PATCH] 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 --- fusion_clock/models/res_company.py | 1 + fusion_clock/tests/test_nfc_models.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fusion_clock/models/res_company.py b/fusion_clock/models/res_company.py index 7672f667..0780fe43 100644 --- a/fusion_clock/models/res_company.py +++ b/fusion_clock/models/res_company.py @@ -11,6 +11,7 @@ class ResCompany(models.Model): x_fclk_nfc_kiosk_location_id = fields.Many2one( 'fusion.clock.location', string='NFC Kiosk Location', + domain="[('company_id', '=', id)]", help="Designates which fusion.clock.location is bound to the NFC kiosk " "for this company. Required when NFC kiosk is enabled.", ) diff --git a/fusion_clock/tests/test_nfc_models.py b/fusion_clock/tests/test_nfc_models.py index c9338434..4b3d1f79 100644 --- a/fusion_clock/tests/test_nfc_models.py +++ b/fusion_clock/tests/test_nfc_models.py @@ -88,7 +88,7 @@ class TestNfcAttendanceFields(TransactionCase): class TestNfcKioskCompanyField(TransactionCase): 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({ 'name': 'Plant 1', 'latitude': 43.65,