From 462d4eff3812251aaa4699aed84a7cc2ebc11bdc Mon Sep 17 00:00:00 2001 From: VoicuStefan2001 Date: Fri, 31 Jan 2025 09:57:28 +0200 Subject: [PATCH 1/2] [17.0][UPD] deltatech_record_type --- README.md | 2 +- deltatech_record_type/README.rst | 4 +++- deltatech_record_type/__manifest__.py | 2 +- deltatech_record_type/readme/DESCRIPTION.md | 3 ++- deltatech_record_type/static/description/index.html | 4 +++- deltatech_record_type/views/account_move_view.xml | 4 ++-- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 876af6dfc..5c65f66e4 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ addon | version | maintainers | summary | price [deltatech_queue_job](deltatech_queue_job/) | 17.0.1.0.2 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Deltatech Queue Job | Free [deltatech_ral](deltatech_ral/) | 17.0.1.0.3 | | RAL | Free [deltatech_reception_note](deltatech_reception_note/) | 17.0.0.1.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Batch reception note | Free -[deltatech_record_type](deltatech_record_type/) | 17.0.1.1.5 | [![VoicuStefan2001](https://github.com/VoicuStefan2001.png?size=30px)](https://github.com/VoicuStefan2001) | Manage multiple record types | Free +[deltatech_record_type](deltatech_record_type/) | 17.0.1.1.7 | [![VoicuStefan2001](https://github.com/VoicuStefan2001.png?size=30px)](https://github.com/VoicuStefan2001) | Manage multiple record types | Free [deltatech_replenish](deltatech_replenish/) | 17.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Deltatech Replenish | Free [deltatech_report_packaging](deltatech_report_packaging/) | 17.0.1.0.2 | [![cojocariudaniel1](https://github.com/cojocariudaniel1.png?size=30px)](https://github.com/cojocariudaniel1) [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Report Packaging | Free [deltatech_report_prn](deltatech_report_prn/) | 17.0.1.0.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Raport PRN | Free diff --git a/deltatech_record_type/README.rst b/deltatech_record_type/README.rst index 2051aa579..f51ed24eb 100644 --- a/deltatech_record_type/README.rst +++ b/deltatech_record_type/README.rst @@ -24,7 +24,9 @@ Terrabit - Record Type Features: -- Types can be defined for records +- Types can be defined for records sale.order, purchase.order, + account.move +- If a model has no types defined, the type field will not be displayed **Table of contents** diff --git a/deltatech_record_type/__manifest__.py b/deltatech_record_type/__manifest__.py index ad9e6a08c..ec1be1f66 100644 --- a/deltatech_record_type/__manifest__.py +++ b/deltatech_record_type/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Terrabit - Record Type", "summary": "Manage multiple record types", - "version": "17.0.1.1.5", + "version": "17.0.1.1.7", "author": "Terrabit, Voicu Stefan", "website": "https://www.terrabit.ro", "category": "Generic Modules/Other", diff --git a/deltatech_record_type/readme/DESCRIPTION.md b/deltatech_record_type/readme/DESCRIPTION.md index 73f1627e9..f7169c7f9 100644 --- a/deltatech_record_type/readme/DESCRIPTION.md +++ b/deltatech_record_type/readme/DESCRIPTION.md @@ -1,3 +1,4 @@ Features: -- Types can be defined for records +- Types can be defined for records sale.order, purchase.order, account.move +- If a model has no types defined, the type field will not be displayed diff --git a/deltatech_record_type/static/description/index.html b/deltatech_record_type/static/description/index.html index cbebce835..0c1397413 100644 --- a/deltatech_record_type/static/description/index.html +++ b/deltatech_record_type/static/description/index.html @@ -19,7 +19,9 @@

Terrabit - Record Type

Mature License: OPL-1 dhongu/deltatech

Features:

Table of contents

diff --git a/deltatech_record_type/views/account_move_view.xml b/deltatech_record_type/views/account_move_view.xml index bcdfec08d..b37395fe8 100644 --- a/deltatech_record_type/views/account_move_view.xml +++ b/deltatech_record_type/views/account_move_view.xml @@ -4,7 +4,7 @@ account.move - + From 7348ddf9e78a93b0015d0eea5bbdf3e6ecc3a0de Mon Sep 17 00:00:00 2001 From: VoicuStefan2001 Date: Fri, 31 Jan 2025 10:57:32 +0200 Subject: [PATCH 2/2] [17.0][UPD] record_type obligatory po_type --- README.md | 2 +- deltatech_record_type/__manifest__.py | 2 +- deltatech_record_type/models/purchase.py | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c65f66e4..e49a05d8a 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ addon | version | maintainers | summary | price [deltatech_queue_job](deltatech_queue_job/) | 17.0.1.0.2 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Deltatech Queue Job | Free [deltatech_ral](deltatech_ral/) | 17.0.1.0.3 | | RAL | Free [deltatech_reception_note](deltatech_reception_note/) | 17.0.0.1.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Batch reception note | Free -[deltatech_record_type](deltatech_record_type/) | 17.0.1.1.7 | [![VoicuStefan2001](https://github.com/VoicuStefan2001.png?size=30px)](https://github.com/VoicuStefan2001) | Manage multiple record types | Free +[deltatech_record_type](deltatech_record_type/) | 17.0.1.1.8 | [![VoicuStefan2001](https://github.com/VoicuStefan2001.png?size=30px)](https://github.com/VoicuStefan2001) | Manage multiple record types | Free [deltatech_replenish](deltatech_replenish/) | 17.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Deltatech Replenish | Free [deltatech_report_packaging](deltatech_report_packaging/) | 17.0.1.0.2 | [![cojocariudaniel1](https://github.com/cojocariudaniel1.png?size=30px)](https://github.com/cojocariudaniel1) [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Report Packaging | Free [deltatech_report_prn](deltatech_report_prn/) | 17.0.1.0.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Raport PRN | Free diff --git a/deltatech_record_type/__manifest__.py b/deltatech_record_type/__manifest__.py index ec1be1f66..7a401ff31 100644 --- a/deltatech_record_type/__manifest__.py +++ b/deltatech_record_type/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Terrabit - Record Type", "summary": "Manage multiple record types", - "version": "17.0.1.1.7", + "version": "17.0.1.1.8", "author": "Terrabit, Voicu Stefan", "website": "https://www.terrabit.ro", "category": "Generic Modules/Other", diff --git a/deltatech_record_type/models/purchase.py b/deltatech_record_type/models/purchase.py index be54ef6a2..5799863ca 100644 --- a/deltatech_record_type/models/purchase.py +++ b/deltatech_record_type/models/purchase.py @@ -3,7 +3,7 @@ # See README.rst file on addons root folder for license details -from odoo import api, fields, models +from odoo import _, api, exceptions, fields, models from odoo.tools.safe_eval import safe_eval @@ -28,6 +28,18 @@ def _compute_show_po_type(self): else: record.show_po_type = False + def button_confirm(self): + for order in self: + if ( + not self.env.user.has_group("deltatech_record_type.group_confirm_order_without_record_type") + and order.show_po_type + ): + if not order.po_type: + raise exceptions.UserError( + _("You do not have the rights to confirm an order without specifying an Order Type.") + ) + return super().button_confirm() + def _prepare_invoice(self): invoice_vals = super()._prepare_invoice() if self.journal_id: