ai*
This commit is contained in:
75
ai_documents/wizard/ai_documents_sort.xml
Normal file
75
ai_documents/wizard/ai_documents_sort.xml
Normal file
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="ai_documents_sort_view_form" model="ir.ui.view">
|
||||
<field name="name">ai_documents.sort.view.form</field>
|
||||
<field name="model">ai_documents.sort</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="AI Sort">
|
||||
<sheet>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-close float-end"
|
||||
aria-label="Close"
|
||||
special="cancel"
|
||||
close="1"
|
||||
string=""
|
||||
/>
|
||||
<div class="d-flex flex-column o_ai_documents_sort pb-4">
|
||||
<strong>
|
||||
What do you want the AI to do?
|
||||
</strong>
|
||||
<field name="folder_id" invisible="1" force_save="1" context="{'default_type': 'folder'}"/> <!-- Force saving -->
|
||||
<field name="model" invisible="1"/> <!-- Used by the `ai_prompt` widget -->
|
||||
<field name="relation" invisible="1"/> <!-- Used by the `ai_prompt` widget -->
|
||||
<field
|
||||
name="ai_sort_prompt"
|
||||
widget="ai_sort_documents_prompt"
|
||||
nolabel="1"
|
||||
placeholder="eg:
|
||||
If the documents is an invoice, move it to Finance,
|
||||
if it's an image, move it to Photos,
|
||||
otherwise, create an activity 'Document to sort' for Admin
|
||||
"
|
||||
options="{
|
||||
'model_reference_field': 'model',
|
||||
'record_selector_relation_field': 'relation',
|
||||
'record_selector_domain': '[(\'type\', \'=\', \'folder\')]',
|
||||
'show_missing_records_warning': 'true'
|
||||
}"/>
|
||||
<strong class="mt-3">What actions can the AI take?</strong>
|
||||
<field name="ai_tool_ids"
|
||||
widget="many2many_tags"
|
||||
options="{'no_quick_create': True, 'on_tag_click': 'open_form'}"
|
||||
context="{'default_model_id': context.get('default_model_id'), 'default_use_in_ai': True}"
|
||||
nolabel="1"/>
|
||||
</div>
|
||||
</sheet>
|
||||
<footer>
|
||||
<button class="btn btn-primary" type="object" name="action_setup_folder" close="1">Save</button>
|
||||
<button class="btn btn-secondary" special="cancel" close="1"/>
|
||||
<button
|
||||
class="btn btn-secondary float-end ms-auto"
|
||||
icon="delete"
|
||||
icon_class="oi-filled"
|
||||
type="object"
|
||||
name="action_delete"
|
||||
close="1"
|
||||
invisible="not is_ai_sort_prompt_set">Delete</button>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_documents_sort_action" model="ir.actions.act_window">
|
||||
<field name="name">AI Sort</field>
|
||||
<field name="res_model">ai_documents.sort</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="ai_documents_sort_view_form"/>
|
||||
<field name="target">new</field>
|
||||
<field name="context" eval="{
|
||||
'header': False,
|
||||
'default_model_id': ref('documents.model_documents_document'),
|
||||
}"/>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user