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