Skip to content

Commit 73d471a

Browse files
committed
[FIX][spp_area_base] Improve area import workflow and UI logic
- Fix excel_file_change method to require both file and name before upload state change - Remove confusing else clause that was setting upload state even without file - Update import button visibility to hide when locked_reason exists (during processing) - Prevent premature state changes and improve user experience during import process - Ensure import button is properly hidden during background processing operations
1 parent e74b4a8 commit 73d471a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

spp_area_base/models/area_import.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,14 @@ def excel_file_change(self):
8888
and state fields based on the value of the excel_file field.
8989
"""
9090

91-
if self.name:
91+
if self.excel_file and self.name:
9292
self.update(
9393
{
9494
"date_uploaded": fields.Datetime.now(),
9595
"upload_id": self.env.user,
9696
"state": self.UPLOADED,
9797
}
9898
)
99-
else:
100-
self.update({"date_uploaded": None, "upload_id": None, "state": self.UPLOADED})
10199

102100
@api.depends("raw_data_ids", "raw_data_ids.state")
103101
def _compute_get_total_rows(self):

spp_area_base/views/area_import_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
type="object"
2222
string="Import"
2323
class="btn-primary"
24-
invisible="state != 'Parsed' or missing_languages"
24+
invisible="state != 'Parsed' or (missing_languages or locked_reason)"
2525
/>
2626
<button
2727
name="save_to_area"

0 commit comments

Comments
 (0)