-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmrp_extension.xml
284 lines (259 loc) · 14.7 KB
/
mrp_extension.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
279
280
281
282
283
284
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- View customization on MRP -->
<record id="plm_bom_component_tree_view" model="ir.ui.view">
<field name="name">plm.bom.component.tree</field>
<field name="model">mrp.bom.line</field>
<field name="inherit_id" ref="mrp.mrp_bom_component_tree_view"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="product_id" position="before">
<field name="itemnum"/>
</field>
<field name="product_id" position="after">
<field name="engineering_revision" readonly="True"/>
<field name="state" readonly="True"/>
<field name="description" select="True"/>
<field name="source_id" string="Source Relation Document"/>
<field name="type" />
</field>
<field name="product_qty" position="after">
<field name="weight_net" readonly="True"/>
<field name="create_date" select="True" readonly="True"/>
</field>
</field>
</record>
<record id="plm_bom_tree_view" model="ir.ui.view">
<field name="name">plm.mrp.bom.tree</field>
<field name="model">mrp.bom</field>
<field name="type">tree</field>
<field name="inherit_id" ref="mrp.mrp_bom_tree_view"/>
<field name="arch" type="xml">
<field name="product_id" position="after">
<field name="source_id" string="Source Relation Document"/>
<field name="type" />
<field name="weight_net"/>
<field name="engineering_revision"/>
<field name="description" select="True"/>
<field name="state" select="True"/>
</field>
</field>
</record>
<record id="plm_bom_form_view_eng" model="ir.ui.view">
<field name="name">plm.bom.form.eng</field>
<field name="model">mrp.bom</field>
<field name="arch" type="xml">
<form string="Bill of Material" edit="false">
<sheet>
<group>
<button name="open_related_bom_lines" type="object" string="Related BOM Lines" colspan="2"/>
<field name="product_tmpl_id" options="{'no_open':True,'no_create':True}"/>
<field name="product_id" groups="product.group_product_variant"/>
<field name="state" readonly="True"/>
<field name="product_qty" class="oe_inline"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" class="oe_inline" groups="product.group_uom"/>
<field name="routing_id" class="oe_inline" groups="mrp.group_mrp_routings"/>
<field name="code"/>
<field name="type" widget="radio"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
</group>
<notebook>
<page string="Components">
<field name="bom_line_ids" widget="one2many_list">
<tree string="Components" editable="bottom">
<button name="openRelatedBoms" type="object" string="Related BOM" attrs="{'invisible':[('related_bom_ids', '=', [])]}"/>
<field name="related_bom_ids" invisible="True"/>
<field name="related_document_ids" invisible="True"/>
<button name="openRelatedDocuments" type="object" string="Related DOCS" attrs="{'invisible':[('related_document_ids', '=', [])]}"/>
<field name="sequence" widget="handle"/>
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="product.group_uom"/>
<field name="attribute_value_ids" widget="many2many_tags" domain="[('product_ids.product_tmpl_id', '=', parent.product_tmpl_id)]" groups="product.group_product_variant"/>
<field name="engineering_revision" readonly="True"/>
<field name="state" readonly="True"/>
<field name="description" readonly="True"/>
<field name="source_id" string="Source Relation Document"/>
<field name="type" />
<field name="hasChildBoms" invisible="True"/>
</tree>
</field>
</page>
<page string="Properties" groups="base.group_no_one">
<group>
<group>
<field name="sequence"/>
<field name="active"/>
</group>
</group>
<separator string="Properties" groups="product.group_mrp_properties"/>
<group>
<group>
</group>
<group/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</form>
</field>
</record>
<record id="plm_bom_form_view_2" model="ir.ui.view">
<field name="name">plm.bom.form.2</field>
<field name="model">mrp.bom</field>
<field name="inherit_id" ref="plm.plm_bom_form_view_eng"/>
<field name="groups_id" eval="[(6, 0, [ref('group_plm_admin')])]"/>
<field name="arch" type="xml">
<xpath expr="//form" position="attributes">
<attribute name="edit">true</attribute>
</xpath>
</field>
</record>
<record id="plm_bom_form_view" model="ir.ui.view">
<field name="name">plm.bom.form</field>
<field name="model">mrp.bom</field>
<field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
<field name="type">form</field>
<field name="priority" eval="16"/>
<field name="arch" type="xml">
<data>
<field name="product_tmpl_id" position="replace">
<field name="product_tmpl_id" context="{'default_type': 'product'}" options="{'no_open':True,'no_create':True}"/>
</field>
<field name="product_tmpl_id" position="before">
<button name="open_related_bom_lines" type="object" string="Related BOM Lines" colspan="2"/>
</field>
<field name="product_id" position="after">
<field name="engineering_revision" readonly="True"/>
<field name="description" readonly="True"/>
<field name="state" readonly="True"/>
<field name="weight_net" readonly="True"/>
</field>
</data>
<data>
<xpath expr="//field[@name='bom_line_ids']/tree/field[@name='product_id']" position="before">
<field name="related_bom_ids" invisible="True"/>
<button name="openRelatedBoms" type="object" string="Related BOM" attrs="{'invisible':[('related_bom_ids', '=', [])]}"/>
<field name="related_document_ids" invisible="True"/>
<button name="openRelatedDocuments" type="object" string="Related DOCS" attrs="{'invisible':[('related_document_ids', '=', [])]}"/>
<field name="itemnum"/>
</xpath>
</data>
<data>
<xpath expr="//field[@name='bom_line_ids']/tree/field[@name='product_id']" position="after">
<field name="engineering_revision" readonly="True"/>
<field name="state" readonly="True"/>
<field name="description" readonly="True"/>
<field name="source_id" string="Source Relation Document"/>
<field name="type" />
</xpath>
</data>
<data>
<xpath expr="//field[@name='bom_line_ids']/tree/field[@name='product_qty']" position="after">
<field name="weight_net" readonly="True"/>
<field name="create_date" select="True" readonly="True"/>
<field name="hasChildBoms" invisible="True"/>
</xpath>
</data>
</field>
</record>
<!-- Opening views from menu -->
<record model="ir.actions.act_window" id="plm_action_normal_form">
<field name="name">Normal BoMs</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.bom</field>
<field name="view_type">form</field>
<field name="domain">[('type','=','normal')]</field>
<field name="filter" eval="True"/>
</record>
<!-- Overrides standard Search -->
<record id="view_mrp_bom_filter_inherit" model="ir.ui.view">
<field name="name">plm.bom.select</field>
<field name="model">mrp.bom</field>
<field name="inherit_id" ref="mrp.view_mrp_bom_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="code" position="before">
<filter name="filter_latest_2_weeks" string="Latest 2 Weeks" separator="1"
domain="[('create_date','<=', (datetime.date.today()).strftime('%%Y-%%m-%%d')),('create_date','>=',(datetime.date.today()-datetime.timedelta(weeks=2)).strftime('%%Y-%%m-%%d'))]"
help="Created latest 2 Weeks"/>
<filter name="filter_latest_7" string="Latest 7 Days" separator="1"
domain="[('create_date','<=', (datetime.date.today()).strftime('%%Y-%%m-%%d')),('create_date','>=',(datetime.date.today()-datetime.timedelta(weeks=1)).strftime('%%Y-%%m-%%d'))]"
help="Created latest 7 Days"/>
<filter name="filter_yesterday" string="Yesterday" separator="1"
domain="[('create_date','<=', (datetime.date.today()-datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d')),('create_date','>=',(datetime.date.today()-datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]"
help="Created yesterday"/>
<filter name="filter_today" string="Today" separator="1"
domain="[('create_date','<=', (datetime.date.today()).strftime('%%Y-%%m-%%d')),('create_date','>=',(datetime.date.today()).strftime('%%Y-%%m-%%d'))]"
help="Created today"/>
<separator orientation="vertical"/>
</field>
<xpath expr="//group" position="after">
string="Group By..."
<filter string="BoM Name" domain="[]" context="{'group_by':'code'}"/>
<filter string="Variant Name" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Source Relationship" domain="[]" context="{'group_by':'source_id'}"/>
</xpath>
</field>
</record>
<!-- Tree Structure Views on MRP -->
<record id="mrp_bom_tree_view_where" model="ir.ui.view">
<field name="name">mrp.bom.tree.where</field>
<field name="model">mrp.bom</field>
<field name="field_parent">father_complete_ids</field>
<field name="arch" type="xml">
<tree string="Where Used Bill of Materials">
<field name="product_id" string="Component Name"/>
<field name="code" string="BoM Name"/>
<field name="engineering_revision" string="Revision"/>
<field name="description"/>
<field name="source_id" string="Source Relation Document"/>
<field name="product_qty"/>
<field name="product_uom_id"/>
<field name="weight_net"/>
<field name="create_date" select="True"/>
<field name="type"/>
</tree>
</field>
</record>
<record id="plm_bom_tree_structure" model="ir.ui.view">
<field name="name">plm.bom.tree</field>
<field name="model">mrp.bom.line</field>
<field name="field_parent">child_line_ids</field>
<field name="arch" type="xml">
<tree string="Bill of Materials">
<field name="itemnum" string="Position"/>
<field name="product_id" string="Component Name"/>
<field name="engineering_revision" string="Revision"/>
<field name="description"/>
<field name="source_id" string="Source Relation Document"/>
<field name="product_qty"/>
<field name="product_uom_id"/>
<field name="weight_net"/>
<field name="create_date" select="True"/>
<field name="type"/>
</tree>
</field>
</record>
<!-- Tree Structure Actions on MRP -->
<record id="action2" model="ir.actions.act_window">
<field name="name">Bill of Materials Structure</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.bom.line</field>
<field name="domain">[('bom_id', 'in', active_ids)]</field>
<field name="view_type">tree</field>
<field name="view_id" ref="plm_bom_tree_structure"/>
</record>
<record id="ir_BOM_structure" model="ir.values">
<field eval="'client_action_multi'" name="key2"/>
<field eval="'mrp.bom'" name="model"/>
<field name="name">Bill of Materials Structure</field>
<field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
</record>
</data>
</openerp>