Skip to content

Commit

Permalink
[17.0][UPD] record_type obligatory po_type
Browse files Browse the repository at this point in the history
  • Loading branch information
VoicuStefan2001 committed Jan 31, 2025
1 parent 462d4ef commit 7348ddf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deltatech_record_type/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 13 additions & 1 deletion deltatech_record_type/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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(

Check warning on line 38 in deltatech_record_type/models/purchase.py

View check run for this annotation

Codecov / codecov/patch

deltatech_record_type/models/purchase.py#L38

Added line #L38 was not covered by tests
_("You do not have the rights to confirm an order without specifying an Order Type.")
)
return super().button_confirm()

Check warning on line 41 in deltatech_record_type/models/purchase.py

View check run for this annotation

Codecov / codecov/patch

deltatech_record_type/models/purchase.py#L41

Added line #L41 was not covered by tests

def _prepare_invoice(self):
invoice_vals = super()._prepare_invoice()
if self.journal_id:
Expand Down

0 comments on commit 7348ddf

Please sign in to comment.