Skip to content

Commit

Permalink
Merge pull request #1895 from VoicuStefan2001/17.0
Browse files Browse the repository at this point in the history
[17.0][UPD] record_type obligatory po_type plus code trimming
  • Loading branch information
VoicuStefan2001 authored Jan 31, 2025
2 parents f45a4e4 + 7348ddf commit 9178c26
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 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.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.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
4 changes: 3 additions & 1 deletion deltatech_record_type/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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**

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.5",
"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(
_("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:
Expand Down
3 changes: 2 additions & 1 deletion deltatech_record_type/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion deltatech_record_type/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ <h1 class="title">Terrabit - Record Type</h1>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="https://www.odoo.com/documentation/master/legal/licenses.html"><img alt="License: OPL-1" src="https://img.shields.io/badge/licence-OPL--1-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/dhongu/deltatech/tree/17.0/deltatech_record_type"><img alt="dhongu/deltatech" src="https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github" /></a></p>
<p>Features:</p>
<ul class="simple">
<li>Types can be defined for records</li>
<li>Types can be defined for records sale.order, purchase.order,
account.move</li>
<li>If a model has no types defined, the type field will not be displayed</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down
4 changes: 2 additions & 2 deletions deltatech_record_type/views/account_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<xpath expr="//label[@for='partner_id']" position="before">
<xpath expr="//field[@name='team_id']" position="after">
<field name="show_invoice_type" invisible="1" />
<field
name="invoice_type"
Expand All @@ -29,7 +29,7 @@
<menuitem
id="menu_invoice_order_type"
name="Invoice Types"
parent="account.menu_account_config"
parent="account.account_invoicing_menu"
action="action_invoice_type"
/>
</odoo>

0 comments on commit 9178c26

Please sign in to comment.