Skip to content

Commit e5dbb17

Browse files
committed
[IMP] construction: add product cost and planning roles
- Set product cost as a fraction of the sale price. - Added 1 material resource per existing role. - Added new "Worker" role and assign. - Added new "Work Manager" role and assign. Task ID: 4236888 closes #1133 Signed-off-by: Vallaeys Valentin (vava) <[email protected]>
1 parent 30d8aff commit e5dbb17

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

construction/data/planning_role.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@
99
<record id="planning_role_3" model="planning.role">
1010
<field name="name">Aerial Work Platform</field>
1111
</record>
12+
<record id="planning_role_4" model="planning.role">
13+
<field name="name">Worker</field>
14+
</record>
15+
<record id="planning_role_5" model="planning.role">
16+
<field name="name">Work Manager</field>
17+
</record>
1218
</odoo>

construction/data/product_product.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,155 +51,206 @@
5151

5252
<record id="product_product_54" model="product.product">
5353
<field name="product_tmpl_id" ref="product_template_54"/>
54+
<field name="standard_price" model="product.template" eval="0.52 * obj().env.ref('construction.product_template_54').list_price"/>
5455
</record>
5556
<record id="product_product_14" model="product.product">
5657
<field name="product_tmpl_id" ref="product_template_14"/>
58+
<field name="standard_price" model="product.template" eval="0.67 * obj().env.ref('construction.product_template_14').list_price"/>
5759
</record>
5860
<record id="product_product_34" model="product.product">
5961
<field name="product_tmpl_id" ref="product_template_34"/>
62+
<field name="standard_price" model="product.template" eval="0.62 * obj().env.ref('construction.product_template_34').list_price"/>
6063
</record>
6164
<record id="product_product_16" model="product.product">
6265
<field name="product_tmpl_id" ref="product_template_16"/>
66+
<field name="standard_price" model="product.template" eval="0.60 * obj().env.ref('construction.product_template_16').list_price"/>
6367
</record>
6468
<record id="product_product_19" model="product.product">
6569
<field name="product_tmpl_id" ref="product_template_19"/>
70+
<field name="standard_price" model="product.template" eval="0.52 * obj().env.ref('construction.product_template_19').list_price"/>
6671
</record>
6772
<record id="product_product_12" model="product.product">
6873
<field name="product_tmpl_id" ref="product_template_12"/>
74+
<field name="standard_price" model="product.template" eval="0.48 * obj().env.ref('construction.product_template_12').list_price"/>
6975
</record>
7076
<record id="product_product_32" model="product.product">
7177
<field name="product_tmpl_id" ref="product_template_32"/>
78+
<field name="standard_price" model="product.template" eval="0.44 * obj().env.ref('construction.product_template_32').list_price"/>
7279
</record>
7380
<record id="product_product_11" model="product.product">
7481
<field name="product_tmpl_id" ref="product_template_11"/>
82+
<field name="standard_price" model="product.template" eval="0.50 * obj().env.ref('construction.product_template_11').list_price"/>
7583
</record>
7684
<record id="product_product_28" model="product.product">
7785
<field name="product_tmpl_id" ref="product_template_28"/>
86+
<field name="standard_price" model="product.template" eval="0.49 * obj().env.ref('construction.product_template_28').list_price"/>
7887
</record>
7988
<record id="product_product_20" model="product.product">
8089
<field name="product_tmpl_id" ref="product_template_20"/>
90+
<field name="standard_price" model="product.template" eval="0.69 * obj().env.ref('construction.product_template_20').list_price"/>
8191
</record>
8292
<record id="product_product_55" model="product.product">
8393
<field name="product_tmpl_id" ref="product_template_55"/>
94+
<field name="standard_price" model="product.template" eval="0.53 * obj().env.ref('construction.product_template_55').list_price"/>
8495
</record>
8596
<record id="product_product_10" model="product.product">
8697
<field name="product_tmpl_id" ref="product_template_10"/>
98+
<field name="standard_price" model="product.template" eval="0.51 * obj().env.ref('construction.product_template_10').list_price"/>
8799
</record>
88100
<record id="product_product_9" model="product.product">
89101
<field name="product_tmpl_id" ref="product_template_9"/>
102+
<field name="standard_price" model="product.template" eval="0.45 * obj().env.ref('construction.product_template_9').list_price"/>
90103
</record>
91104
<record id="product_product_35" model="product.product">
92105
<field name="product_tmpl_id" ref="product_template_35"/>
106+
<field name="standard_price" model="product.template" eval="0.69 * obj().env.ref('construction.product_template_35').list_price"/>
93107
</record>
94108
<record id="product_product_25" model="product.product">
95109
<field name="product_tmpl_id" ref="product_template_25"/>
110+
<field name="standard_price" model="product.template" eval="0.57 * obj().env.ref('construction.product_template_25').list_price"/>
96111
</record>
97112
<record id="product_product_37" model="product.product">
98113
<field name="product_tmpl_id" ref="product_template_37"/>
114+
<field name="standard_price" model="product.template" eval="0.75 * obj().env.ref('construction.product_template_37').list_price"/>
99115
</record>
100116
<record id="product_product_52" model="product.product">
101117
<field name="product_tmpl_id" ref="product_template_52"/>
118+
<field name="standard_price" model="product.template" eval="0.56 * obj().env.ref('construction.product_template_52').list_price"/>
102119
</record>
103120
<record id="product_product_33" model="product.product">
104121
<field name="product_tmpl_id" ref="product_template_33"/>
122+
<field name="standard_price" model="product.template" eval="0.55 * obj().env.ref('construction.product_template_33').list_price"/>
105123
</record>
106124
<record id="product_product_36" model="product.product">
107125
<field name="product_tmpl_id" ref="product_template_36"/>
126+
<field name="standard_price" model="product.template" eval="0.67 * obj().env.ref('construction.product_template_36').list_price"/>
108127
</record>
109128
<record id="product_product_46" model="product.product">
110129
<field name="product_tmpl_id" ref="product_template_46"/>
130+
<field name="standard_price" model="product.template" eval="0.58 * obj().env.ref('construction.product_template_46').list_price"/>
111131
</record>
112132
<record id="product_product_41" model="product.product">
113133
<field name="product_tmpl_id" ref="product_template_41"/>
134+
<field name="standard_price" model="product.template" eval="0.70 * obj().env.ref('construction.product_template_41').list_price"/>
114135
</record>
115136
<record id="product_product_56" model="product.product">
116137
<field name="product_tmpl_id" ref="product_template_56"/>
138+
<field name="standard_price" model="product.template" eval="0.60 * obj().env.ref('construction.product_template_56').list_price"/>
117139
</record>
118140
<record id="product_product_30" model="product.product">
119141
<field name="product_tmpl_id" ref="product_template_30"/>
142+
<field name="standard_price" model="product.template" eval="0.51 * obj().env.ref('construction.product_template_30').list_price"/>
120143
</record>
121144
<record id="product_product_43" model="product.product">
122145
<field name="product_tmpl_id" ref="product_template_43"/>
146+
<field name="standard_price" model="product.template" eval="0.70 * obj().env.ref('construction.product_template_43').list_price"/>
123147
</record>
124148
<record id="product_product_29" model="product.product">
125149
<field name="product_tmpl_id" ref="product_template_29"/>
150+
<field name="standard_price" model="product.template" eval="0.54 * obj().env.ref('construction.product_template_29').list_price"/>
126151
</record>
127152
<record id="product_product_23" model="product.product">
128153
<field name="product_tmpl_id" ref="product_template_23"/>
154+
<field name="standard_price" model="product.template" eval="0.56 * obj().env.ref('construction.product_template_23').list_price"/>
129155
</record>
130156
<record id="product_product_22" model="product.product">
131157
<field name="product_tmpl_id" ref="product_template_22"/>
158+
<field name="standard_price" model="product.template" eval="0.60 * obj().env.ref('construction.product_template_22').list_price"/>
132159
</record>
133160
<record id="product_product_53" model="product.product">
134161
<field name="product_tmpl_id" ref="product_template_53"/>
162+
<field name="standard_price" model="product.template" eval="0.65 * obj().env.ref('construction.product_template_53').list_price"/>
135163
</record>
136164
<record id="product_product_57" model="product.product">
137165
<field name="product_tmpl_id" ref="product_template_57"/>
166+
<field name="standard_price" model="product.template" eval="0.45 * obj().env.ref('construction.product_template_57').list_price"/>
138167
</record>
139168
<record id="product_product_58" model="product.product">
140169
<field name="product_tmpl_id" ref="product_template_58"/>
170+
<field name="standard_price" model="product.template" eval="0.40 * obj().env.ref('construction.product_template_58').list_price"/>
141171
</record>
142172
<record id="product_product_15" model="product.product">
143173
<field name="product_tmpl_id" ref="product_template_15"/>
174+
<field name="standard_price" model="product.template" eval="0.47 * obj().env.ref('construction.product_template_15').list_price"/>
144175
</record>
145176
<record id="product_product_17" model="product.product">
146177
<field name="product_tmpl_id" ref="product_template_17"/>
178+
<field name="standard_price" model="product.template" eval="0.55 * obj().env.ref('construction.product_template_17').list_price"/>
147179
</record>
148180
<record id="product_product_42" model="product.product">
149181
<field name="product_tmpl_id" ref="product_template_42"/>
182+
<field name="standard_price" model="product.template" eval="0.60 * obj().env.ref('construction.product_template_42').list_price"/>
150183
</record>
151184
<record id="product_product_49" model="product.product">
152185
<field name="product_tmpl_id" ref="product_template_49"/>
186+
<field name="standard_price" model="product.template" eval="0.45 * obj().env.ref('construction.product_template_49').list_price"/>
153187
</record>
154188
<record id="product_product_48" model="product.product">
155189
<field name="product_tmpl_id" ref="product_template_48"/>
190+
<field name="standard_price" model="product.template" eval="0.40 * obj().env.ref('construction.product_template_48').list_price"/>
156191
</record>
157192
<record id="product_product_26" model="product.product">
158193
<field name="product_tmpl_id" ref="product_template_26"/>
194+
<field name="standard_price" model="product.template" eval="0.35 * obj().env.ref('construction.product_template_26').list_price"/>
159195
</record>
160196
<record id="product_product_45" model="product.product">
161197
<field name="product_tmpl_id" ref="product_template_45"/>
198+
<field name="standard_price" model="product.template" eval="0.50 * obj().env.ref('construction.product_template_45').list_price"/>
162199
</record>
163200
<record id="product_product_13" model="product.product">
164201
<field name="product_tmpl_id" ref="product_template_13"/>
202+
<field name="standard_price" model="product.template" eval="0.55 * obj().env.ref('construction.product_template_13').list_price"/>
165203
</record>
166204
<record id="product_product_40" model="product.product">
167205
<field name="product_tmpl_id" ref="product_template_40"/>
206+
<field name="standard_price" model="product.template" eval="0.60 * obj().env.ref('construction.product_template_40').list_price"/>
168207
</record>
169208
<record id="product_product_24" model="product.product">
170209
<field name="product_tmpl_id" ref="product_template_24"/>
210+
<field name="standard_price" model="product.template" eval="0.63 * obj().env.ref('construction.product_template_24').list_price"/>
171211
</record>
172212
<record id="product_product_51" model="product.product">
173213
<field name="product_tmpl_id" ref="product_template_51"/>
214+
<field name="standard_price" model="product.template" eval="0.67 * obj().env.ref('construction.product_template_51').list_price"/>
174215
</record>
175216
<record id="product_product_31" model="product.product">
176217
<field name="product_tmpl_id" ref="product_template_31"/>
218+
<field name="standard_price" model="product.template" eval="0.53 * obj().env.ref('construction.product_template_31').list_price"/>
177219
</record>
178220
<record id="product_product_18" model="product.product">
179221
<field name="product_tmpl_id" ref="product_template_18"/>
222+
<field name="standard_price" model="product.template" eval="0.58 * obj().env.ref('construction.product_template_18').list_price"/>
180223
</record>
181224
<record id="product_product_44" model="product.product">
182225
<field name="product_tmpl_id" ref="product_template_44"/>
226+
<field name="standard_price" model="product.template" eval="0.60 * obj().env.ref('construction.product_template_44').list_price"/>
183227
</record>
184228
<record id="product_product_47" model="product.product">
185229
<field name="product_tmpl_id" ref="product_template_47"/>
230+
<field name="standard_price" model="product.template" eval="0.65 * obj().env.ref('construction.product_template_47').list_price"/>
186231
</record>
187232
<record id="product_product_21" model="product.product">
188233
<field name="product_tmpl_id" ref="product_template_21"/>
234+
<field name="standard_price" model="product.template" eval="0.75 * obj().env.ref('construction.product_template_21').list_price"/>
189235
</record>
190236
<record id="product_product_27" model="product.product">
191237
<field name="product_tmpl_id" ref="product_template_27"/>
238+
<field name="standard_price" model="product.template" eval="0.70 * obj().env.ref('construction.product_template_27').list_price"/>
192239
</record>
193240
<record id="product_product_38" model="product.product">
194241
<field name="product_tmpl_id" ref="product_template_38"/>
242+
<field name="standard_price" model="product.template" eval="0.45 * obj().env.ref('construction.product_template_38').list_price"/>
195243
</record>
196244
<record id="product_product_39" model="product.product">
197245
<field name="product_tmpl_id" ref="product_template_39"/>
246+
<field name="standard_price" model="product.template" eval="0.40 * obj().env.ref('construction.product_template_39').list_price"/>
198247
</record>
199248
<record id="product_product_50" model="product.product">
200249
<field name="product_tmpl_id" ref="product_template_50"/>
250+
<field name="standard_price" model="product.template" eval="0.56 * obj().env.ref('construction.product_template_50').list_price"/>
201251
</record>
202252
<record id="product_product_8" model="product.product">
203253
<field name="product_tmpl_id" ref="product_template_8"/>
254+
<field name="standard_price" model="product.template" eval="0.69 * obj().env.ref('construction.product_template_8').list_price"/>
204255
</record>
205256
</odoo>

construction/demo/hr_employee.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<field name="parent_id" ref="hr.employee_admin"/>
2323
<field name="coach_id" ref="hr.employee_admin"/>
2424
<field name="timesheet_manager_id" ref="base.user_admin"/>
25+
<field name="planning_role_ids" eval="[(4, ref('planning_role_4'))]"/>
2526
</record>
2627
<record id="hr_employee_5" model="hr.employee">
2728
<field name="image_1920" type="base64" file="construction/static/src/binary/hr_employee/3-image_1920"/>
@@ -34,6 +35,7 @@
3435
<field name="parent_id" ref="hr.employee_admin"/>
3536
<field name="coach_id" ref="hr.employee_admin"/>
3637
<field name="timesheet_manager_id" ref="base.user_admin"/>
38+
<field name="planning_role_ids" eval="[(4, ref('planning_role_5'))]"/>
3739
</record>
3840
<record id="hr_employee_3" model="hr.employee">
3941
<field name="image_1920" type="base64" file="construction/static/src/binary/hr_employee/4-image_1920"/>
@@ -60,6 +62,7 @@
6062
<field name="parent_id" ref="hr.employee_admin"/>
6163
<field name="coach_id" ref="hr.employee_admin"/>
6264
<field name="timesheet_manager_id" ref="base.user_admin"/>
65+
<field name="planning_role_ids" eval="[(4, ref('planning_role_4'))]"/>
6366
</record>
6467
<record id="hr_employee_2" model="hr.employee">
6568
<field name="image_1920" type="base64" file="construction/static/src/binary/hr_employee/6-image_1920"/>
@@ -72,5 +75,6 @@
7275
<field name="parent_id" ref="hr.employee_admin"/>
7376
<field name="coach_id" ref="hr.employee_admin"/>
7477
<field name="timesheet_manager_id" ref="base.user_admin"/>
78+
<field name="planning_role_ids" eval="[(4, ref('planning_role_4'))]"/>
7579
</record>
7680
</odoo>

construction/demo/resource_resource.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,19 @@
2424
<record id="resource_resource_4" model="resource.resource">
2525
<field name="name">David Miller</field>
2626
</record>
27+
<record id="resource_resource_8" model="resource.resource">
28+
<field name="name">Mini Crawler Crane</field>
29+
<field name="role_ids" eval="[ref('planning_role_1')]"/>
30+
<field name="resource_type">material</field>
31+
</record>
32+
<record id="resource_resource_9" model="resource.resource">
33+
<field name="name">Concrete Mixer Truck</field>
34+
<field name="role_ids" eval="[ref('planning_role_2')]"/>
35+
<field name="resource_type">material</field>
36+
</record>
37+
<record id="resource_resource_10" model="resource.resource">
38+
<field name="name">Aerial Work Platform</field>
39+
<field name="role_ids" eval="[ref('planning_role_3')]"/>
40+
<field name="resource_type">material</field>
41+
</record>
2742
</odoo>

0 commit comments

Comments
 (0)