ai*
This commit is contained in:
2
ai_timesheet_grid/models/__init__.py
Normal file
2
ai_timesheet_grid/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import account_analytic_line
|
||||
from . import ai_composer
|
||||
13
ai_timesheet_grid/models/account_analytic_line.py
Normal file
13
ai_timesheet_grid/models/account_analytic_line.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class AccountAnalyticLine(models.Model):
|
||||
_inherit = 'account.analytic.line'
|
||||
|
||||
@api.model
|
||||
def get_assistant_data(self):
|
||||
ai_agent = self.env.ref('ai_timesheet_grid.ai_composer_timesheet_assistant', raise_if_not_found=False).ai_agent_id
|
||||
return {
|
||||
**super().get_assistant_data(),
|
||||
"is_agent_available": bool(ai_agent),
|
||||
}
|
||||
14
ai_timesheet_grid/models/ai_composer.py
Normal file
14
ai_timesheet_grid/models/ai_composer.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AIComposer(models.Model):
|
||||
_inherit = 'ai.composer'
|
||||
|
||||
interface_key = fields.Selection(
|
||||
selection_add=[
|
||||
("timesheet_assistant_ai", "Summarize timesheet suggestions"),
|
||||
],
|
||||
ondelete={
|
||||
"timesheet_assistant_ai": "cascade",
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user