-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
from . import mail_thread | ||
from . import link_tracker | ||
from . import automation_filter | ||
from . import automation_tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2024 Dixmit | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from random import randint | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class AutomationTag(models.Model): | ||
|
||
_name = "automation.tag" | ||
_description = "Automation Tag" | ||
|
||
@api.model | ||
def _get_default_color(self): | ||
return randint(1, 11) | ||
|
||
name = fields.Char(required=True) | ||
color = fields.Integer(default=lambda r: r._get_default_color()) | ||
active = fields.Boolean(default=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2024 Dixmit | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
|
||
<record model="ir.ui.view" id="automation_tag_search_view"> | ||
<field name="model">automation.tag</field> | ||
<field name="arch" type="xml"> | ||
<search> | ||
<field name="name" /> | ||
</search> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.view" id="automation_tag_tree_view"> | ||
<field name="model">automation.tag</field> | ||
<field name="arch" type="xml"> | ||
<tree editable="bottom"> | ||
<field name="name" /> | ||
<field name="color" /> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.actions.act_window" id="automation_tag_act_window"> | ||
<field name="name">Tags</field> <!-- TODO --> | ||
<field name="res_model">automation.tag</field> | ||
<field name="view_mode">tree,form</field> | ||
<field name="domain">[]</field> | ||
<field name="context">{}</field> | ||
</record> | ||
|
||
<record model="ir.ui.menu" id="automation_tag_menu"> | ||
<field name="name">Tags</field> | ||
<field name="parent_id" ref="automation_config_root_menu" /> | ||
<field name="action" ref="automation_tag_act_window" /> | ||
<field name="sequence" eval="40" /> | ||
</record> | ||
|
||
</odoo> |