Skip to content

Commit

Permalink
Merge branch '18.0' of https://github.com/OmniaGit/odooplm.git into 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mboscolo committed Dec 4, 2024
2 parents d0e4690 + 905cdf3 commit 7b6f7c9
Show file tree
Hide file tree
Showing 176 changed files with 18,836 additions and 58 deletions.
5 changes: 5 additions & 0 deletions plm_mrp_workorder/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- encoding: utf-8 -*-
from . import controllers
from . import models
from . import wizard
from . import report
55 changes: 55 additions & 0 deletions plm_mrp_workorder/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# -*- encoding: utf-8 -*-
{
"name": "PLM MRP Work Order",
"version": "18.0.1.0.0",
"category": "Manufacturing/Manufacturing",
"sequence": 51,
"summary": """Work Orders, Planning, Stock Reports.""",
"depends": [
"plm_quality",
"mrp",
"barcodes",
"plm_web_gantt",
"web_tour",
"hr_hourly_cost",
],
# "auto_install": ["mrp"],
"description": """extension for MRP
* Work order planning. Check planning by Gantt views grouped by production order / work center
* Traceability report
* Cost Structure report""",
"data": [
"security/ir.model.access.csv",
"security/mrp_workorder_security.xml",
"data/mrp_workorder_data.xml",
"views/hr_employee_views.xml",
"views/quality_views.xml",
"views/mrp_bom_views.xml",
"views/mrp_workorder_views.xml",
"views/mrp_operation_views.xml",
"views/mrp_production_views.xml",
"views/mrp_workcenter_views.xml",
"views/stock_picking_type_views.xml",
"views/res_config_settings_view.xml",
"views/mrp_workorder_views_menus.xml",
"wizard/additional_workorder_views.xml",
"wizard/propose_change_views.xml",
],
"demo": [
"data/mrp_production_demo.xml",
"data/mrp_workorder_demo.xml",
"data/mrp_workorder_demo_stool.xml",
],
"license": "AGPL-3",
"assets": {
"web.assets_backend": [
"plm_mrp_workorder/static/src/**/*.scss",
"plm_mrp_workorder/static/src/**/*.js",
"plm_mrp_workorder/static/src/**/*.xml",
("remove", "plm_mrp_workorder/static/src/mrp_workorder_gantt_*"),
],
"web.assets_backend_lazy": [
"plm_mrp_workorder/static/src/mrp_workorder_gantt_*",
],
},
}
2 changes: 2 additions & 0 deletions plm_mrp_workorder/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- encoding: utf-8 -*-
from . import webmanifest
34 changes: 34 additions & 0 deletions plm_mrp_workorder/controllers/webmanifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- encoding: utf-8 -*-
from odoo import http
from odoo.http import request
from odoo.tools import file_open, image_process
from odoo.addons.web.controllers import webmanifest


class WebManifest(webmanifest.WebManifest):
def _get_scoped_app_icons(self, app_id):
if app_id == "mrp_shop_floor":
return [
{
"src": "/plm_mrp_workorder/static/description/mrp_display_icon.svg",
"sizes": "any",
"type": "image/svg+xml",
}
]
return super()._get_scoped_app_icons(app_id)

@http.route()
def scoped_app_icon_png(self, app_id):
if app_id == "mrp_shop_floor":
with file_open(
"plm_mrp_workorder/static/description/mrp_display_icon.png", "rb"
) as file:
image = image_process(
file.read(),
size=(180, 180),
expand=True,
colorize=(255, 255, 255),
padding=16,
)
return request.make_response(image, headers=[("Content-Type", "image/png")])
return super().scoped_app_icon_png(app_id)
18 changes: 18 additions & 0 deletions plm_mrp_workorder/data/mrp_production_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- <function model="mrp.production" name="button_plan" eval="[ref('mrp.mrp_production_1')]"/> -->

<record id="quality_point_picture" model="quality.point">
<field name="product_ids" eval="[(4, ref('mrp.product_product_computer_desk'))]"/>
<field name="picking_type_ids" model="stock.warehouse" eval="[(4, obj().env.ref('stock.warehouse0').manu_type_id.id)]"/>
<field name="operation_id" ref="mrp.mrp_routing_workcenter_5"/>
<field name="test_type_id" ref="plm_quality.test_type_picture"/>
<field name="note">Take a picture of the table head serial number.</field>
<field name="title">Picture of the SN</field>
<field name="worksheet_page">1</field>
<field name="sequence">10</field>
</record>

</data>
</odoo>
35 changes: 35 additions & 0 deletions plm_mrp_workorder/data/mrp_workorder_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="tablet_client_action" model="ir.actions.client">
<field name="name">Tablet Client Action</field>
<field name="tag">tablet_client_action</field>
<field name="res_model">mrp_workorder</field>
</record>

<record id="plm_mrp_workorder.test_type_register_consumed_materials" model="quality.point.test_type">
<field name="name">Register Consumed Materials</field>
<field name="technical_name">register_consumed_materials</field>
</record>

<record id="plm_mrp_workorder.test_type_register_production" model="quality.point.test_type">
<field name="name">Register Production</field>
<field name="technical_name">register_production</field>
</record>

<record id="plm_mrp_workorder.test_type_register_byproducts" model="quality.point.test_type">
<field name="name">Register By-products</field>
<field name="technical_name">register_byproducts</field>
<field name="active" eval="False"/>
</record>

<record id="plm_mrp_workorder.test_type_print_label" model="quality.point.test_type">
<field name="name">Print label</field>
<field name="technical_name">print_label</field>
</record>

<record id="base.group_user" model="res.groups">
<field name="implied_ids" eval="[(4, ref('plm_mrp_workorder.group_mrp_wo_shop_floor'))]"/>
</record>
</data>
</odoo>
81 changes: 81 additions & 0 deletions plm_mrp_workorder/data/mrp_workorder_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<odoo>
<!-- Quality Control From Manufacturing -->

<!-- For [FURN_9666] Table-->
<record id="quality_point_register_serial_production" model="quality.point">
<field name="product_ids" eval="[(4, ref('mrp.product_product_computer_desk'))]"/>
<field name="picking_type_ids" model="stock.warehouse" eval="[(4, obj().env.ref('stock.warehouse0').manu_type_id.id)]"/>
<field name="operation_id" ref="mrp.mrp_routing_workcenter_5"/>
<field name="test_type_id" ref="plm_mrp_workorder.test_type_register_production"/>
<field name="note">Generate a new Serial Number for the assembled product.</field>
<field name="title">Generate Serial Number</field>
<field name="worksheet_page">0</field>
<field name="sequence">5</field>
</record>

<record id="quality_point_component_registration" model="quality.point">
<field name="product_ids" eval="[(4, ref('mrp.product_product_computer_desk'))]"/>
<field name="picking_type_ids" model="stock.warehouse" eval="[(4, obj().env.ref('stock.warehouse0').manu_type_id.id)]"/>
<field name="operation_id" ref="mrp.mrp_routing_workcenter_5"/>
<field name="test_type_id" ref="plm_mrp_workorder.test_type_register_consumed_materials"/>
<field name="note">Please enter the table head serial number.</field>
<field name="title">Component Registration: Table Head</field>
<field name="component_id" ref="mrp.product_product_computer_desk_head"/>
<field name="worksheet_page">1</field>
<field name="sequence">20</field>
</record>

<record id="quality_point_instructions" model="quality.point">
<field name="product_ids" eval="[(4, ref('mrp.product_product_computer_desk'))]"/>
<field name="picking_type_ids" model="stock.warehouse" eval="[(4, obj().env.ref('stock.warehouse0').manu_type_id.id)]"/>
<field name="operation_id" ref="mrp.mrp_routing_workcenter_5"/>
<field name="test_type_id" ref="plm_quality.test_type_instructions"/>
<field name="note">Please ensure you are using the new SRX679 screwdriver.</field>
<field name="title">Choice of screwdriver</field>
<field name="worksheet_page">1</field>
<field name="sequence">30</field>
</record>

<record id="quality_point_component_registration_2" model="quality.point">
<field name="product_ids" eval="[(4, ref('mrp.product_product_computer_desk'))]"/>
<field name="picking_type_ids" model="stock.warehouse" eval="[(4, obj().env.ref('stock.warehouse0').manu_type_id.id)]"/>
<field name="operation_id" ref="mrp.mrp_routing_workcenter_5"/>
<field name="test_type_id" ref="plm_mrp_workorder.test_type_register_consumed_materials"/>
<field name="note">Please encode the table legs lot number(s).</field>
<field name="title">Component Registration: Table Legs</field>
<field name="component_id" ref="mrp.product_product_computer_desk_leg"/>
<field name="worksheet_page">4</field>
<field name="sequence">70</field>
</record>

<record id="quality_point_register_production" model="quality.point">
<field name="product_ids" eval="[(4, ref('mrp.product_product_computer_desk'))]"/>
<field name="picking_type_ids" model="stock.warehouse" eval="[(4, obj().env.ref('stock.warehouse0').manu_type_id.id)]"/>
<field name="operation_id" ref="mrp.mrp_routing_workcenter_5"/>
<field name="test_type_id" ref="plm_quality.test_type_instructions"/>
<field name="note">Please attach the legs to the table as shown below.</field>
<field name="title">Table Legs</field>
<field name="worksheet_page">4</field>
<field name="sequence">60</field>
</record>

<record id="quality_point_print_labels" model="quality.point">
<field name="product_ids" eval="[(4, ref('mrp.product_product_computer_desk'))]"/>
<field name="picking_type_ids" model="stock.warehouse" eval="[(4, obj().env.ref('stock.warehouse0').manu_type_id.id)]"/>
<field name="operation_id" ref="mrp.mrp_routing_workcenter_5"/>
<field name="test_type_id" ref="plm_mrp_workorder.test_type_print_label"/>
<field name="title">Print Labels</field>
<field name="worksheet_page">0</field>
<field name="sequence">90</field>
</record>

<!-- Split the pdf added in mrp demo data-->
<record id="base.group_user" model="res.groups">
<field name="implied_ids" eval="[(4, ref('plm_mrp_workorder.group_mrp_wo_tablet_timer')), (4, ref('plm_mrp_workorder.group_mrp_wo_shop_floor'))]"/>
</record>

<function model="mrp.workorder" name="_create_checks">
<function eval="[[('state', 'not in', ('cancel', 'done'))]]" model="mrp.workorder" name="search"/>
</function>

</odoo>
Loading

0 comments on commit 7b6f7c9

Please sign in to comment.