File tree Expand file tree Collapse file tree 6 files changed +52
-6
lines changed Expand file tree Collapse file tree 6 files changed +52
-6
lines changed Original file line number Diff line number Diff line change 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 ,
Original file line number Diff line number Diff line change 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 ,
Original file line number Diff line number Diff line change 1515class 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 ))
Original file line number Diff line number Diff line change 1515class 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 ))
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments