Skip to content

Commit 4fb8da9

Browse files
authored
Merge pull request #111 from itk-dev-rpa/hotfix/inactive_fp
Hotfix/inactive fp
2 parents 94c1f15 + fa4fcf0 commit 4fb8da9

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

changelog.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.12.1] - 2025-08-07
11+
12+
### Fixed
13+
14+
- SAP: Dismiss popup when opening an inactive FP.
15+
1016
## [2.12.0] - 2025-06-17
1117

1218
### Added
@@ -226,7 +232,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
226232

227233
- Initial release
228234

229-
[Unreleased]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/compare/2.12.0...HEAD
235+
[Unreleased]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/compare/2.12.1...HEAD
236+
[2.12.1]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/releases/tag/2.12.1
230237
[2.12.0]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/releases/tag/2.12.0
231238
[2.11.1]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/releases/tag/2.11.1
232239
[2.11.0]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/releases/tag/2.11.0

itk_dev_shared_components/sap/fmcacov.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,34 @@ def open_forretningspartner(session, fp: str) -> None:
1010
fp: The forretningspartner number.
1111
1212
Raises:
13-
ValueError: If the forretningspartner wasn't found.
13+
LookupError: If the forretningspartner wasn't found.
1414
"""
1515
session.StartTransaction('fmcacov')
1616

1717
# Find forretningspartner
1818
session.findById("wnd[0]/usr/ctxtGPART_DYN").text = fp
1919
session.findById("wnd[0]").sendVKey(0)
2020

21-
# Detect window "Forretningspartner * Entries"
22-
if session.findById('wnd[1]/usr', False) is not None:
23-
# Pop-up detected
24-
for row_id in range(3, 5):
21+
# Detect popup
22+
popup = session.findById('wnd[1]', False)
23+
24+
# Inactive FP popup
25+
if popup and popup.Text == "BP inactive":
26+
# Click 'OK'
27+
session.FindById("wnd[1]/tbar[0]/btn[25]").press()
28+
29+
# "Forretningspartner 2 Entries" popup
30+
elif popup and popup.Text == 'Forretningspartner 2 Entries':
31+
# Look for matching fp number
32+
for row_id in (3, 4):
2533
fp_row = session.FindById(f'wnd[1]/usr/lbl[103,{row_id}]')
2634
if fp_row.text == fp:
2735
fp_row.SetFocus()
2836
# Press 'Accept' button.
2937
session.FindById('wnd[1]/tbar[0]/btn[0]').press()
3038
break
3139
else:
32-
# Range exhausted
33-
raise ValueError(f"Forretningspartner '{fp}' was not found in pop-up.")
40+
raise LookupError(f"Forretningspartner '{fp}' was not found in pop-up.")
3441

3542

3643
def dismiss_key_popup(session, fp: str = "25564617") -> None:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "itk_dev_shared_components"
7-
version = "2.12.0"
7+
version = "2.12.1"
88
authors = [
99
{ name="ITK Development", email="itk-rpa@mkb.aarhus.dk" },
1010
]

0 commit comments

Comments
 (0)