Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions automation_script/industry_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ def clean(self):
if k == 'data':
f.write(" 'data/mail_message.xml',\n")
f.write(" 'data/knowledge_article_favorite.xml',\n")
f.write(" 'data/knowledge_tour.xml',\n")
f.write(" ],\n")
else:
f.write(f" '{k}': '{v}',\n")
Expand Down Expand Up @@ -639,6 +640,21 @@ def clean(self):
Path(destination_module_path + file).write_text(content.format(ind_name=self.ind_name, Ind_name=Ind_name), encoding='UTF-8')


knowledge_tour_path = Path(destination_module_path + '/data/knowledge_tour.xml')
knowledge_tour_path.parent.mkdir(parents=True, exist_ok=True)

knowledge_tour_content = f"""<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="knowledge_tour" model="web_tour.tour">
<field name="name">{self.ind_name}_knowledge_tour</field>
<field name="sequence">2</field>
<field name="rainbow_man_message">Welcome! Happy exploring.</field>
</record>
</odoo>
"""

knowledge_tour_path.write_text(knowledge_tour_content, encoding="utf-8")

Comment on lines +643 to +657
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please wrap this logic into a separate function to improve modularity, code readability, and maintainability. It will also make the flow easier for developers to understand.
suggest same changes for only_cleanup_script.py file

# make changes only for saas~18.3 version
# if self.db_version == 'saas~18.3':
# self.changes_depend_on_db_version(destination_module_path)
Expand Down
16 changes: 16 additions & 0 deletions automation_script/only_cleanup_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def clean(self):
if k == 'data':
f.write(" 'data/mail_message.xml',\n")
f.write(" 'data/knowledge_article_favorite.xml',\n")
f.write(" 'data/knowledge_tour.xml',\n")
f.write(" ],\n")
else:
f.write(f" '{k}': '{v}',\n")
Expand Down Expand Up @@ -308,6 +309,21 @@ def clean(self):
os.makedirs(destination_module_path + directory, exist_ok=True)
Path(destination_module_path + file).write_text(content.format(ind_name=self.ind_name, Ind_name=Ind_name), encoding='UTF-8')

knowledge_tour_path = Path(destination_module_path + '/data/knowledge_tour.xml')
knowledge_tour_path.parent.mkdir(parents=True, exist_ok=True)

knowledge_tour_content = f"""<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="knowledge_tour" model="web_tour.tour">
<field name="name">{self.ind_name}_knowledge_tour</field>
<field name="sequence">2</field>
<field name="rainbow_man_message">Welcome! Happy exploring.</field>
</record>
</odoo>
"""

knowledge_tour_path.write_text(knowledge_tour_content, encoding="utf-8")

print("clean up successful")


Expand Down