Skip to content

Commit 560ef34

Browse files
committed
[IMP] construction(_developer): update demo data
Update demo datas related to sale orders, purchase orders, invoices and stock moves to have clean data to analyse when looking at the margins earned through a project. Task-6470254 X-original-commit: 687fc74
1 parent 16012b7 commit 560ef34

14 files changed

Lines changed: 609 additions & 402 deletions

construction/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
'name': 'Construction Builder',
3-
'version': '1.7',
3+
'version': '1.8',
44
'category': 'Construction',
55
'depends': [
66
'base_industry_data',
Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<odoo noupdate="1">
3-
<record id="sale_order_template_1" model="sale.order.template">
4-
<field name="name">Renovation Project</field>
5-
<field name="note"><![CDATA[<div data-oe-version="2.0"><strong>Terms</strong></div>
6-
<div>30% deposit, 70% on completion</div>
3+
<record id="sale_order_template_1" model="sale.order.template">
4+
<field name="name">Renovation Project</field>
5+
<field name="note"><![CDATA[<div data-oe-version="2.0"><strong>Terms</strong></div>
6+
<div>30% deposit, 20% down payments up to completion</div>
77
<div>All work guaranteed 10 years</div>
88
<div>Insurance certificate attached</div>
9-
]]></field>
10-
<field name="number_of_days">60</field>
11-
<field name="require_signature" eval="True"/>
12-
<field name="prepayment_percent">1.0</field>
13-
<field name="spreadsheet_template_id" ref="sale_order_spreadsheet_1"/>
14-
</record>
9+
]]></field>
10+
<field name="number_of_days">60</field>
11+
<field name="require_signature" eval="True"/>
12+
<field name="prepayment_percent">1.0</field>
13+
<field name="spreadsheet_template_id" ref="sale_order_spreadsheet_1"/>
14+
</record>
15+
<record id="sale_order_template_2" model="sale.order.template">
16+
<field name="name">Window Opening Retrofit in Existing Wall</field>
17+
<field name="template_type">section</field>
18+
<field name="require_signature" eval="True"/>
19+
<field name="prepayment_percent">1.0</field>
20+
</record>
1521
</odoo>

construction/data/sale_order_template_line.xml

Lines changed: 430 additions & 385 deletions
Large diffs are not rendered by default.

construction/demo/hr_employee.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<field name="work_contact_id" ref="base.partner_admin"/>
1010
<field name="work_email">bill.ding@yourcompany.example.com</field>
1111
<field name="user_id" ref="base.user_admin"/>
12+
<field name="hourly_cost">40.0</field>
1213
</record>
1314
<record id="hr_employee_4" model="hr.employee">
1415
<field name="image_1920" type="bytes" file="construction/static/src/binary/hr_employee/2-image_1920"/>
@@ -23,6 +24,7 @@
2324
<field name="timesheet_manager_id" ref="base.user_admin"/>
2425
<field name="planning_role_ids" eval="[(4, ref('planning_role_4')), (4, ref('planning_role_6')), (4, ref('planning_role_7'))]"/>
2526
<field name="default_planning_role_id" ref="planning_role_7"/>
27+
<field name="hourly_cost">40.0</field>
2628
</record>
2729
<record id="hr_employee_5" model="hr.employee">
2830
<field name="image_1920" type="bytes" file="construction/static/src/binary/hr_employee/3-image_1920"/>
@@ -36,6 +38,7 @@
3638
<field name="coach_id" ref="hr.employee_admin"/>
3739
<field name="timesheet_manager_id" ref="base.user_admin"/>
3840
<field name="planning_role_ids" eval="[(4, ref('planning_role_5'))]"/>
41+
<field name="hourly_cost">50.0</field>
3942
</record>
4043
<record id="hr_employee_3" model="hr.employee">
4144
<field name="image_1920" type="bytes" file="construction/static/src/binary/hr_employee/4-image_1920"/>
@@ -50,6 +53,7 @@
5053
<field name="parent_id" ref="hr.employee_admin"/>
5154
<field name="coach_id" ref="hr.employee_admin"/>
5255
<field name="timesheet_manager_id" ref="base.user_admin"/>
56+
<field name="hourly_cost">35.0</field>
5357
</record>
5458
<record id="hr_employee_6" model="hr.employee">
5559
<field name="image_1920" type="bytes" file="construction/static/src/binary/hr_employee/5-image_1920"/>
@@ -64,6 +68,7 @@
6468
<field name="timesheet_manager_id" ref="base.user_admin"/>
6569
<field name="planning_role_ids" eval="[(4, ref('planning_role_4')), (4, ref('planning_role_6'))]"/>
6670
<field name="default_planning_role_id" ref="planning_role_4"/>
71+
<field name="hourly_cost">35.0</field>
6772
</record>
6873
<record id="hr_employee_2" model="hr.employee">
6974
<field name="image_1920" type="bytes" file="construction/static/src/binary/hr_employee/6-image_1920"/>
@@ -78,5 +83,6 @@
7883
<field name="timesheet_manager_id" ref="base.user_admin"/>
7984
<field name="planning_role_ids" eval="[(4, ref('planning_role_4')), (4, ref('planning_role_6'))]"/>
8085
<field name="default_planning_role_id" ref="planning_role_4"/>
86+
<field name="hourly_cost">35.0</field>
8187
</record>
8288
</odoo>

construction/demo/project_project.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<field name="favorite_user_ids" eval="[Command.link(ref('base.user_admin'))]"/>
1616
</record>
1717
<record id="project_project_7" model="project.project">
18-
<field name="name">S00002 - Davis / Old Farm renovation in guest house</field>
18+
<field name="name">S00002 - Davis / Padel club cafeteria</field>
1919
<field name="allow_billable" eval="True"/>
2020
<field name="type_ids" eval="[(6, 0, [ref('planning_project_stage_0'), ref('planning_project_stage_1'), ref('planning_project_stage_2'), ref('planning_project_stage_3'), ref('planning_project_stage_4')])]" />
2121
<field name="user_id" ref="base.user_admin"/>

construction/demo/project_update.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
</record>
99
<record id="project_update_2" model="project.update">
1010
<field name="name">Review</field>
11-
<field name="status">at_risk</field>
12-
<field name="progress">15</field>
11+
<field name="status">on_track</field>
12+
<field name="progress">50</field>
1313
<field name="project_id" ref="project_project_7"/>
1414
<field name="user_id" eval="ref('base.user_admin')"/>
15+
<field name="date" eval="DateTime.now() + relativedelta(weeks=-2)"/>
16+
<field name="description"><![CDATA[
17+
<h2>1. Executive Summary &amp; Schedule Health</h2><ul><li><p><b>Key Focus Area:</b> Structural frame sign-off, early facade glazing completion, and exterior terrace pergola assembly.</p></li><li><p><b>General Summary:</b> Main civil and structural milestones for Phase 1 are progressing according to schedule. Early quality control walkthroughs on completed zones (Cafeteria bay &amp; upper terrace) have identified two non-blocking material defects. Corrective actions have been issued via Odoo Site Remarks without impacting the critical path.</p></li></ul><h2>2. Work Progress &amp; Phase Breakdown (15% Completion)</h2><ul><li><p><b>Phase 1: Foundations &amp; Heavy Structure</b> — 100% Completed</p></li><li><p><b>Phase 2: Building Envelope &amp; Glazing (Cafeteria Zone)</b> — 65% Completed</p></li><li><p><b>Phase 3: Outdoor Terraces &amp; Pergola Structures</b> — 40% Completed</p></li><li><p><b>Phase 4: MEP Rough-Ins &amp; Interior Finishes</b> — 0% Completed (Scheduled for Next Month)</p></li></ul><h2>3. Quality Control &amp; Site Remarks Log</h2><p>2 defect items were logged during the pre-delivery walkthrough of the Cafeteria sector and are accounted for in the current phase tracking.</p><h2>4. Financials &amp; Change Management Overview</h2><ul><li><p><b>Budget Status:</b> On Budget.</p></li><li><p><b>Contract Variations / Change Orders:</b></p><ul><li><p>Both logged defect repairs are classified under <b>Subcontractor Liability / Warranty</b>; zero impact on the project contingency fund or main contract value.</p></li></ul></li></ul>
18+
]]></field>
1519
</record>
1620
</odoo>

construction/demo/purchase_order.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@
1414
<field name="project_id" ref="project_project_7"/>
1515
<field name="user_id" ref="base.user_admin" />
1616
</record>
17+
<record id="purchase_order_4" model="purchase.order">
18+
<field name="partner_id" ref="base_industry_data.res_partner_34"/>
19+
<field name="project_id" ref="project_project_7"/>
20+
<field name="user_id" ref="base.user_admin" />
21+
</record>
1722
</odoo>
Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,39 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<odoo noupdate="1">
3-
<function model="purchase.order" name="button_confirm" eval="[[ref('purchase_order_1'), ref('purchase_order_2'), ref('purchase_order_3')]]"/>
3+
<function model="purchase.order" name="button_confirm" eval="[[ref('purchase_order_1'), ref('purchase_order_2'), ref('purchase_order_3'), ref('purchase_order_4')]]"/>
44
<function name="button_validate" model="stock.picking">
55
<value model="stock.picking" eval="
66
(
77
obj().env.ref('construction.purchase_order_1') +
88
obj().env.ref('construction.purchase_order_2') +
9-
obj().env.ref('construction.purchase_order_3')
9+
obj().env.ref('construction.purchase_order_3') +
10+
obj().env.ref('construction.purchase_order_4')
1011
).reference_ids.picking_ids.ids"/>
1112
</function>
1213

13-
<function model="purchase.order" name="action_create_invoice" eval="[[ref('purchase_order_2')]]"/>
14+
<!-- Create and validates invoices-->
15+
<function model="purchase.order" name="action_create_invoice" eval="[[ref('purchase_order_2'), ref('purchase_order_3'), ref('purchase_order_4')]]"/>
16+
<function model="account.move" name="write">
17+
<value model="account.move" eval="obj().env.ref('construction.purchase_order_4').invoice_ids.ids"/>
18+
<value eval="{'invoice_date': DateTime.now()}"/>
19+
</function>
20+
<function model="account.move" name="action_post">
21+
<value model="account.move" eval="
22+
obj().env.ref('construction.purchase_order_2').invoice_ids.ids +
23+
obj().env.ref('construction.purchase_order_3').invoice_ids.ids +
24+
obj().env.ref('construction.purchase_order_4').invoice_ids.ids
25+
"/>
26+
</function>
27+
28+
<!-- Confirm stock.picking for SO and create backorder of not in stock products -->
29+
<function name="action_split_transfer" model="stock.picking">
30+
<value model="stock.picking" eval="obj().env.ref('construction.sale_order_6').picking_ids.ids"/>
31+
</function>
32+
<function name="button_validate" model="stock.picking">
33+
<value model="stock.picking" eval="obj().search([('sale_id', '=', obj().env.ref('construction.sale_order_6').id), ('backorder_id', '=', False)], limit=1).id"/>
34+
</function>
35+
<function name="write" model="stock.picking">
36+
<value model="stock.picking" eval="obj().search([('sale_id', '=', obj().env.ref('construction.sale_order_6').id), ('backorder_id', '=', False)], limit=1).id"/>
37+
<value eval="{'date_done': DateTime.now() - relativedelta(months=1)}"/>
38+
</function>
1439
</odoo>

construction/demo/purchase_order_line.xml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,70 @@
8282
<field name="product_qty">6.0</field>
8383
<field name="price_unit">120.0</field>
8484
</record>
85+
<record id="purchase_order_line_15b" model="purchase.order.line">
86+
<field name="product_id" ref="product_product_42"/>
87+
<field name="order_id" ref="purchase_order_4"/>
88+
<field name="product_qty">2.0</field>
89+
<field name="price_unit">1080.0</field>
90+
</record>
91+
<record id="purchase_order_line_16" model="purchase.order.line">
92+
<field name="product_id" ref="product_product_45"/>
93+
<field name="order_id" ref="purchase_order_4"/>
94+
<field name="product_qty">120.0</field>
95+
<field name="price_unit">22.5</field>
96+
</record>
97+
<record id="purchase_order_line_17" model="purchase.order.line">
98+
<field name="product_id" ref="product_product_15"/>
99+
<field name="order_id" ref="purchase_order_4"/>
100+
<field name="product_qty">1.0</field>
101+
<field name="price_unit">564.0</field>
102+
</record>
103+
<record id="purchase_order_line_18" model="purchase.order.line">
104+
<field name="product_id" ref="product_product_49"/>
105+
<field name="order_id" ref="purchase_order_4"/>
106+
<field name="product_qty">150.0</field>
107+
<field name="price_unit">18.0</field>
108+
</record>
109+
<record id="purchase_order_line_19" model="purchase.order.line">
110+
<field name="product_id" ref="product_product_50"/>
111+
<field name="order_id" ref="purchase_order_4"/>
112+
<field name="product_qty">10.0</field>
113+
<field name="price_unit">336.0</field>
114+
</record>
115+
<record id="purchase_order_line_20" model="purchase.order.line">
116+
<field name="product_id" ref="product_product_51"/>
117+
<field name="order_id" ref="purchase_order_4"/>
118+
<field name="product_qty">4.0</field>
119+
<field name="price_unit">2010.0</field>
120+
</record>
121+
<record id="purchase_order_line_21" model="purchase.order.line">
122+
<field name="product_id" ref="product_product_31"/>
123+
<field name="order_id" ref="purchase_order_4"/>
124+
<field name="product_qty">30.0</field>
125+
<field name="price_unit">26.5</field>
126+
</record>
127+
<record id="purchase_order_line_22" model="purchase.order.line">
128+
<field name="product_id" ref="product_product_27"/>
129+
<field name="order_id" ref="purchase_order_4"/>
130+
<field name="product_qty">1.0</field>
131+
<field name="price_unit">2240.0</field>
132+
</record>
133+
<record id="purchase_order_line_23" model="purchase.order.line">
134+
<field name="product_id" ref="product_product_26"/>
135+
<field name="order_id" ref="purchase_order_4"/>
136+
<field name="product_qty">6.0</field>
137+
<field name="price_unit">122.5</field>
138+
</record>
139+
<record id="purchase_order_line_24" model="purchase.order.line">
140+
<field name="product_id" ref="product_product_55"/>
141+
<field name="order_id" ref="purchase_order_4"/>
142+
<field name="product_qty">1.0</field>
143+
<field name="price_unit">1060.0</field>
144+
</record>
145+
<record id="purchase_order_line_25" model="purchase.order.line">
146+
<field name="product_id" ref="product_product_54"/>
147+
<field name="order_id" ref="purchase_order_4"/>
148+
<field name="product_qty">120.0</field>
149+
<field name="price_unit">11.0</field>
150+
</record>
85151
</odoo>

construction/demo/sale_order_confirm.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
</record>
3535
<function name="create_invoices" model="sale.advance.payment.inv" eval="[ref('sale_advance_payment_inv_2')]"/>
3636

37+
<!-- Validate invoices -->
38+
<function model="account.move" name="action_post">
39+
<value model="account.move" eval="obj().env.ref('construction.sale_order_6').invoice_ids.ids"/>
40+
</function>
41+
3742
<!-- Assign sale order 1's tasks and Tasks progress-->
3843
<function name="write" model="project.task">
3944
<value model="project.task" eval="obj().search([('sale_line_id', 'in', [ref('sale_order_line_4'), ref('sale_order_line_5')])]).ids"/>

0 commit comments

Comments
 (0)