Skip to content

Commit 0c7aa1e

Browse files
BT-mgomezdalonsod
authored andcommitted
[15.0][MIG] purchase_order_secondary_unit: Migration to 15.0
1 parent 86daa6d commit 0c7aa1e

File tree

5 files changed

+33
-17
lines changed

5 files changed

+33
-17
lines changed

purchase_order_secondary_unit/README.rst

+12-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ Purchase Order Secondary Unit
1414
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1515
:alt: License: AGPL-3
1616
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
17-
:target: https://github.com/OCA/purchase-workflow/tree/14.0/purchase_order_secondary_unit
17+
:target: https://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_secondary_unit
1818
:alt: OCA/purchase-workflow
1919
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20-
:target: https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_order_secondary_unit
20+
:target: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_order_secondary_unit
2121
:alt: Translate me on Weblate
22-
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/142/14.0
24-
:alt: Try me on Runbot
22+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
23+
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/purchase-workflow&target_branch=15.0
24+
:alt: Try me on Runboat
2525

2626
|badge1| |badge2| |badge3| |badge4| |badge5|
2727

@@ -50,7 +50,7 @@ Bug Tracker
5050
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
5151
In case of trouble, please check there if your issue has already been reported.
5252
If you spotted it first, help us smashing it by providing a detailed and welcomed
53-
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_secondary_unit%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
53+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_secondary_unit%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5454

5555
Do not contact contributors directly about support or help with technical issues.
5656

@@ -65,9 +65,13 @@ Authors
6565
Contributors
6666
~~~~~~~~~~~~
6767

68-
* Sergio Teruel <[email protected]>
68+
* `Tecnativa <https://www.tecnativa.com>`_:
69+
70+
* Sergio Teruel
71+
* Ernesto Tejeda
6972
* Nikul Chaudhary <[email protected]>
7073
* Pimolnat Suntian <[email protected]>
74+
* Miguel Ángel Gómez <[email protected]>
7175

7276
Maintainers
7377
~~~~~~~~~~~
@@ -82,6 +86,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
8286
mission is to support the collaborative development of Odoo features and
8387
promote its widespread use.
8488

85-
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/14.0/purchase_order_secondary_unit>`_ project on GitHub.
89+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_secondary_unit>`_ project on GitHub.
8690

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

purchase_order_secondary_unit/models/purchase_order.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ def onchange_product_id(self):
3333
purpose.
3434
"""
3535
res = super().onchange_product_id()
36-
self.secondary_uom_id = self.product_id.purchase_secondary_uom_id
36+
# Check to avoid executing onchange unnecessarily,
37+
# which can sometimes cause tests of other modules to fail
38+
if self.secondary_uom_id != self.product_id.purchase_secondary_uom_id:
39+
self.secondary_uom_id = self.product_id.purchase_secondary_uom_id
3740
if self.secondary_uom_id:
3841
self.secondary_uom_qty = 1.0
3942
return res
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
* Sergio Teruel <[email protected]>
1+
* `Tecnativa <https://www.tecnativa.com>`_:
2+
3+
* Sergio Teruel
4+
* Ernesto Tejeda
25
* Nikul Chaudhary <[email protected]>
36
* Pimolnat Suntian <[email protected]>
7+
* Miguel Ángel Gómez <[email protected]>

purchase_order_secondary_unit/static/description/index.html

+10-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6-
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
6+
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
77
<title>Purchase Order Secondary Unit</title>
88
<style type="text/css">
99

@@ -367,7 +367,7 @@ <h1 class="title">Purchase Order Secondary Unit</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/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" href="https://github.com/OCA/purchase-workflow/tree/14.0/purchase_order_secondary_unit"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_order_secondary_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/142/14.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/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" href="https://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_secondary_unit"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_order_secondary_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://runboat.odoo-community.org/webui/builds.html?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>
371371
<p>This module extends the functionality of purchase orders to allow buy products
372372
in secondary unit of distinct category.</p>
373373
<p><strong>Table of contents</strong></p>
@@ -399,7 +399,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
399399
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
400400
In case of trouble, please check there if your issue has already been reported.
401401
If you spotted it first, help us smashing it by providing a detailed and welcomed
402-
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_secondary_unit%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
402+
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_secondary_unit%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
403403
<p>Do not contact contributors directly about support or help with technical issues.</p>
404404
</div>
405405
<div class="section" id="credits">
@@ -413,9 +413,14 @@ <h2><a class="toc-backref" href="#id4">Authors</a></h2>
413413
<div class="section" id="contributors">
414414
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
415415
<ul class="simple">
416-
<li>Sergio Teruel &lt;<a class="reference external" href="mailto:sergio.teruel&#64;tecnativa.com">sergio.teruel&#64;tecnativa.com</a>&gt;</li>
416+
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
417+
<li>Sergio Teruel</li>
418+
<li>Ernesto Tejeda</li>
419+
</ul>
420+
</li>
417421
<li>Nikul Chaudhary &lt;<a class="reference external" href="mailto:nikulchaudhary2112&#64;gmail.com">nikulchaudhary2112&#64;gmail.com</a>&gt;</li>
418422
<li>Pimolnat Suntian &lt;<a class="reference external" href="mailto:pimolnats&#64;ecosoft.co.th">pimolnats&#64;ecosoft.co.th</a>&gt;</li>
423+
<li>Miguel Ángel Gómez &lt;<a class="reference external" href="mailto:miguel.gomez&#64;braintec.com">miguel.gomez&#64;braintec.com</a>&gt;</li>
419424
</ul>
420425
</div>
421426
<div class="section" id="maintainers">
@@ -425,7 +430,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
425430
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
426431
mission is to support the collaborative development of Odoo features and
427432
promote its widespread use.</p>
428-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/14.0/purchase_order_secondary_unit">OCA/purchase-workflow</a> project on GitHub.</p>
433+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_secondary_unit">OCA/purchase-workflow</a> project on GitHub.</p>
429434
<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>
430435
</div>
431436
</div>

purchase_order_secondary_unit/tests/test_purchase_order_secondary_unit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Copyright 2018 Tecnativa - Sergio Teruel
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33
from odoo import fields
4-
from odoo.tests.common import Form, SavepointCase, tagged
4+
from odoo.tests.common import Form, TransactionCase, tagged
55

66

77
@tagged("-at_install", "post_install")
8-
class TestPurchaseOrderSecondaryUnit(SavepointCase):
8+
class TestPurchaseOrderSecondaryUnit(TransactionCase):
99
@classmethod
1010
def setUpClass(cls):
1111
super().setUpClass()

0 commit comments

Comments
 (0)