Skip to content

Commit cc88d37

Browse files
etobellaluisDIXMIT
authored andcommitted
[MIG] purchase_order_approval_block: Migration to 16.0
1 parent 04ac46d commit cc88d37

File tree

5 files changed

+32
-25
lines changed

5 files changed

+32
-25
lines changed

purchase_order_approval_block/README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Purchase Order Approval Block
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
20-
:target: https://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_approval_block
20+
:target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_approval_block
2121
:alt: OCA/purchase-workflow
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_order_approval_block
23+
:target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_order_approval_block
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=15.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=16.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -90,7 +90,7 @@ Bug Tracker
9090
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
9191
In case of trouble, please check there if your issue has already been reported.
9292
If you spotted it first, help us to smash it by providing a detailed and welcomed
93-
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_approval_block%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
93+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_approval_block%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
9494

9595
Do not contact contributors directly about support or help with technical issues.
9696

@@ -122,6 +122,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
122122
mission is to support the collaborative development of Odoo features and
123123
promote its widespread use.
124124

125-
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_approval_block>`_ project on GitHub.
125+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_approval_block>`_ project on GitHub.
126126

127127
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

purchase_order_approval_block/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Purchase Order Approval Block",
66
"author": "ForgeFlow, Odoo Community Association (OCA)",
7-
"version": "15.0.1.0.3",
7+
"version": "16.0.1.0.0",
88
"category": "Purchase Management",
99
"website": "https://github.com/OCA/purchase-workflow",
1010
"depends": ["purchase_exception"],

purchase_order_approval_block/models/purchase_order.py

+15-12
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,21 @@ def _compute_approval_blocked(self):
2020
for rec in self:
2121
rec.approval_blocked = rec.approval_block_id
2222

23-
@api.model
24-
def create(self, vals):
25-
po = super(PurchaseOrder, self).create(vals)
26-
if "approval_block_id" in vals and vals["approval_block_id"]:
27-
po.message_post(
28-
body=_('Order "%(order_name)s" blocked with reason "%(block_name)s"')
29-
% {
30-
"order_name": po.name,
31-
"block_name": po.approval_block_id.name,
32-
}
33-
)
34-
return po
23+
@api.model_create_multi
24+
def create(self, mvals):
25+
records = super(PurchaseOrder, self).create(mvals)
26+
for vals, po in zip(mvals, records):
27+
if "approval_block_id" in vals and vals["approval_block_id"]:
28+
po.message_post(
29+
body=_(
30+
'Order "%(order_name)s" blocked with reason "%(block_name)s"'
31+
)
32+
% {
33+
"order_name": po.name,
34+
"block_name": po.approval_block_id.name,
35+
}
36+
)
37+
return records
3538

3639
def write(self, vals):
3740
res = super(PurchaseOrder, self).write(vals)

purchase_order_approval_block/static/description/index.html

+10-7
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -368,7 +369,7 @@ <h1 class="title">Purchase Order Approval Block</h1>
368369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369370
!! source digest: sha256:74122745f3cc0e89379ebe3492b17aaea3dd81d64a91aaa07d36f70368eae33c
370371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_approval_block"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_order_approval_block"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_approval_block"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_order_approval_block"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372373
<p>This module allows you to block the approval of an RFQ when an Approval
373374
Block Reason has been provided. Upon confirmation of an RFQ the orders will be
374375
waiting for approval by a Manager.</p>
@@ -445,7 +446,7 @@ <h1><a class="toc-backref" href="#toc-entry-8">Bug Tracker</a></h1>
445446
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
446447
In case of trouble, please check there if your issue has already been reported.
447448
If you spotted it first, help us to smash it by providing a detailed and welcomed
448-
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_approval_block%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
449+
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_approval_block%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
449450
<p>Do not contact contributors directly about support or help with technical issues.</p>
450451
</div>
451452
<div class="section" id="credits">
@@ -467,11 +468,13 @@ <h2><a class="toc-backref" href="#toc-entry-11">Contributors</a></h2>
467468
<div class="section" id="maintainers">
468469
<h2><a class="toc-backref" href="#toc-entry-12">Maintainers</a></h2>
469470
<p>This module is maintained by the OCA.</p>
470-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
471+
<a class="reference external image-reference" href="https://odoo-community.org">
472+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
473+
</a>
471474
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
472475
mission is to support the collaborative development of Odoo features and
473476
promote its widespread use.</p>
474-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_approval_block">OCA/purchase-workflow</a> project on GitHub.</p>
477+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_approval_block">OCA/purchase-workflow</a> project on GitHub.</p>
475478
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
476479
</div>
477480
</div>

purchase_order_approval_block/views/purchase_order_view.xml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<field name="date_order" position="after">
1616
<field
1717
name="approval_block_id"
18+
force_save="1"
1819
attrs="{'readonly': ['|',('approval_blocked','=', True), ('state', 'not in', 'draft')]}"
1920
/>
2021
<field name="approval_blocked" invisible="True" />

0 commit comments

Comments
 (0)