Skip to content

Commit 2a82dc0

Browse files
committed
[MIG] purchase_no_rfq: Migration to 19.0
1 parent 0c34750 commit 2a82dc0

File tree

6 files changed

+39
-43
lines changed

6 files changed

+39
-43
lines changed

purchase_no_rfq/README.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
=========================================
26
Purchase Order - No Request For Quotation
37
=========================================
@@ -13,17 +17,17 @@ Purchase Order - No Request For Quotation
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
20-
:target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_no_rfq
24+
:target: https://github.com/OCA/purchase-workflow/tree/19.0/purchase_no_rfq
2125
:alt: OCA/purchase-workflow
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_no_rfq
27+
:target: https://translation.odoo-community.org/projects/purchase-workflow-19-0/purchase-workflow-19-0-purchase_no_rfq
2428
:alt: Translate me on Weblate
2529
.. |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=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=19.0
2731
:alt: Try me on Runboat
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -49,8 +53,8 @@ Once installed :
4953

5054
|image2|
5155

52-
.. |image1| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/18.0/purchase_no_rfq/static/description/purchase_order_tree.png
53-
.. |image2| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/18.0/purchase_no_rfq/static/description/purchase_order_form.png
56+
.. |image1| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/19.0/purchase_no_rfq/static/description/purchase_order_tree.png
57+
.. |image2| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/19.0/purchase_no_rfq/static/description/purchase_order_form.png
5458

5559
**Table of contents**
5660

@@ -63,7 +67,7 @@ Bug Tracker
6367
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
6468
In case of trouble, please check there if your issue has already been reported.
6569
If you spotted it first, help us to smash it by providing a detailed and welcomed
66-
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_no_rfq%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
70+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_no_rfq%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6771

6872
Do not contact contributors directly about support or help with technical issues.
6973

@@ -111,6 +115,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
111115

112116
|maintainer-legalsylvain|
113117

114-
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_no_rfq>`_ project on GitHub.
118+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/19.0/purchase_no_rfq>`_ project on GitHub.
115119

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

purchase_no_rfq/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{
66
"name": "Purchase Order - No Request For Quotation",
7-
"version": "18.0.1.0.0",
7+
"version": "19.0.1.0.0",
88
"author": "GRAP,Odoo Community Association (OCA)",
99
"maintainers": ["legalsylvain"],
1010
"license": "AGPL-3",

purchase_no_rfq/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def uninstall_hook(env):
77
# Unhide menu item for request for quotation and restore sequence
88
env.ref("purchase.menu_purchase_rfq").write(
99
{
10-
"groups_id": [(5,)],
10+
"group_ids": [(5,)],
1111
"sequence": 0,
1212
}
1313
)

purchase_no_rfq/models/purchase_order.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,3 @@ class PurchaseOrder(models.Model):
1717
("sent", "Sent"),
1818
]
1919
)
20-
21-
def print_quotation(self):
22-
# This method is intentionally overloaded to redefine its functionality.
23-
# Note: We are breaking the inheritance chain here by not calling super(),
24-
orders = self.filtered(lambda x: x.state == "draft")
25-
orders.write({"state": "sent"})
26-
report = self.env.ref("purchase.action_report_purchase_order")
27-
return report.report_action(self)

purchase_no_rfq/static/description/index.html

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Purchase Order - No Request For Quotation</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="purchase-order-no-request-for-quotation">
364-
<h1 class="title">Purchase Order - No Request For Quotation</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="purchase-order-no-request-for-quotation">
370+
<h1>Purchase Order - No Request For Quotation</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:5d1c74bb7d1c6c722be25a8f8dd8b46b1a57a95f97265fd2453346353a254d80
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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/18.0/purchase_no_rfq"><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-18-0/purchase-workflow-18-0-purchase_no_rfq"><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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/19.0/purchase_no_rfq"><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-19-0/purchase-workflow-19-0-purchase_no_rfq"><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=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>This module extends the odoo purchase module, to remove ‘Request for
374379
Quotation’ state, simplifying the workflow for the end users.</p>
375380
<p>Once installed :</p>
@@ -381,14 +386,14 @@ <h1 class="title">Purchase Order - No Request For Quotation</h1>
381386
<li>The colors in the tree view is correctly set to <tt class="docutils literal"><span class="pre">decoration-info</span></tt>
382387
for ‘draft’ and ‘sent’ orders.</li>
383388
</ul>
384-
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/purchase-workflow/18.0/purchase_no_rfq/static/description/purchase_order_tree.png" /></p>
389+
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/purchase-workflow/19.0/purchase_no_rfq/static/description/purchase_order_tree.png" /></p>
385390
<ul class="simple">
386391
<li>In the form view, all the RFQ names are removed or replaced by
387392
‘Purchase Order’. The module makes also the ‘Print’ button allways
388393
available and not only on ‘draft’ and ‘sent’ status.</li>
389394
<li>The option ‘Print &gt; Request For quotation’ is also disabled.</li>
390395
</ul>
391-
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/purchase-workflow/18.0/purchase_no_rfq/static/description/purchase_order_form.png" /></p>
396+
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/purchase-workflow/19.0/purchase_no_rfq/static/description/purchase_order_form.png" /></p>
392397
<p><strong>Table of contents</strong></p>
393398
<div class="contents local topic" id="contents">
394399
<ul class="simple">
@@ -402,23 +407,23 @@ <h1 class="title">Purchase Order - No Request For Quotation</h1>
402407
</ul>
403408
</div>
404409
<div class="section" id="bug-tracker">
405-
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
410+
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
406411
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
407412
In case of trouble, please check there if your issue has already been reported.
408413
If you spotted it first, help us to smash it by providing a detailed and welcomed
409-
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_no_rfq%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
414+
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_no_rfq%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
410415
<p>Do not contact contributors directly about support or help with technical issues.</p>
411416
</div>
412417
<div class="section" id="credits">
413-
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
418+
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
414419
<div class="section" id="authors">
415-
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
420+
<h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
416421
<ul class="simple">
417422
<li>GRAP</li>
418423
</ul>
419424
</div>
420425
<div class="section" id="contributors">
421-
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
426+
<h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
422427
<ul class="simple">
423428
<li>Sylvain LE GAL &lt;<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>&gt;</li>
424429
<li><a class="reference external" href="https://binhex.cloud/">Binhex</a>:<ul>
@@ -433,7 +438,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
433438
</ul>
434439
</div>
435440
<div class="section" id="maintainers">
436-
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
441+
<h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
437442
<p>This module is maintained by the OCA.</p>
438443
<a class="reference external image-reference" href="https://odoo-community.org">
439444
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -443,10 +448,11 @@ <h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
443448
promote its widespread use.</p>
444449
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
445450
<p><a class="reference external image-reference" href="https://github.com/legalsylvain"><img alt="legalsylvain" src="https://github.com/legalsylvain.png?size=40px" /></a></p>
446-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/18.0/purchase_no_rfq">OCA/purchase-workflow</a> project on GitHub.</p>
451+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/19.0/purchase_no_rfq">OCA/purchase-workflow</a> project on GitHub.</p>
447452
<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>
448453
</div>
449454
</div>
450455
</div>
456+
</div>
451457
</body>
452458
</html>

purchase_no_rfq/views/view_purchase_order.xml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,25 @@
4545

4646
<!-- Change context for "Send by mail" buttons" -->
4747
<xpath
48-
expr="/form/header/button[@name='action_rfq_send']"
48+
expr="/form/header/button[@name='action_rfq_send'][@invisible=&quot;state != 'draft'&quot;]"
4949
position="attributes"
5050
>
5151
<attribute name="context">{'send_rfq':False}</attribute>
52+
<attribute name="string">Send by Email</attribute>
5253
</xpath>
53-
<!-- Rename print button from 'Print RFQ' into 'Print' -->
5454
<xpath
55-
expr="/form/header/button[@name='print_quotation']"
55+
expr="/form/header/button[@name='action_rfq_send'][@invisible=&quot;state != 'sent'&quot;]"
5656
position="attributes"
5757
>
58-
<attribute name="string">Print</attribute>
59-
</xpath>
60-
<xpath
61-
expr="/form/header/button[@name='print_quotation'][last()]"
62-
position="attributes"
63-
>
64-
<attribute name="string">Print</attribute>
65-
<attribute name="invisible">state=='draft'</attribute>
58+
<attribute name="context">{'send_rfq':False}</attribute>
59+
<attribute name="string">Send by Email</attribute>
6660
</xpath>
6761
</field>
6862
</record>
6963

7064
<!-- hide Request for quotation menu item -->
7165
<record id="purchase.menu_purchase_rfq" model="ir.ui.menu">
72-
<field name="groups_id" eval="[(4, ref('base.group_no_one'))]" />
66+
<field name="group_ids" eval="[(4, ref('base.group_no_one'))]" />
7367
<field name="sequence">999</field>
7468
</record>
7569

0 commit comments

Comments
 (0)