Skip to content

Commit 59ef569

Browse files
committed
[14.0][MIG] purchase_request_operating_unit
1 parent 3c6a430 commit 59ef569

File tree

8 files changed

+34
-15
lines changed

8 files changed

+34
-15
lines changed

oca_dependencies.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# See https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#oca_dependencies-txt
2+
purchase-workflow

purchase_request_operating_unit/README.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Operating Unit in Purchase Requests
1414
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1515
:alt: License: LGPL-3
1616
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github
17-
:target: https://github.com/OCA/operating-unit/tree/12.0/purchase_request_operating_unit
17+
:target: https://github.com/OCA/operating-unit/tree/14.0/purchase_request_operating_unit
1818
:alt: OCA/operating-unit
1919
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20-
:target: https://translation.odoo-community.org/projects/operating-unit-12-0/operating-unit-12-0-purchase_request_operating_unit
20+
:target: https://translation.odoo-community.org/projects/operating-unit-14-0/operating-unit-14-0-purchase_request_operating_unit
2121
:alt: Translate me on Weblate
2222
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/213/12.0
23+
:target: https://runbot.odoo-community.org/runbot/213/14.0
2424
:alt: Try me on Runbot
2525

2626
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -57,7 +57,7 @@ Bug Tracker
5757
Bugs are tracked on `GitHub Issues <https://github.com/OCA/operating-unit/issues>`_.
5858
In case of trouble, please check there if your issue has already been reported.
5959
If you spotted it first, help us smashing it by providing a detailed and welcomed
60-
`feedback <https://github.com/OCA/operating-unit/issues/new?body=module:%20purchase_request_operating_unit%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
60+
`feedback <https://github.com/OCA/operating-unit/issues/new?body=module:%20purchase_request_operating_unit%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6161

6262
Do not contact contributors directly about support or help with technical issues.
6363

@@ -75,6 +75,7 @@ Contributors
7575

7676
* Jordi Ballester Alomar <[email protected]>
7777
* Serpent Consulting Services Pvt. Ltd. <[email protected]>
78+
* Saran Lim. <[email protected]>
7879

7980
Maintainers
8081
~~~~~~~~~~~
@@ -89,6 +90,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
8990
mission is to support the collaborative development of Odoo features and
9091
promote its widespread use.
9192

92-
This module is part of the `OCA/operating-unit <https://github.com/OCA/operating-unit/tree/12.0/purchase_request_operating_unit>`_ project on GitHub.
93+
This module is part of the `OCA/operating-unit <https://github.com/OCA/operating-unit/tree/14.0/purchase_request_operating_unit>`_ project on GitHub.
9394

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

purchase_request_operating_unit/__manifest__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
{
88
"name": "Operating Unit in Purchase Requests",
9-
"version": "13.0.1.0.0",
9+
"version": "14.0.1.0.0",
1010
"author": "Eficent, SerpentCS, Odoo Community Association (OCA)",
11-
"website": "https://www.github.com/OCA/operating-unit",
11+
"website": "https://github.com/OCA/operating-unit",
1212
"license": "LGPL-3",
1313
"category": "Purchase Management",
1414
"depends": ["purchase_request", "purchase_operating_unit"],

purchase_request_operating_unit/static/description/index.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ <h1 class="title">Operating Unit in Purchase Requests</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370-
<p><a class="reference external" 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" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/operating-unit/tree/12.0/purchase_request_operating_unit"><img alt="OCA/operating-unit" src="https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/operating-unit-12-0/operating-unit-12-0-purchase_request_operating_unit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/213/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
370+
<p><a class="reference external" 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" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/operating-unit/tree/14.0/purchase_request_operating_unit"><img alt="OCA/operating-unit" src="https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/operating-unit-14-0/operating-unit-14-0-purchase_request_operating_unit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/213/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
371371
<p>This module introduces the following features:</p>
372372
<ul class="simple">
373373
<li>Adds the Operating Unit (OU) to the Purchase Request.</li>
@@ -405,7 +405,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
405405
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/operating-unit/issues">GitHub Issues</a>.
406406
In case of trouble, please check there if your issue has already been reported.
407407
If you spotted it first, help us smashing it by providing a detailed and welcomed
408-
<a class="reference external" href="https://github.com/OCA/operating-unit/issues/new?body=module:%20purchase_request_operating_unit%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
408+
<a class="reference external" href="https://github.com/OCA/operating-unit/issues/new?body=module:%20purchase_request_operating_unit%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
409409
<p>Do not contact contributors directly about support or help with technical issues.</p>
410410
</div>
411411
<div class="section" id="credits">
@@ -422,6 +422,7 @@ <h2><a class="toc-backref" href="#id5">Contributors</a></h2>
422422
<ul class="simple">
423423
<li>Jordi Ballester Alomar &lt;<a class="reference external" href="mailto:jordi.ballester&#64;eficent.com">jordi.ballester&#64;eficent.com</a>&gt;</li>
424424
<li>Serpent Consulting Services Pvt. Ltd. &lt;<a class="reference external" href="mailto:support&#64;serpentcs.com">support&#64;serpentcs.com</a>&gt;</li>
425+
<li>Saran Lim. &lt;<a class="reference external" href="mailto:saranl&#64;ecosoft.co.th">saranl&#64;ecosoft.co.th</a>&gt;</li>
425426
</ul>
426427
</div>
427428
<div class="section" id="maintainers">
@@ -431,7 +432,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
431432
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
432433
mission is to support the collaborative development of Odoo features and
433434
promote its widespread use.</p>
434-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/operating-unit/tree/12.0/purchase_request_operating_unit">OCA/operating-unit</a> project on GitHub.</p>
435+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/operating-unit/tree/14.0/purchase_request_operating_unit">OCA/operating-unit</a> project on GitHub.</p>
435436
<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>
436437
</div>
437438
</div>

purchase_request_operating_unit/tests/test_purchase_request_to_rfq_operating_unit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# (<http://www.serpentcs.com>)
55
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
66

7+
from odoo import SUPERUSER_ID
78
from odoo.tests import common
8-
from odoo.tools import SUPERUSER_ID
99

1010

1111
class TestPurchaseRequestToRfq(common.TransactionCase):

purchase_request_operating_unit/wizard/purchase_request_line_make_purchase_order.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,25 @@ class PurchaseRequestLineMakePurchaseOrder(models.TransientModel):
1212
_inherit = "purchase.request.line.make.purchase.order"
1313

1414
operating_unit_id = fields.Many2one(
15-
"operating.unit", string="Operating Unit", readonly=True,
15+
"operating.unit",
16+
string="Operating Unit",
17+
readonly=True,
1618
)
1719

1820
@api.model
1921
def default_get(self, fields):
2022
res = super().default_get(fields)
21-
request_line_obj = self.env["purchase.request.line"]
22-
request_line_ids = self._context.get("active_ids", [])
2323
operating_unit_id = False
24-
for line in request_line_obj.browse(request_line_ids):
24+
active_model = self.env.context.get("active_model", False)
25+
active_ids = self.env.context.get("active_ids", False)
26+
_model = {
27+
"purchase.request.line": "",
28+
"purchase.request": "line_ids",
29+
}
30+
request_lines = (
31+
self.env[active_model].browse(active_ids).mapped(_model[active_model])
32+
)
33+
for line in request_lines:
2534
line_operating_unit_id = (
2635
line.request_id.operating_unit_id
2736
and line.request_id.operating_unit_id.id
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../purchase_request_operating_unit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)