Skip to content

Commit f2637f6

Browse files
committed
[IMP] combine parse and import to process
1 parent 69df0cb commit f2637f6

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

spp_area_base/models/area_import.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def parse_excel_to_json(self):
177177

178178
# Create single job to parse Excel with pandas
179179
job = self.delayable(channel=_area_import_channel)._scan_and_create_parse_jobs()
180+
# After parsing, import the data
181+
job.on_done(self.delayable(channel=_area_import_channel).import_data())
180182
job.delay()
181183

182184
def _scan_and_create_parse_jobs(self):

spp_area_base/views/area.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<field name="priority">1</field>
66
<field name="arch" type="xml">
77
<tree>
8-
<field name="draft_name" />
8+
<field name="draft_name" string="Name" />
99
<field name="altnames" />
1010
<field name="code" />
1111
<field name="parent_id" />

spp_area_base/views/area_import_views.xml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,10 @@
1212
<button
1313
name="parse_excel_to_json"
1414
type="object"
15-
string="Parse"
15+
string="Process"
1616
class="btn-primary"
1717
invisible="state not in ('New', 'Uploaded')"
1818
/>
19-
<button
20-
name="import_data"
21-
type="object"
22-
string="Import"
23-
class="btn-primary"
24-
invisible="state not in ('New', 'Parsed')"
25-
/>
2619
<button
2720
name="save_to_area"
2821
type="object"
@@ -37,13 +30,6 @@
3730
class="btn-success"
3831
invisible="state != 'Imported'"
3932
/>
40-
<button
41-
name="reset_to_uploaded"
42-
type="object"
43-
string="Reset to Uploaded"
44-
class="btn-primary"
45-
invisible="state not in ('Imported', 'Validated')"
46-
/>
4733
<button
4834
name="cancel_import"
4935
type="object"

0 commit comments

Comments
 (0)