-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edi_oca: add edi.configuration.trigger
Ease configuration by filtering triggers by model. In the long run we'll have tons of triggers for specific scopes (sale, purchase, etc). This change will make sure the selection of the trigger won't be cluttered. It also adds the possibility to describe triggers as users prefer.
- Loading branch information
Showing
8 changed files
with
114 additions
and
38 deletions.
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
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,24 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# @author Simone Orsi <[email protected]> | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class EdiConfigurationTrigger(models.Model): | ||
_name = "edi.configuration.trigger" | ||
_description = """ | ||
Describe what triggers a specific action for a configuration. | ||
""" | ||
|
||
name = fields.Char(string="Name", required=True) | ||
code = fields.Char(required=True, copy=False) | ||
active = fields.Boolean(default=True) | ||
description = fields.Char(help="Describe what the conf is for") | ||
model_id = fields.Many2one( | ||
"ir.model", | ||
string="Model", | ||
help="Model the conf applies to. Leave blank to apply for all models", | ||
) | ||
|
||
_sql_constraints = [("code_uniq", "unique(code)", "Code must be unique")] |
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,44 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record id="edi_configuration_trigger_view_tree" model="ir.ui.view"> | ||
<field name="model">edi.configuration.trigger</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="name" /> | ||
<field name="description" /> | ||
<field name="code" /> | ||
<field name="model_id" /> | ||
<field name="active" /> | ||
</tree> | ||
</field> | ||
</record> | ||
<record id="edi_configuration_trigger_view_form" model="ir.ui.view"> | ||
<field name="model">edi.configuration.trigger</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<sheet> | ||
<field name="active" invisible="1" /> | ||
<widget | ||
name="web_ribbon" | ||
title="Archived" | ||
bg_color="bg-danger" | ||
attrs="{'invisible': [('active', '=', True)]}" | ||
/> | ||
<group> | ||
<group> | ||
<field name="name" /> | ||
<field name="code" /> | ||
<field name="description" /> | ||
</group> | ||
<group> | ||
<field | ||
name="model_id" | ||
options="{'no_create': True, 'no_create_edit': True}" | ||
/> | ||
</group> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
</odoo> |
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