Skip to content

Commit c55e8cb

Browse files
committed
Merge branch '18.0' of github.com:vertelab/odoo-project_scrum into 18.0
2 parents beb304f + ef136a3 commit c55e8cb

File tree

6 files changed

+52
-6
lines changed

6 files changed

+52
-6
lines changed

project_scrum_ai/__manifest__.p.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
'web_mermaid',
4242
],
4343
'data': [
44-
'data/ai_agent_data.xml'
44+
'data/ai_agent_data.xml',
45+
'views/scrum_us_views.xml',
4546
],
4647
'installable': True,
4748
'auto_install': False,

project_scrum_ai/__manifest__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
'web_mermaid',
4242
],
4343
'data': [
44-
'data/ai_agent_data.xml'
44+
'data/ai_agent_data.xml',
45+
'views/scrum_us_views.xml',
4546
],
4647
'installable': True,
4748
'auto_install': False,

project_scrum_ai/models/mermaid.p.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@
1515
class MermaidMixin(models.AbstractModel):
1616
_inherit = 'mermaid.mixin'
1717

18-
def _process_mermaid_prompt(self):
18+
# The code below should probably be more generalized and moved to the mermaid module.
19+
20+
def process_mermaid_prompt(self):
1921
try:
2022
quest_id = self.env.ref('project_scrum_ai.mermaid_ai_quest')
2123

2224
if quest_id and quest_id.status != "active":
2325
raise f"{quest_id.name} is not active. Activate the quest or contact support."
2426

25-
result = quest_id.run(prompt=self._mermaid_prompt(), record=self)
27+
result = quest_id.run(prompt=self.prompt, records=self)
2628

2729
if result:
2830
ai_messages = quest_id._get_last_ai_message(result.get('result', {}).get('messages', False))

project_scrum_ai/models/mermaid.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@
1515
class MermaidMixin(models.AbstractModel):
1616
_inherit = 'mermaid.mixin'
1717

18-
def _process_mermaid_prompt(self):
18+
# The code below should probably be more generalized and moved to the mermaid module.
19+
20+
def process_mermaid_prompt(self):
1921
try:
2022
quest_id = self.env.ref('project_scrum_ai.mermaid_ai_quest')
2123

2224
if quest_id and quest_id.status != "active":
2325
raise f"{quest_id.name} is not active. Activate the quest or contact support."
2426

25-
result = quest_id.run(prompt=self._mermaid_prompt(), record=self)
27+
result = quest_id.run(prompt=self.prompt, records=self)
2628

2729
if result:
2830
ai_messages = quest_id._get_last_ai_message(result.get('result', {}).get('messages', False))
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<odoo>
2+
<data>
3+
4+
<record id="view_ps_us_ai_form" model="ir.ui.view">
5+
<field name="name">project.scrum.us.ai.form</field>
6+
<field name="model">project.scrum.us</field>
7+
<field name="inherit_id" ref="project_scrum.view_ps_us_form"/>
8+
<field name="arch" type="xml">
9+
<field name="mermaid_editor" position="before">
10+
<group>
11+
<field name="diagram_type" string="Digram type"/>
12+
</group>
13+
<field name="prompt" placeholder="Enter prompt to generate mermaid"/>
14+
<button name="process_mermaid_prompt" class="oe_highlight" string="Generate Mermaid" action="object"/>
15+
</field>
16+
</field>
17+
</record>
18+
19+
</data>
20+
</odoo>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<odoo>
2+
<data>
3+
4+
<record id="view_ps_us_ai_form" model="ir.ui.view">
5+
<field name="name">project.scrum.us.ai.form</field>
6+
<field name="model">project.scrum.us</field>
7+
<field name="inherit_id" ref="project_scrum.view_ps_us_form"/>
8+
<field name="arch" type="xml">
9+
<field name="mermaid_editor" position="before">
10+
<group>
11+
<field name="diagram_type" string="Digram type"/>
12+
</group>
13+
<field name="prompt" placeholder="Enter prompt to generate mermaid"/>
14+
<button name="process_mermaid_prompt" class="oe_highlight" string="Generate Mermaid" action="object"/>
15+
</field>
16+
</field>
17+
</record>
18+
19+
</data>
20+
</odoo>

0 commit comments

Comments
 (0)