From 40ebfff9dcedc9411186dac9c7116a5ec806852a Mon Sep 17 00:00:00 2001 From: Julien Schwanen Date: Mon, 16 Sep 2024 09:01:36 +0200 Subject: [PATCH] [IMP] Construction: Adding a cost automation - Added "Automate Cost Update" checkbox in the "Vendor Bills" section of the "Purchase" tab in the product template view. - Implemented automation rule to update supplier info when a PO or Bill is saved with a different price for the same product, based on the checkbox being checked. task-4138749 --- construction/__manifest__.py | 6 ++++ construction/data/base_automation.xml | 19 ++++++++++ construction/data/ir_action_server.xml | 48 ++++++++++++++++++++++++++ construction/data/ir_model_fields.xml | 9 +++++ construction/data/ir_ui_view.xml | 17 +++++++++ 5 files changed, 99 insertions(+) create mode 100644 construction/data/base_automation.xml create mode 100644 construction/data/ir_action_server.xml create mode 100644 construction/data/ir_model_fields.xml create mode 100644 construction/data/ir_ui_view.xml diff --git a/construction/__manifest__.py b/construction/__manifest__.py index 9423a1524..969888be9 100644 --- a/construction/__manifest__.py +++ b/construction/__manifest__.py @@ -7,6 +7,7 @@ focusing on accurate quoting, efficient planning, seamless execution, and excellent customer service, ... """, 'depends': [ + 'base_automation', 'crm_enterprise', 'documents', 'helpdesk', @@ -20,8 +21,13 @@ 'sale_margin', 'sale_project_forecast', 'sign', + 'web_studio', ], 'data': [ + 'data/base_automation.xml', + 'data/ir_action_server.xml', + 'data/ir_model_fields.xml', + 'data/ir_ui_view.xml', 'data/account_analytic_account.xml', 'data/documents_folder.xml', 'data/res_config_settings.xml', diff --git a/construction/data/base_automation.xml b/construction/data/base_automation.xml new file mode 100644 index 000000000..34b905b75 --- /dev/null +++ b/construction/data/base_automation.xml @@ -0,0 +1,19 @@ + + + + Automate Supplier Info + + + on_state_set + + [('state', '=', 'purchase')] + + + + + on_state_set + + [('state', '=', 'posted')] + Automate Supplier Info + + diff --git a/construction/data/ir_action_server.xml b/construction/data/ir_action_server.xml new file mode 100644 index 000000000..ab1f97c37 --- /dev/null +++ b/construction/data/ir_action_server.xml @@ -0,0 +1,48 @@ + + + + Automate the supplier info cost + + + code + + + + + Automate the supplier info cost Invoices + + + code + + + diff --git a/construction/data/ir_model_fields.xml b/construction/data/ir_model_fields.xml new file mode 100644 index 000000000..de54ad5a7 --- /dev/null +++ b/construction/data/ir_model_fields.xml @@ -0,0 +1,9 @@ + + + + x_automate_cost_update + boolean + + Automate Cost Update + + diff --git a/construction/data/ir_ui_view.xml b/construction/data/ir_ui_view.xml new file mode 100644 index 000000000..3685215ed --- /dev/null +++ b/construction/data/ir_ui_view.xml @@ -0,0 +1,17 @@ + + + + product.category.form customization + + extension + product.category + + 160 + form + + + + + + +