Skip to content

Commit d633302

Browse files
committed
[ADD] vineyard: add industry.
1 parent 773549a commit d633302

File tree

106 files changed

+5065
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+5065
-0
lines changed

vineyard/__manifest__.py

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
'name': 'Vineyard',
3+
'version': '1.0',
4+
'category': 'Supply Chain',
5+
'author': 'Odoo S.A.',
6+
'depends': [
7+
'appointment_crm',
8+
'appointment_google_calendar',
9+
'appointment_hr',
10+
'base_industry_data',
11+
# 'crm_enterprise',
12+
# 'hr_homeworking',
13+
'hr_sign',
14+
# 'hr_skills',
15+
'industry_fsm_sale_report',
16+
'industry_fsm_stock',
17+
'knowledge',
18+
# 'l10n_be_reports',
19+
'mrp_plm',
20+
'pos_enterprise',
21+
# 'pos_hr',
22+
# 'pos_online_payment',
23+
'product_expiry',
24+
# 'project_mrp_workorder_account',
25+
'project_purchase',
26+
# 'purchase_mrp',
27+
'quality_mrp',
28+
# 'quality_mrp_workorder',
29+
# 'sale_crm',
30+
# 'sale_mrp',
31+
'sale_planning',
32+
# 'sale_purchase_stock',
33+
# 'stock_barcode',
34+
# 'survey',
35+
'website_appointment_sale_project',
36+
# 'website_crm',
37+
# 'website_sale_stock',
38+
'web_studio',
39+
],
40+
'data': [
41+
'data/res_groups.xml',
42+
'data/ir_model.xml',
43+
'data/ir_model_fields.xml',
44+
'data/ir_ui_view.xml',
45+
'data/ir_actions_act_window.xml',
46+
'data/ir_actions_server.xml',
47+
'data/ir_ui_menu.xml',
48+
'data/base_automation.xml',
49+
'data/ir_model_access.xml',
50+
'data/ir_rule.xml',
51+
# 'data/crm_stage.xml',
52+
'data/knowledge_article.xml',
53+
'data/pos_category.xml',
54+
'data/pos_payment_method.xml',
55+
'data/uom_uom.xml',
56+
'data/project_task_type.xml',
57+
'data/worksheet_template.xml',
58+
'data/project_project_stage.xml',
59+
'data/project_project.xml',
60+
'data/product_category.xml',
61+
'data/product_template.xml',
62+
'data/product_product.xml',
63+
'data/pos_config.xml',
64+
'data/product_attribute.xml',
65+
'data/quality_point.xml',
66+
'data/mail_message.xml',
67+
'data/knowledge_article_favorite.xml',
68+
],
69+
'demo': [
70+
'demo/product_template.xml',
71+
'demo/appointment_type.xml',
72+
'demo/crm_tag.xml',
73+
'demo/res_partner.xml',
74+
'demo/purchase_order.xml',
75+
'demo/hr_employee.xml',
76+
'demo/pos_config.xml',
77+
'demo/account_analytic_account.xml',
78+
'demo/website_view.xml',
79+
'demo/crm_lead.xml',
80+
'demo/hr_department.xml',
81+
'demo/project_project.xml',
82+
'demo/pos_session.xml',
83+
'demo/purchase_order_line.xml',
84+
'demo/mrp_bom.xml',
85+
'demo/stock_lot.xml',
86+
'demo/mrp_production.xml',
87+
'demo/mrp_bom_line.xml',
88+
'demo/ir_attachment_post.xml',
89+
'demo/project_task.xml',
90+
'demo/stock_quant.xml',
91+
'demo/website_page.xml',
92+
'demo/website_menu.xml',
93+
'demo/quality_check.xml',
94+
'demo/website_theme_apply.xml',
95+
'demo/product_supplierinfo.xml',
96+
'demo/payment_provider_demo.xml',
97+
'demo/website.xml',
98+
],
99+
'license': 'OPL-1',
100+
'cloc_exclude': [
101+
'data/knowledge_article.xml',
102+
'data/ir_action_server.xml',
103+
],
104+
'images': [
105+
'images/main.png',
106+
],
107+
}

vineyard/data/base_automation.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo>
3+
<record id="industry_on_harvest_c49e5fbd-d0b4-427c-80d2-679edf97a9f5" model="base.automation">
4+
<field name="model_id" ref="mrp.model_mrp_production"/>
5+
<field name="action_server_ids" eval="[(6, 0, [ref('industry__harvest_and_transfer_server_action')])]"/>
6+
<field name="trigger">on_create_or_write</field>
7+
<field name="filter_domain">[("state", "=", "done")]</field>
8+
<field name="filter_pre_domain">["&amp;", ("picking_type_id", "in", [13]), ("state", "=", "confirmed")]</field>
9+
<field name="name">Industry: On harvest</field>
10+
<field name="trigger_field_ids" eval="[(6, 0, [ref('mrp.field_mrp_production__state')])]"/>
11+
</record>
12+
<record id="industry_on_harvest__8cf801c4-ce7c-4ea4-860a-b572251e3f2c" model="base.automation">
13+
<field name="model_id" ref="stock.model_stock_picking"/>
14+
<field name="action_server_ids" eval="[(6, 0, [ref('industry__check_harvest_is_from_harvest_location_server_action')])]"/>
15+
<field name="trigger">on_create_or_write</field>
16+
<field name="filter_domain">[]</field>
17+
<field name="filter_pre_domain">["&amp;", ("picking_type_id.x_is_harvest", "!=", False), ("state", "not in", ["done", "cancel"])]</field>
18+
<field name="name">Industry: On Harvest Validation</field>
19+
<field name="trigger_field_ids" eval="[(6, 0, [ref('stock.field_stock_picking__state')])]"/>
20+
</record>
21+
</odoo>

vineyard/data/crm_stage.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo auto_sequence="1" noupdate="1">
3+
<!-- <record id="crm.stage_lead1" model="crm.stage" forcecreate="1">
4+
<field name="name">New</field>
5+
</record>
6+
<record id="crm.stage_lead2" model="crm.stage" forcecreate="1">
7+
<field name="name">Qualified</field>
8+
</record>
9+
<record id="crm.stage_lead3" model="crm.stage" forcecreate="1">
10+
<field name="name">Proposition</field>
11+
</record>
12+
<record id="crm.stage_lead4" model="crm.stage" forcecreate="1">
13+
<field name="name">Won</field>
14+
<field name="is_won" eval="True"/>
15+
</record> -->
16+
</odoo>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo>
3+
<record id="harvests_5faa925f-bbfe-4e35-bc16-81ad96cc6faf" model="ir.actions.act_window">
4+
<field name="domain">[("picking_type_id", "in", [13])]</field>
5+
<field name="help"><![CDATA[<p class="o_view_nocontent_smiling_face">
6+
This is your new action.
7+
</p>
8+
<p>By default, it contains a list and a form view and possibly
9+
other view types depending on the options you chose for your model.
10+
</p>
11+
<p>
12+
You can start customizing these screens by clicking on the Studio icon on the
13+
top right corner (you can also customize this help message there).
14+
</p>
15+
]]></field>
16+
<field name="name">Harvests</field>
17+
<field name="res_model">mrp.production</field>
18+
<field name="view_mode">list,form,calendar,pivot,graph</field>
19+
</record>
20+
<record id="harvests_ecaf8e35-ced9-4cf3-bdde-fdd168700320" model="ir.actions.act_window">
21+
<field name="domain">[("picking_type_id.x_is_harvest", "=", True)]</field>
22+
<field name="help"><![CDATA[<p class="o_view_nocontent_smiling_face">
23+
This is your new action.
24+
</p>
25+
<p>By default, it contains a list and a form view and possibly
26+
other view types depending on the options you chose for your model.
27+
</p>
28+
<p>
29+
You can start customizing these screens by clicking on the Studio icon on the
30+
top right corner (you can also customize this help message there).
31+
</p>
32+
]]></field>
33+
<field name="name">Harvests</field>
34+
<field name="res_model">mrp.production</field>
35+
<field name="view_mode">kanban,list,form,calendar,pivot,graph,activity</field>
36+
</record>
37+
<record id="harvests_a3d096ee-38dd-4630-a753-a227d79a456f" model="ir.actions.act_window">
38+
<field name="domain">[("x_is_harvest", "!=", False)]</field>
39+
<field name="help"><![CDATA[<p class="o_view_nocontent_smiling_face">
40+
This is your new action.
41+
</p>
42+
<p>By default, it contains a list and a form view and possibly
43+
other view types depending on the options you chose for your model.
44+
</p>
45+
<p>
46+
You can start customizing these screens by clicking on the Studio icon on the
47+
top right corner (you can also customize this help message there).
48+
</p>
49+
]]></field>
50+
<field name="name">Harvests</field>
51+
<field name="res_model">stock.picking</field>
52+
</record>
53+
<record id="harvests_quants_5f38ea30-7f8b-4947-9779-8a785d6f5151" model="ir.actions.act_window">
54+
<field name="help"><![CDATA[<p class="o_view_nocontent_smiling_face">
55+
This is your new action.
56+
</p>
57+
<p>By default, it contains a list and a form view and possibly
58+
other view types depending on the options you chose for your model.
59+
</p>
60+
<p>
61+
You can start customizing these screens by clicking on the Studio icon on the
62+
top right corner (you can also customize this help message there).
63+
</p>
64+
]]></field>
65+
<field name="name">Harvests (Quants)</field>
66+
<field name="res_model">stock.quant</field>
67+
<field name="view_mode">kanban,list,form,pivot,graph</field>
68+
</record>
69+
<record id="harvets_21a71920-9ad2-4713-8d42-953b6038d16c" model="ir.actions.act_window">
70+
<field name="domain">["&amp;", ("location_id.x_harvest_location", "!=", False), ("picking_id.x_is_harvest", "!=", False),("state", "=", "done")]</field>
71+
<field name="help"><![CDATA[<p class="o_view_nocontent_smiling_face">
72+
This is your new action.
73+
</p>
74+
<p>By default, it contains a list and a form view and possibly
75+
other view types depending on the options you chose for your model.
76+
</p>
77+
<p>
78+
You can start customizing these screens by clicking on the Studio icon on the
79+
top right corner (you can also customize this help message there).
80+
</p>
81+
]]></field>
82+
<field name="name">Harvests</field>
83+
<field name="res_model">stock.move</field>
84+
<field name="view_mode">graph,pivot,list,form</field>
85+
</record>
86+
<record id="tests_4ac65ed9-2993-48f5-850a-6b0384c46c98" model="ir.actions.act_window">
87+
<field name="context">{'search_default_x_recipe_iteration': active_id,'default_x_recipe_iteration': active_id}</field>
88+
<field name="domain">[('x_recipe_iteration', '=', active_id)]</field>
89+
<field name="name">Tests</field>
90+
<field name="res_model">quality.check</field>
91+
</record>
92+
<record id="quality_checks_4f5af6bc-ab55-495c-a6a4-b7637547f754" model="ir.actions.act_window">
93+
<field name="context">{'search_default_production_id': active_id,'default_production_id': active_id}</field>
94+
<field name="domain">[('production_id', '=', active_id)]</field>
95+
<field name="name">Quality Checks</field>
96+
<field name="res_model">quality.check</field>
97+
</record>
98+
<record id="industry_fsm_report.x_project_task_worksheet_template_1_ir_actions_act_window_1" model="ir.actions.act_window" forcecreate="1">
99+
<field name="context">{'edit': False, 'create': False, 'delete': False, 'duplicate': False, 'action_xml_id': 'industry_fsm_report.fsm_worksheets_action_settings', 'worksheet_template_id': 1}</field>
100+
<field name="name">Worksheets</field>
101+
<field name="res_model">x_project_task_worksheet_template_1</field>
102+
<field name="search_view_id" ref="industry_fsm_report.x_project_task_worksheet_template_1_ir_ui_view_3"/>
103+
</record>
104+
</odoo>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo>
3+
<record id="industry__harvest_and_transfer_server_action" model="ir.actions.server">
4+
<field name="code"><![CDATA[dest_location = env['stock.location'].search([('complete_name', '=', 'WH/Stock')], limit=1)
5+
if not dest_location:
6+
raise UserError("Destination location not found (WH/Stock).")
7+
8+
# Confirm harvest
9+
record.action_confirm()
10+
11+
# Match inputs and set as done
12+
record['qty_producing'] = record.product_qty
13+
record.action_generate_serial()
14+
record.button_mark_done()
15+
16+
# Create a picking
17+
picking = env['stock.picking'].create({
18+
'picking_type_id': env.ref('stock.picking_type_internal').id,
19+
'location_id': record.location_dest_id.id,
20+
'location_dest_id': dest_location.id,
21+
'origin': record.name,
22+
'move_type': 'direct',
23+
})
24+
25+
# Add stock moves for the finished products
26+
for move in record.move_finished_ids.filtered(lambda m: m.product_id.type == 'product'):
27+
env['stock.move'].create({
28+
'name': move.product_id.display_name,
29+
'product_id': move.product_id.id,
30+
'product_uom_qty': move.quantity_done,
31+
'product_uom': move.product_uom.id,
32+
'location_id': record.location_dest_id.id,
33+
'location_dest_id': dest_location.id,
34+
'picking_id': picking.id,
35+
})
36+
37+
# Confirm, assign and validate the picking
38+
picking.action_confirm()
39+
picking.action_assign()
40+
picking.button_validate()
41+
42+
43+
]]></field>
44+
<field name="model_id" ref="mrp.model_mrp_production"/>
45+
<field name="state">code</field>
46+
<field name="name">Industry: Harvest and transfer</field>
47+
<field name="usage">base_automation</field>
48+
</record>
49+
<record id="industry__check_harvest_is_from_harvest_location_server_action" model="ir.actions.server">
50+
<field name="code"><![CDATA[if record.picking_type_id.x_is_harvest and not record.location_id.x_harvest_location:
51+
raise UserError ("Source location shall be eligible for harvest.")]]></field>
52+
<field name="model_id" ref="stock.model_stock_picking"/>
53+
<field name="state">code</field>
54+
<field name="name">Industry: Check Harvest Is From Harvest Location</field>
55+
<field name="usage">base_automation</field>
56+
</record>
57+
</odoo>

vineyard/data/ir_model.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo>
3+
<record id="industry_fsm_report.x_project_task_worksheet_template_1_ir_model_1" model="ir.model" forcecreate="1">
4+
<field name="info"><![CDATA[ Main super-class for regular database-persisted Odoo models.
5+
6+
Odoo models are created by inheriting from this class::
7+
8+
class ResUsers(Model):
9+
...
10+
11+
The system will later instantiate the class once per database (on
12+
which the class' module is installed).
13+
]]></field>
14+
<field name="model">x_project_task_worksheet_template_1</field>
15+
<field name="name">Default Worksheet</field>
16+
</record>
17+
</odoo>

vineyard/data/ir_model_access.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo>
3+
<record id="industry_fsm_report.x_project_task_worksheet_template_1_ir_model_access_2" model="ir.model.access" forcecreate="1">
4+
<field name="group_id" ref="project.group_project_user"/>
5+
<field name="model_id" ref="industry_fsm_report.x_project_task_worksheet_template_1_ir_model_1"/>
6+
<field name="name">x_project_task_worksheet_template_1_user_access</field>
7+
<field name="perm_create" eval="True"/>
8+
<field name="perm_read" eval="True"/>
9+
<field name="perm_unlink" eval="True"/>
10+
<field name="perm_write" eval="True"/>
11+
</record>
12+
<record id="industry_fsm_report.x_project_task_worksheet_template_1_ir_model_access_1" model="ir.model.access" forcecreate="1">
13+
<field name="group_id" ref="project.group_project_manager"/>
14+
<field name="model_id" ref="industry_fsm_report.x_project_task_worksheet_template_1_ir_model_1"/>
15+
<field name="name">x_project_task_worksheet_template_1_manager_access</field>
16+
<field name="perm_create" eval="True"/>
17+
<field name="perm_read" eval="True"/>
18+
<field name="perm_unlink" eval="True"/>
19+
<field name="perm_write" eval="True"/>
20+
</record>
21+
</odoo>

0 commit comments

Comments
 (0)