From 26cf9dec2db928c1ffae1222f4e7c00f82679350 Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Thu, 26 Dec 2024 13:21:16 +0100 Subject: [PATCH 1/7] [UPD] exp_transaction_documents: change filter label --- odex25_transactions/exp_transaction_documents/i18n/ar_001.po | 2 +- .../exp_transaction_documents/views/internal.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/i18n/ar_001.po b/odex25_transactions/exp_transaction_documents/i18n/ar_001.po index fedf4950b..59d9acc70 100644 --- a/odex25_transactions/exp_transaction_documents/i18n/ar_001.po +++ b/odex25_transactions/exp_transaction_documents/i18n/ar_001.po @@ -3006,7 +3006,6 @@ msgstr "سجل التتبع" #. module: exp_transaction_documents #: model_terms:ir.ui.view,arch_db:exp_transaction_documents.common_transactions_form #: model_terms:ir.ui.view,arch_db:exp_transaction_documents.view_incoming_transaction_filter -#: model_terms:ir.ui.view,arch_db:exp_transaction_documents.view_internal_transaction_filter #: model_terms:ir.ui.view,arch_db:exp_transaction_documents.view_outgoing_transaction_filter msgid "Transaction" msgstr "المعاملة" @@ -3052,6 +3051,7 @@ msgstr "مدير المعاملة" #: model:ir.model.fields,field_description:exp_transaction_documents.field_outgoing_transaction__name #: model:ir.model.fields,field_description:exp_transaction_documents.field_transaction_transaction__name #: model_terms:ir.ui.view,arch_db:exp_transaction_documents.common_transactions_form +#: model_terms:ir.ui.view,arch_db:exp_transaction_documents.view_internal_transaction_filter msgid "Transaction Number" msgstr "رقم المعاملة" diff --git a/odex25_transactions/exp_transaction_documents/views/internal.xml b/odex25_transactions/exp_transaction_documents/views/internal.xml index c37127b79..dda9dfacc 100644 --- a/odex25_transactions/exp_transaction_documents/views/internal.xml +++ b/odex25_transactions/exp_transaction_documents/views/internal.xml @@ -9,7 +9,7 @@ - + From 5b1d792659fe8ef393872db58aba773e3603504f Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Thu, 26 Dec 2024 13:39:53 +0100 Subject: [PATCH 2/7] [UPD] exp_transaction_documents: change rank transaction string and default value is 0 --- .../exp_transaction_documents/i18n/ar_001.po | 6 +++++- .../exp_transaction_documents/models/configuration.py | 2 +- .../exp_transaction_documents/models/transaction.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/i18n/ar_001.po b/odex25_transactions/exp_transaction_documents/i18n/ar_001.po index 59d9acc70..a4ff22dc1 100644 --- a/odex25_transactions/exp_transaction_documents/i18n/ar_001.po +++ b/odex25_transactions/exp_transaction_documents/i18n/ar_001.po @@ -3040,6 +3040,11 @@ msgstr "تاريخ المعاملة (هجري)" msgid "Transaction Details" msgstr "تفاصيل المعاملة" +#. module: exp_transaction_documents +#: model:ir.model.fields,field_description:exp_transaction_documents.field_cm_transaction_important__rank +msgid "Transaction Duration" +msgstr "مدة المعاملة" + #. module: exp_transaction_documents #: model:res.groups,name:exp_transaction_documents.group_transaction_manager msgid "Transaction Manager" @@ -3056,7 +3061,6 @@ msgid "Transaction Number" msgstr "رقم المعاملة" #. module: exp_transaction_documents -#: model:ir.model.fields,field_description:exp_transaction_documents.field_cm_transaction_important__rank #: model:ir.model.fields,field_description:exp_transaction_documents.field_incoming_transaction__add_rank #: model:ir.model.fields,field_description:exp_transaction_documents.field_internal_transaction__add_rank #: model:ir.model.fields,field_description:exp_transaction_documents.field_outgoing_transaction__add_rank diff --git a/odex25_transactions/exp_transaction_documents/models/configuration.py b/odex25_transactions/exp_transaction_documents/models/configuration.py index 75c8237aa..b07c9823a 100644 --- a/odex25_transactions/exp_transaction_documents/models/configuration.py +++ b/odex25_transactions/exp_transaction_documents/models/configuration.py @@ -34,7 +34,7 @@ class ImportantDegree(models.Model): _name = 'cm.transaction.important' name = fields.Char(string='Important Degree') - rank = fields.Integer(string='Transaction Rank') + rank = fields.Integer(string='Transaction Duration') class Procedure(models.Model): diff --git a/odex25_transactions/exp_transaction_documents/models/transaction.py b/odex25_transactions/exp_transaction_documents/models/transaction.py index 390dd3de2..697bb966e 100644 --- a/odex25_transactions/exp_transaction_documents/models/transaction.py +++ b/odex25_transactions/exp_transaction_documents/models/transaction.py @@ -148,7 +148,7 @@ class Transaction(models.Model): record.due_date = False if not len(record.important_id) or not record.transaction_date: continue - rank = record.important_id.rank or 1 + rank = record.important_id.rank final_rank = rank + record.add_rank date = datetime.strptime(str(record.transaction_date), DEFAULT_SERVER_DATE_FORMAT) due = date From dee6cb34ad252288e76fd52edf46df541918b09d Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Thu, 26 Dec 2024 14:18:53 +0100 Subject: [PATCH 3/7] [FIX] exp_transaction_documents: domain for employee in forward transaction --- .../wizard/forward_transaction.xml | 9 +++++++-- .../wizard/forward_trasaction.py | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/wizard/forward_transaction.xml b/odex25_transactions/exp_transaction_documents/wizard/forward_transaction.xml index d3bc8cc36..506142959 100644 --- a/odex25_transactions/exp_transaction_documents/wizard/forward_transaction.xml +++ b/odex25_transactions/exp_transaction_documents/wizard/forward_transaction.xml @@ -9,8 +9,13 @@ - - + + diff --git a/odex25_transactions/exp_transaction_documents/wizard/forward_trasaction.py b/odex25_transactions/exp_transaction_documents/wizard/forward_trasaction.py index 1854c31df..b794fdb67 100644 --- a/odex25_transactions/exp_transaction_documents/wizard/forward_trasaction.py +++ b/odex25_transactions/exp_transaction_documents/wizard/forward_trasaction.py @@ -23,6 +23,21 @@ class ForwardTransactionWizard(models.TransientModel): filename = fields.Char() att_description = fields.Char(string='Attach Description') + + @api.onchange('internal_unit', 'forward_type') + def _get_valid_employee_ids(self): + for rec in self: + domain = [] + if rec.forward_type == 'employee' and rec.internal_unit: + domain = [('id', 'in', rec.env['cm.entity'].search([('type', '=', 'employee'), ('parent_id', '=', rec.internal_unit.id)]).ids)] + elif rec.forward_type == 'employee': + rec.employee = False + return { + "domain": { + "employee": domain + } + } + def action_forward(self): transaction = '' name = '' From b50e3df77e09b865926f915e390ffb9f55227e22 Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Thu, 26 Dec 2024 14:20:52 +0100 Subject: [PATCH 4/7] [FIX] exp_transaction_documents: set employee falsewhen fields changed --- .../exp_transaction_documents/wizard/forward_trasaction.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/wizard/forward_trasaction.py b/odex25_transactions/exp_transaction_documents/wizard/forward_trasaction.py index b794fdb67..03d69079d 100644 --- a/odex25_transactions/exp_transaction_documents/wizard/forward_trasaction.py +++ b/odex25_transactions/exp_transaction_documents/wizard/forward_trasaction.py @@ -30,8 +30,7 @@ class ForwardTransactionWizard(models.TransientModel): domain = [] if rec.forward_type == 'employee' and rec.internal_unit: domain = [('id', 'in', rec.env['cm.entity'].search([('type', '=', 'employee'), ('parent_id', '=', rec.internal_unit.id)]).ids)] - elif rec.forward_type == 'employee': - rec.employee = False + rec.employee = False return { "domain": { "employee": domain From 7066420113740beeac456b90c2182becd1e4d1c4 Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Sun, 29 Dec 2024 12:51:27 +0100 Subject: [PATCH 5/7] [UPD] exp_transaction_documents: change name to transaction number --- odex25_transactions/exp_transaction_documents/i18n/ar_001.po | 1 + .../reports/transaction_details_report_template.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/odex25_transactions/exp_transaction_documents/i18n/ar_001.po b/odex25_transactions/exp_transaction_documents/i18n/ar_001.po index a4ff22dc1..abd1894bf 100644 --- a/odex25_transactions/exp_transaction_documents/i18n/ar_001.po +++ b/odex25_transactions/exp_transaction_documents/i18n/ar_001.po @@ -3056,6 +3056,7 @@ msgstr "مدير المعاملة" #: model:ir.model.fields,field_description:exp_transaction_documents.field_outgoing_transaction__name #: model:ir.model.fields,field_description:exp_transaction_documents.field_transaction_transaction__name #: model_terms:ir.ui.view,arch_db:exp_transaction_documents.common_transactions_form +#: model_terms:ir.ui.view,arch_db:exp_transaction_documents.transaction_details_report_temp #: model_terms:ir.ui.view,arch_db:exp_transaction_documents.view_internal_transaction_filter msgid "Transaction Number" msgstr "رقم المعاملة" diff --git a/odex25_transactions/exp_transaction_documents/reports/transaction_details_report_template.xml b/odex25_transactions/exp_transaction_documents/reports/transaction_details_report_template.xml index 546ca7819..e36334ef7 100644 --- a/odex25_transactions/exp_transaction_documents/reports/transaction_details_report_template.xml +++ b/odex25_transactions/exp_transaction_documents/reports/transaction_details_report_template.xml @@ -82,7 +82,7 @@
- + From 358ef456fac4916312a819dd28c61eb50f51540f Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Sun, 29 Dec 2024 17:50:49 +0100 Subject: [PATCH 6/7] [UPD] exp_transaction_documents --- .../views/actions_and_menus.xml | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/views/actions_and_menus.xml b/odex25_transactions/exp_transaction_documents/views/actions_and_menus.xml index 53bda6b3b..6ef9ede42 100644 --- a/odex25_transactions/exp_transaction_documents/views/actions_and_menus.xml +++ b/odex25_transactions/exp_transaction_documents/views/actions_and_menus.xml @@ -163,9 +163,17 @@ Incoming Internal Transaction internal.transaction tree,form - ['&',('state','=','send'),'|','|',('to_ids.secretary_id.user_id', '=', uid), - ('to_ids.user_id', '=', - uid),'|',('trace_ids.to_id.user_id','=',uid),'|',('trace_ids.to_id.secretary_id.user_id','=',uid),('receive_user_id','=',uid)] + + [ + '&', + ('state', '=', 'send'), + '|', '|', '|', '|', + ('to_ids.secretary_id.user_id', '=', uid), + ('to_ids.user_id', '=', uid), + ('trace_ids.to_id.user_id', '=', uid), + ('trace_ids.to_id.secretary_id.user_id', '=', uid), + ('receive_user_id', '=', uid) + ] internal.transaction tree,form - [('state', '=', 'reply'), '|', '|', ('employee_id.user_id', '=', uid), ('forward_user_id', '=', uid), ('to_ids.user_id', '=', uid)] + [ + ('state', '=', 'reply'), + '|', '|', + ('employee_id.user_id', '=', uid), + ('forward_user_id', '=', uid), + ('to_ids.user_id', '=', uid)] +
NameTransaction Number state