From ba6d1ad7d3d6622e2038f7e562ab35eeb6738435 Mon Sep 17 00:00:00 2001 From: Andhitia Rama Date: Mon, 23 Sep 2024 20:55:54 +0700 Subject: [PATCH] [UPD] ssi_general_audit_worksheet_inherent_risk * Inherent Risk Factor dibuat menjadi dinamis dengan master data * KK Inherent Risk diubah menjadi Account Level Inherent Risk Factor --- .../__manifest__.py | 3 + .../ir_sequence/general_audit_ws_a418d89.xml | 2 +- .../models/__init__.py | 1 + .../general_audit_inherent_risk_factor.py | 23 +++ .../models/general_audit_ws_a418d89.py | 50 +++--- .../models/general_audit_ws_a418d89_detail.py | 36 ++-- .../security/ir.model.access.csv | 3 + .../security/ir_module_category_data.xml | 4 +- .../security/res_group_data.xml | 18 ++ ...neral_audit_inherent_risk_factor_views.xml | 77 ++++++++ .../views/general_audit_ws_a418d89_views.xml | 170 ++---------------- 11 files changed, 194 insertions(+), 193 deletions(-) create mode 100644 ssi_general_audit_worksheet_inherent_risk/models/general_audit_inherent_risk_factor.py create mode 100644 ssi_general_audit_worksheet_inherent_risk/security/ir.model.access.csv create mode 100644 ssi_general_audit_worksheet_inherent_risk/security/res_group_data.xml create mode 100644 ssi_general_audit_worksheet_inherent_risk/views/general_audit_inherent_risk_factor_views.xml diff --git a/ssi_general_audit_worksheet_inherent_risk/__manifest__.py b/ssi_general_audit_worksheet_inherent_risk/__manifest__.py index cfbdd9e..4265c61 100644 --- a/ssi_general_audit_worksheet_inherent_risk/__manifest__.py +++ b/ssi_general_audit_worksheet_inherent_risk/__manifest__.py @@ -14,6 +14,8 @@ ], "data": [ "security/ir_module_category_data.xml", + "security/res_group_data.xml", + "security/ir.model.access.csv", "security/res_group/general_audit_ws_a418d89.xml", "security/ir_model_access/general_audit_ws_a418d89.xml", "security/ir_rule/general_audit_ws_a418d89.xml", @@ -22,6 +24,7 @@ "data/policy_template/general_audit_ws_a418d89.xml", "data/approval_template/general_audit_ws_a418d89.xml", "data/general_audit_worksheet_type_data.xml", + "views/general_audit_inherent_risk_factor_views.xml", "views/general_audit_ws_a418d89_views.xml", "views/general_audit_standard_detail_views.xml", ], diff --git a/ssi_general_audit_worksheet_inherent_risk/data/ir_sequence/general_audit_ws_a418d89.xml b/ssi_general_audit_worksheet_inherent_risk/data/ir_sequence/general_audit_ws_a418d89.xml index 6df138d..eeabde7 100644 --- a/ssi_general_audit_worksheet_inherent_risk/data/ir_sequence/general_audit_ws_a418d89.xml +++ b/ssi_general_audit_worksheet_inherent_risk/data/ir_sequence/general_audit_ws_a418d89.xml @@ -4,7 +4,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - Inherent Risk (a418d89) + Account Level Inherent Risks (a418d89) general_audit_ws_a418d89 6 WS-A418D89/%(range_year)s/ diff --git a/ssi_general_audit_worksheet_inherent_risk/models/__init__.py b/ssi_general_audit_worksheet_inherent_risk/models/__init__.py index bb9f3d5..f313784 100644 --- a/ssi_general_audit_worksheet_inherent_risk/models/__init__.py +++ b/ssi_general_audit_worksheet_inherent_risk/models/__init__.py @@ -3,6 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0-standalone.html). from . import ( + general_audit_inherent_risk_factor, general_audit_ws_a418d89, general_audit_ws_a418d89_detail, general_audit_standard_detail, diff --git a/ssi_general_audit_worksheet_inherent_risk/models/general_audit_inherent_risk_factor.py b/ssi_general_audit_worksheet_inherent_risk/models/general_audit_inherent_risk_factor.py new file mode 100644 index 0000000..c50be48 --- /dev/null +++ b/ssi_general_audit_worksheet_inherent_risk/models/general_audit_inherent_risk_factor.py @@ -0,0 +1,23 @@ +# Copyright 2022 OpenSynergy Indonesia +# Copyright 2022 PT. Simetri Sinergi Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0-standalone.html). + +from odoo import fields, models + + +class GeneralAuditInherentRiskFactor(models.Model): + _name = "general_audit_inherent_risk_factor" + _inherit = [ + "mixin.master_data", + ] + _description = "General Audit Inherent Risk Factor" + _order = "sequence, id" + + sequence = fields.Integer( + string="Sequence", + default=10, + ) + direct_impact = fields.Boolean( + string="Direct Impact to Risk", + default=False, + ) diff --git a/ssi_general_audit_worksheet_inherent_risk/models/general_audit_ws_a418d89.py b/ssi_general_audit_worksheet_inherent_risk/models/general_audit_ws_a418d89.py index 9666c18..c5407ee 100644 --- a/ssi_general_audit_worksheet_inherent_risk/models/general_audit_ws_a418d89.py +++ b/ssi_general_audit_worksheet_inherent_risk/models/general_audit_ws_a418d89.py @@ -9,36 +9,36 @@ class GeneralAuditWSA418D89(models.Model): _name = "general_audit_ws_a418d89" - _description = "Inherent Risk (a418d89)" + _description = "Account Level Inherent Risk (a418d89)" _inherit = [ "general_audit_worksheet_mixin", ] _type_xml_id = "ssi_general_audit_worksheet_inherent_risk." "worksheet_type_a418d89" - risk_material_missstatement = fields.Selection( - string="Risk Material Misstatement", - selection=[ - ("low", "Low"), - ("medium", "Medium"), - ("high", "High"), - ], - readonly=True, - required=False, - states={ - "open": [ - ("readonly", False), - ], - }, - ) - auditor_respons = fields.Text( - string="Auditor Respons", - readonly=True, - states={ - "open": [ - ("readonly", False), - ], - }, - ) + # risk_material_missstatement = fields.Selection( + # string="Risk Material Misstatement", + # selection=[ + # ("low", "Low"), + # ("medium", "Medium"), + # ("high", "High"), + # ], + # readonly=True, + # required=False, + # states={ + # "open": [ + # ("readonly", False), + # ], + # }, + # ) + # auditor_respons = fields.Text( + # string="Auditor Respons", + # readonly=True, + # states={ + # "open": [ + # ("readonly", False), + # ], + # }, + # ) detail_ids = fields.One2many( string="Details", comodel_name="general_audit_ws_a418d89.detail", diff --git a/ssi_general_audit_worksheet_inherent_risk/models/general_audit_ws_a418d89_detail.py b/ssi_general_audit_worksheet_inherent_risk/models/general_audit_ws_a418d89_detail.py index 309d898..c11ea4e 100644 --- a/ssi_general_audit_worksheet_inherent_risk/models/general_audit_ws_a418d89_detail.py +++ b/ssi_general_audit_worksheet_inherent_risk/models/general_audit_ws_a418d89_detail.py @@ -36,6 +36,26 @@ class GeneralAuditWSA418D89Detail(models.Model): related="standard_detail_id.sequence", store=True, ) + inherent_risk_factor_without_impact_ids = fields.Many2many( + string="Inherent Risk Factor Without Direct Impact", + comodel_name="general_audit_inherent_risk_factor", + relation="rel_general_audit_ws_a418d89_detail_2_without_impact", + column1="detail_id", + column2="inherent_risk_factor_id", + domain=[ + ("direct_impact", "=", False), + ], + ) + inherent_risk_factor_with_impact_ids = fields.Many2many( + string="Inherent Risk Factor With Direct Impact", + comodel_name="general_audit_inherent_risk_factor", + relation="rel_general_audit_ws_a418d89_detail_2_with_impact", + column1="detail_id", + column2="inherent_risk_factor_id", + domain=[ + ("direct_impact", "=", False), + ], + ) inherent_risk_factor_a = fields.Boolean( string="Inherent Risk Factor A", default=False, @@ -120,11 +140,7 @@ class GeneralAuditWSA418D89Detail(models.Model): @api.depends( "likelihood_risk_occuring", "impact_of_risk", - "inherent_risk_factor_f", - "inherent_risk_factor_g", - "inherent_risk_factor_h", - "inherent_risk_factor_i", - "inherent_risk_factor_j", + "inherent_risk_factor_with_impact_ids", "fraud_risk", "other_significant_risk_factor", ) @@ -135,13 +151,9 @@ def _compute_risk(self): if record.impact_of_risk == "high": inherent_risk = "high" if ( - record.inherent_risk_factor_f - or record.inherent_risk_factor_g - or record.inherent_risk_factor_h - or record.inherent_risk_factor_i - or record.inherent_risk_factor_j - or record.fraud_risk - ) or record.other_significant_risk_factor: + record.inherent_risk_factor_with_impact_ids + or record.other_significant_risk_factor + ): significant_risk = True elif record.impact_of_risk == "low": inherent_risk = "medium" diff --git a/ssi_general_audit_worksheet_inherent_risk/security/ir.model.access.csv b/ssi_general_audit_worksheet_inherent_risk/security/ir.model.access.csv new file mode 100644 index 0000000..a7b3afe --- /dev/null +++ b/ssi_general_audit_worksheet_inherent_risk/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +client_general_audit_inherent_risk_factor_configurator,general_audit_inherent_risk_factor - configurator,model_general_audit_inherent_risk_factor,general_audit_inherent_risk_factor_group,1,1,1,1 +client_general_audit_inherent_risk_factor_all,general_audit_inherent_risk_factor - all,model_general_audit_inherent_risk_factor,,1,0,0,0 diff --git a/ssi_general_audit_worksheet_inherent_risk/security/ir_module_category_data.xml b/ssi_general_audit_worksheet_inherent_risk/security/ir_module_category_data.xml index 92078bf..13ac02a 100644 --- a/ssi_general_audit_worksheet_inherent_risk/security/ir_module_category_data.xml +++ b/ssi_general_audit_worksheet_inherent_risk/security/ir_module_category_data.xml @@ -7,12 +7,12 @@ id="general_audit_ws_a418d89_workflow_module_category" model="ir.module.category" > - Inherent Risk (a418d89) + Account Level Inherent Risks (a418d89) - Inherent Risk (a418d89) + Account Level Inherent Risks (a418d89) diff --git a/ssi_general_audit_worksheet_inherent_risk/security/res_group_data.xml b/ssi_general_audit_worksheet_inherent_risk/security/res_group_data.xml new file mode 100644 index 0000000..8f1eb63 --- /dev/null +++ b/ssi_general_audit_worksheet_inherent_risk/security/res_group_data.xml @@ -0,0 +1,18 @@ + + + + + + Inherent Risk Factor + + + + diff --git a/ssi_general_audit_worksheet_inherent_risk/views/general_audit_inherent_risk_factor_views.xml b/ssi_general_audit_worksheet_inherent_risk/views/general_audit_inherent_risk_factor_views.xml new file mode 100644 index 0000000..76e36c3 --- /dev/null +++ b/ssi_general_audit_worksheet_inherent_risk/views/general_audit_inherent_risk_factor_views.xml @@ -0,0 +1,77 @@ + + + + + + general_audit_inherent_risk_factor - search + general_audit_inherent_risk_factor + + primary + + + + + + + general_audit_inherent_risk_factor - tree + general_audit_inherent_risk_factor + + primary + + + + + + + + + + + + + + general_audit_inherent_risk_factor - form + general_audit_inherent_risk_factor + + primary + + + + + + + + + + + + Inherent Risks Factors + ir.actions.act_window + general_audit_inherent_risk_factor + tree,form + + + + + diff --git a/ssi_general_audit_worksheet_inherent_risk/views/general_audit_ws_a418d89_views.xml b/ssi_general_audit_worksheet_inherent_risk/views/general_audit_ws_a418d89_views.xml index e9783c0..6fe38fc 100644 --- a/ssi_general_audit_worksheet_inherent_risk/views/general_audit_ws_a418d89_views.xml +++ b/ssi_general_audit_worksheet_inherent_risk/views/general_audit_ws_a418d89_views.xml @@ -43,106 +43,18 @@ - - - - - - - - - - - - - - @@ -165,74 +77,26 @@ /> - - - - - - - - - + - - - - - - - + + @@ -244,7 +108,7 @@ - Inherent Risk + Account Level Inherent Risks ir.actions.act_window general_audit_ws_a418d89 tree,form @@ -252,7 +116,7 @@