RemiFr82
7 months ago
8 changed files with 217 additions and 54 deletions
-
9ffck_commons/__manifest__.py
-
20ffck_commons/data/ffck_structure_type.xml
-
2ffck_commons/data/res_partner.xml
-
6ffck_commons/i18n/fr.po
-
12ffck_commons/models/ffck_structure_type.py
-
129ffck_commons/models/res_partner.py
-
52ffck_commons/views/ffck_structure_type.xml
-
41ffck_commons/views/res_partner.xml
@ -1,13 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from odoo import models, fields |
|||
from .res_partner import SCALES |
|||
|
|||
SCALES = [ |
|||
("1", "National"), |
|||
("2", "Regional"), |
|||
("3", "Departmental"), |
|||
("4", "Local"), |
|||
("5", "Licensee"), |
|||
] |
|||
|
|||
|
|||
class FfckStructureType(models.Model): |
|||
_name = "ffck.structure.type" |
|||
_description = "FFCK structure type" |
|||
_order = "scale, short, name, id" |
|||
|
|||
name = fields.Char("Name", required=True) |
|||
name = fields.Char("Name", required=True, translate=True) |
|||
short = fields.Char("Short", required=True, index=True) |
|||
scale = fields.Selection(SCALES, string="Scale", required=True) |
|||
active = fields.Boolean(string="Active", default=True) |
|||
|
@ -0,0 +1,52 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
|
|||
<record id="ffck_structure_type_view_form" model="ir.ui.view"> |
|||
<field name="name">ffck.structure.type.view.form</field> |
|||
<field name="model">ffck.structure.type</field> |
|||
<field name="arch" type="xml"> |
|||
<form> |
|||
<sheet> |
|||
<div class="oe_title"> |
|||
<field name="name" /> |
|||
</div> |
|||
<group col="4"> |
|||
<field name="short" /> |
|||
<field name="scale" /> |
|||
<field name="parent_id" colspan="4" options="{'no_create':1}" /> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="ffck_structure_type_view_tree" model="ir.ui.view"> |
|||
<field name="name">ffck.structure.type.view.tree</field> |
|||
<field name="model">ffck.structure.type</field> |
|||
<field name="arch" type="xml"> |
|||
<tree> |
|||
<field name="name" /> |
|||
<field name="short" /> |
|||
<field name="scale" /> |
|||
<field name="parent_id" colspan="4" options="{'no_create':1}" /> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="ffck_structure_type_action" model="ir.actions.act_window"> |
|||
<field name="name">FFCK structure types</field> |
|||
<field name="res_model">ffck.structure.type</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="domain">[]</field> |
|||
<field name="context">{}</field> |
|||
</record> |
|||
|
|||
<menuitem |
|||
id="ffck_structure_type_menu" |
|||
name="Structure types" |
|||
action="ffck_structure_type_action" |
|||
groups="base.group_system" |
|||
parent="ffck_contacts_config_menu" |
|||
sequence="4" /> |
|||
|
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue