mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] quality_control_team_oca: Migration to 13.0
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
"name": "Quality Control Team",
|
||||
"name": "Quality Control Team OCA",
|
||||
"summary": "Adds quality control teams to handle different quality "
|
||||
"control workflows",
|
||||
"version": "12.0.1.1.1",
|
||||
"development_status": "Mature",
|
||||
"version": "13.0.1.0.0",
|
||||
"category": "Quality Control",
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
"author": "Eficent, Odoo Community Association (OCA)",
|
||||
@@ -13,7 +12,7 @@
|
||||
"license": "AGPL-3",
|
||||
"application": False,
|
||||
"installable": True,
|
||||
"depends": ["quality_control",],
|
||||
"depends": ["quality_control_oca"],
|
||||
"data": [
|
||||
"security/ir.model.access.csv",
|
||||
"views/qc_team_view.xml",
|
||||
|
||||
@@ -20,7 +20,7 @@ class QualityControlTeam(models.Model):
|
||||
self.env.context.get("default_qc_team_id")
|
||||
)
|
||||
if not qc_team_id or not qc_team_id.exists():
|
||||
company_id = self.sudo(user_id).company_id.id
|
||||
company_id = self.env["res.users"].browse(user_id).company_id.id
|
||||
qc_team_id = (
|
||||
self.env["qc.team"]
|
||||
.sudo()
|
||||
@@ -38,7 +38,7 @@ class QualityControlTeam(models.Model):
|
||||
)
|
||||
if not qc_team_id:
|
||||
default_team_id = self.env.ref(
|
||||
"quality_control_team.qc_team_main", raise_if_not_found=False
|
||||
"quality_control_team_oca.qc_team_main", raise_if_not_found=False
|
||||
)
|
||||
if default_team_id:
|
||||
qc_team_id = default_team_id
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_user_qc_team,qc.team.user,quality_control_team.model_qc_team,quality_control.group_quality_control_user,1,0,0,0
|
||||
access_manager_qc_team,qc.team.manager,quality_control_team.model_qc_team,quality_control.group_quality_control_manager,1,1,1,1
|
||||
access_user_qc_team,qc.team.user,quality_control_team_oca.model_qc_team,quality_control_oca.group_quality_control_user,1,0,0,0
|
||||
access_manager_qc_team,qc.team.manager,quality_control_team_oca.model_qc_team,quality_control_oca.group_quality_control_manager,1,1,1,1
|
||||
|
||||
|
@@ -8,8 +8,8 @@ class TestQualityControlTeam(TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestQualityControlTeam, self).setUp()
|
||||
self.qc_team_obj = self.env["qc.team"]
|
||||
self.main_qc_team = self.env.ref("quality_control_team.qc_team_main")
|
||||
self.other_company = self.env["res.company"].create({"name": "other company",})
|
||||
self.main_qc_team = self.env.ref("quality_control_team_oca.qc_team_main")
|
||||
self.other_company = self.env["res.company"].create({"name": "other company"})
|
||||
self.user_test = self.env["res.users"].create(
|
||||
{
|
||||
"name": "Test User",
|
||||
@@ -19,6 +19,11 @@ class TestQualityControlTeam(TransactionCase):
|
||||
}
|
||||
)
|
||||
|
||||
def test_default_qc_team_no_user_id(self):
|
||||
"""Test that the QC team is defaulted correctly when no user_id is provided."""
|
||||
team = self.qc_team_obj._get_default_qc_team_id()
|
||||
self.assertIsNotNone(team)
|
||||
|
||||
def test_default_qc_team(self):
|
||||
"""Test that the QC team is defaulted correctly."""
|
||||
team = self.qc_team_obj._get_default_qc_team_id(user_id=self.user_test.id)
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<div
|
||||
t-if="widget.editable"
|
||||
class="o_kanban_card_manage_settings row"
|
||||
groups="quality_control.group_quality_control_manager"
|
||||
groups="quality_control_oca.group_quality_control_manager"
|
||||
>
|
||||
<div
|
||||
role="menuitem"
|
||||
@@ -100,7 +100,6 @@
|
||||
<record id="qc_team_dashboard_act" model="ir.actions.act_window">
|
||||
<field name="name">Dashboard</field>
|
||||
<field name="res_model">qc.team</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,form</field>
|
||||
<field name="context">{'search_default_personal':1}</field>
|
||||
<field name="help" type="html">
|
||||
@@ -114,7 +113,7 @@
|
||||
id="menu_qc_team_act"
|
||||
action="qc_team_dashboard_act"
|
||||
sequence="1"
|
||||
parent="quality_control.qc_menu"
|
||||
parent="quality_control_oca.qc_menu"
|
||||
name="Dashboard"
|
||||
/>
|
||||
|
||||
|
||||
@@ -69,10 +69,9 @@
|
||||
>
|
||||
<div class="o_kanban_record_top">
|
||||
<img
|
||||
t-att-src="kanban_image('res.users', 'image_small', record.id.raw_value)"
|
||||
height="40"
|
||||
width="40"
|
||||
class="oe_avatar oe_kanban_avatar_smallbox mb0"
|
||||
t-att-src="kanban_image('res.users', 'image_128', record.id.raw_value)"
|
||||
class="oe_avatar oe_kanban_avatar_smallbox o_image_40_cover mb0"
|
||||
alt="Avatar"
|
||||
/>
|
||||
<div
|
||||
class="o_kanban_record_headings ml8"
|
||||
@@ -137,7 +136,6 @@
|
||||
<record id="qc_team_config_action" model="ir.actions.act_window">
|
||||
<field name="name">Quality Control Teams</field>
|
||||
<field name="res_model">qc.team</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
@@ -154,7 +152,7 @@
|
||||
name="Quality Control Teams"
|
||||
id="qc_team_config_menu"
|
||||
groups="base.group_system"
|
||||
parent="quality_control.menu_qc_config"
|
||||
parent="quality_control_oca.menu_qc_config"
|
||||
action="qc_team_config_action"
|
||||
sequence="10"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user