forked from mohamedmagdy/odoo-pycharm-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOdoo.xml
executable file
·278 lines (278 loc) · 26.4 KB
/
Odoo.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<templateSet group="Odoo">
<template name="odoo_form" value="<record id="" model="ir.ui.view"> <field name="name"></field> <field name="model"></field> <field name="arch" type="xml"> <form string=""> <sheet> <group> <field name="name"/> </group> </sheet> </form> </field> </record>" description="Create Form View" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_tree" value="<record id="" model="ir.ui.view"> <field name="name"></field> <field name="model"></field> <field name="arch" type="xml"> <tree string=""> <field name="name"/> </tree> </field> </record>" description="Create Tree View" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_data" value="<?xml version="1.0" encoding="utf-8"?> <odoo> <data> </data> </odoo>" description="Create the main tags" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_form_inherit" value="<!-- Inherit Form View to Modify it --> <record id="" model="ir.ui.view"> <field name="name"></field> <field name="model"></field> <field name="inherit_id" ref=""/> <field name="arch" type="xml"> <xpath expr="//field[@name='name']" position=""> <!-- Add your fields or attributes here --> </xpath> </field> </record>" description="Inherit Existing Form View" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_tree_inherit" value="<record id="" model="ir.ui.view"> <field name="name"></field> <field name="model"></field> <field name="inherit_id" ref=""/> <field name="arch" type="xml"> <xpath expr="//field[@name='name']" position=""> <!-- Add new fields here --> </xpath> </field> </record>" description="Inherit Existing Tree View" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_view_action" value="<record id="" model="ir.actions.act_window"> <field name="name"></field> <field name="type">ir.actions.act_window</field> <field name="res_model"></field> <field name="view_mode">tree,form</field> <field name="help" type="html"> <p class="oe_view_nocontent_create"> <!-- Add Text Here --> </p><p> <!-- More details about what a user can do with this object will be OK --> </p> </field> </record>" description="Create new Action" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_menuitem_root" value="<!-- This Menu Item will appear in the Upper bar, That's why It needs NO parent or action --> <menuitem id="MODULE_NAME_root" name="" sequence=""/>" description="Create New Menu Item in the Upper bar" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_menuitem_categ" value="<!-- This Menu Item Must have a parent --> <menuitem id="UNIQUE_ID_categ" name="" parent="" sequence=""/>" description="Create New Menu Item for Categroization" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_menuitem_action" value="<!-- This Menu Item must have a parent and an action --> <menuitem id="UNIQUE_ID_categ" name="" parent="" action="" sequence=""/>" description="Create New Menu Item for Actions" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_nested_group" value="<group string=""> <group> <field name=""/> </group> <group> <field name=""/> </group> </group>" description="Create Nested Groups" toReformat="false" toShortenFQNames="true" />
<template name="odoo_domain" value="domain="[('', '=', ), ]"" description="Add domain to your field" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_object" value="class NewModule(models.Model): _name = 'new_module.new_module' _rec_name = 'name' _description = 'New Description' name = fields.Char() " description="Create New Odoo Object" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_integer" value="new_field = fields.Integer(string="", required=False, )" description="Add new field of type Integer" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_char" value="new_field = fields.Char(string="", required=False, )" description="Add new field of type Char" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_text" value="new_field = fields.Text(string="", required=False, )" description="Add new field of type Text" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_many2one" value="new_field_id = fields.Many2one(comodel_name="", string="", required=False, )" description="Add new field of type Many2one" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_one2many" value="new_field_ids = fields.One2many(comodel_name="", inverse_name="", string="", required=False, )" description="Add new field of type One2many" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_boolean" value="is_new_field = fields.Boolean(string="", )" description="Add new field of type Boolean" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_html" value="new_field = fields.HTML(string="", )" description="Add new field of type HTML" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_float" value="new_field = fields.Float(string="", required=False, )" description="Add new field of type Float" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_date" value="new_field = fields.Date(string="", required=False, )" description="Add new field of type Date" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_datetime" value="new_field = fields.Datetime(string="", required=False, )" description="Add new field of type DateTime" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_selection" value="state = fields.Selection(string="", selection=[('', ''), ('', ''), ], required=False, )" description="Add new field of type Selection" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_field_many2many" value="new_field_ids = fields.Many2many(comodel_name="", relation="", column1="", column2="", string="", )" description="Add new field of type Many2many" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_object_inherit" value="class NewModule(models.Model): _name = 'new_module.new_module' _inherit = 'new_module.new_module' name = fields.Char() " description="Inherit/Extend Existing Odoo Object" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_security_category" value="<record id="" model="ir.module.category"> <field name="name"></field> <field name="sequence" eval="1"/> </record>" description="Add new Security Category" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_security_group" value="<record id="" model="res.groups"> <field name="name"></field> <field name="category_id" ref=""/> <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> </record>" description="Create new Group, then assign new permissions" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_security_rule" value="<record id="" model="ir.rule"> <field name="name"></field> <field ref="model_name_of_model" name="model_id"/> <field name="domain_force">[('', '', )]</field> <field name="perm_write" eval="1"/> <field name="perm_create" eval="1"/> <field name="perm_read" eval="1"/> <field name="perm_unlink" eval="1"/> <!-- You can attach this rule to a specific group, Or make it Global --> <field name="groups" eval="[(4, ref('group_id'))]"/> <!--<field name="global" eval="1"/> --> </record>" description="Create new Security Rules" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_notebook" value="<notebook> <page string=""> <group> <field name=""/> </group> </page> </notebook>" description="Add Notebook and a page" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_page" value="<page string=""> <group> <field name=""/> </group> </page>" description="Add new page" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_field_binary" value="new_field = fields.Binary(string="", )" description="Add new field of type Binary" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_wkf" value="<record id="" model="workflow"> <field name="name"></field> <field name="osv"></field> <field name="on_create">True</field> </record>" description="Add Workflow" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_wkf_transition" value="<record id="" model="workflow.transition"> <field name="act_from" ref=""/> <field name="act_to" ref=""/> <field name="signal"></field> </record>" description="Add new Transition to an existing Workflow" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_wkf_activity" value="<record id="" model="workflow.activity"> <field name="wkf_id" ref=""/> <!--<field name="flow_start">True</field>--> <!--<field name="flow_stop">True</field>--> <field name="name"></field> <field name="kind">function</field> <field name="action">METHOD_NAME()</field> </record>" description="Add new Activity" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_form_header" value="<header> <button name="" string="" class="oe_highlight" states="" type=""/> <field name="state" widget="statusbar" statusbar_visible="" statusbar_colors="{'KEY_IS_STATE':'VALUE_IS_COLOR'}"/> </header>" description="Add Form's header with 'state' and buttons" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_form_social" value="<div class="oe_chatter"> <field name="message_follower_ids" widget="mail_followers"/> <field name="message_ids" widget="mail_thread"/> </div>" description="Add Social Messaging and followers." toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_form_title" value="<div class="oe_title"> <label for="name" class="oe_edit_only"/> <h1> <field name="name" placeholder="......"/> </h1> </div>" description="Add title for the form view" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_method_onchange" value="@api.onchange('FIELD_NAME') def _onchange_FIELD_NAME(self): pass" description="Add an onchange method" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_method_compute_field" value="@api.one @api.depends('FIELDS_NAMES') def _compute_amount(self): """ @api.depends() should contain all fields that will be used in the calculations. """ pass" description="Add a method to compute the computed fields" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_declare_qweb_reports" value="<!-- QWeb Reports --> <!-- NAME & FILE_NAME should be the same --> <report id="UNIQUE_REPORT_ID" model="MODEL_WHERE_THE_REPORT_WILL_BE_PRINTED" report_type="qweb-pdf" string="LABEL" name="NAME" file="FILE_NAME" />" description="Add a declaration for new QWeb reports" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML_TEXT" value="true" />
</context>
</template>
<template name="odoo_add_qweb_template" value="<template id="UNIQUE_ID"> <t t-call="report.html_container"> <t t-call="report.internal_layout"> <!-- <t t-call="report.external_layout"> --> <div class="page"> <h2>TITLE FOR YOUR REPORT</h2> <!-- Build your report here! Do it in awesome way ;) --> </div> </t> </t> </template> " description="Add the main structure of the QWeb Reports" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_qweb_table" value="<table class="table table-condensed"> <thead> <tr> <th>HEAD_1</th> <th class="text-right">HEAD_2</th> <th class="text-right">HEAD_3</th> <th class="text-right">HEAD_4</th> </tr> </thead> <tbody> <tr t-foreach="o.OBJECTS" t-as="OBJECT"> <t t-if="len(taxline['level']) > 5"> <t t-set="style" t-value="'font-weight:normal;'"/> </t> <t t-if="not len(taxline['level']) > 5"> <t t-set="style" t-value="'font-weight:bold;'"/> </t> <td> <span t-att-style="style" t-esc="taxline['level']" style="color:white;"/> <span t-att-style="style" t-if="taxline['code']" t-esc="taxline['code']"/> <span t-att-style="style" t-esc="taxline['name']"/> </td> <td class="text-right"><span t-att-style="style" t-esc="taxline['debit']"/></td> <td class="text-right"><span t-att-style="style" t-esc="taxline['credit']"/></td> <td class="text-right"> <span t-att-style="style" t-esc="formatLang(taxline['tax_amount'], currency_obj=res_company.currency_id)"/> </td> </tr> </tbody> </table> " description="Add the main structure of the QWeb Tables" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML_TEXT" value="true" />
</context>
</template>
<template name="odoo_search" value="<record id="" model="ir.ui.view"> <field name="name"></field> <field name="model"></field> <field name="arch" type="xml"> <search string=""> <field name="name" string="string" domain="[()]"/> </search> </field> </record>" description="Create Search View" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_kanban" value="<record id="" model="ir.ui.view"> <field name="name"></field> <field name="model"></field> <field name="arch" type="xml"> <kanban> <field name="name"/> <templates> <t t-name="kanban-box"> </t> </templates> </kanban> </field> </record>" description="Create Kanban View" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_manifest" value="{ 'name': '', 'version': '', 'summary': '', 'description': '', 'category': '', 'author': '', 'website': '', 'license': '', 'depends': [''], 'data': [''], 'demo': [''], 'installable': True, 'auto_install': False, 'external_dependencies': { 'python': [''], } }" description="Create Odoo project manifest" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="openerp_import" value="from openerp import models, fields, api, " description="Add basic Odoo import for old Odoo versions" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_import" value="from odoo import api, fields, models " description="Add basic Odoo import for new Odoo versions" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_xpath" value="<xpath expr="//field[@name='name']" position=""> <!-- Add your fields or attributes here --> </xpath>" description="Add the structure of xpath" toReformat="true" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_onchange" value="@api.onchange('field_name') def onchange_method(self): self.field_name = ''" description="Add onchange method" toReformat="true" toShortenFQNames="true">
<context>
<option name="Python_Class" value="true" />
</context>
</template>
<template name="odoo_xpath_attributes" value="<xpath expr="//field[@name='']" position="attributes"> <attribute name="required">1</attribute> <attribute name="readonly">1</attribute> </xpath>" description="Add the structure of xpath with attributes" toReformat="true" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_method_create" value="@api.model def create(self, values): # Add code here return super(ClassName, self).create(values)" description="Add a method create" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_method_write" value="@api.multi def write(self, values): # Add code here return super(ClassName, self).write(values)" description="Add a method write" toReformat="false" toShortenFQNames="true">
<context>
<option name="Python" value="true" />
</context>
</template>
<template name="odoo_button" value="<button name="button_method_name" type="object" string="ObjectButton"/>" description="Add Odoo button" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_field" value="<field name="name"/>" description="Add commun field on view" toReformat="true" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_field_state" value="<field name="state" widget="statusbar" statusbar_visible=""/>" description="Add state field with progressbar on view" toReformat="true" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
<template name="odoo_button_box" value="<div class="oe_button_box" name="expense_button_box"> <button name="toggle_active" type="object" confirm="(Un)archiving a project automatically (un)archives its tasks and issues. Do you want to proceed?" class="oe_stat_button" icon="fa-archive"> <field name="active" widget="boolean_button" options='{"terminology": "archive"}'/> </button> </div>" description="Add Button Box on View" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
</context>
</template>
</templateSet>