Skip to content

Commit 1f6fff6

Browse files
committed
[FIX] showing of import button
1 parent dd1d064 commit 1f6fff6

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

spp_area_base/models/area_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class OpenSPPAreaImport(models.Model):
7878
)
7979

8080
locked = fields.Boolean(default=False)
81-
locked_reason = fields.Char(readonly=True)
81+
locked_reason = fields.Text(readonly=True)
8282

8383
@api.onchange("excel_file")
8484
def excel_file_change(self):

spp_area_base/views/area_import_views.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@
88
<field name="arch" type="xml">
99
<form string="Area Import">
1010
<field name="locked" invisible="True" />
11-
<header invisible="locked">
11+
<header>
1212
<button
1313
name="parse_excel_to_json"
1414
type="object"
1515
string="Process"
1616
class="btn-primary"
17-
invisible="state != 'Uploaded'"
17+
invisible="state != 'Uploaded' or locked"
18+
/>
19+
<button
20+
name="import_data"
21+
type="object"
22+
string="Import"
23+
class="btn-primary"
24+
invisible="state != 'Parsed'"
1825
/>
1926
<button
2027
name="import_data"
@@ -28,21 +35,21 @@
2835
type="object"
2936
string="Save to Area"
3037
class="btn-success"
31-
invisible="state != 'Validated'"
38+
invisible="state != 'Validated' or locked"
3239
/>
3340
<button
3441
name="validate_raw_data"
3542
type="object"
3643
string="Validate Data"
3744
class="btn-success"
38-
invisible="state != 'Imported'"
45+
invisible="state != 'Imported' or locked"
3946
/>
4047
<button
4148
name="cancel_import"
4249
type="object"
4350
string="Cancel and Re-import"
4451
class="btn-danger"
45-
invisible="state not in ('Uploaded', 'Imported', 'Validated')"
52+
invisible="state not in ('Uploaded', 'Imported', 'Validated') or locked"
4653
/>
4754
<field
4855
name="state"

0 commit comments

Comments
 (0)