Skip to content

Commit ea36513

Browse files
committed
[MIG] purchase_allowed_product: Migration to 19.0
1 parent 8509a15 commit ea36513

File tree

5 files changed

+18
-24
lines changed

5 files changed

+18
-24
lines changed

purchase_allowed_product/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Purchase and Invoice Allowed Product
2121
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2222
:alt: License: AGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
24-
:target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_allowed_product
24+
:target: https://github.com/OCA/purchase-workflow/tree/19.0/purchase_allowed_product
2525
:alt: OCA/purchase-workflow
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_allowed_product
27+
:target: https://translation.odoo-community.org/projects/purchase-workflow-19-0/purchase-workflow-19-0-purchase_allowed_product
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
: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
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -52,7 +52,7 @@ Bug Tracker
5252
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
5353
In case of trouble, please check there if your issue has already been reported.
5454
If you spotted it first, help us to smash it by providing a detailed and welcomed
55-
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_allowed_product%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
55+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_allowed_product%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5656

5757
Do not contact contributors directly about support or help with technical issues.
5858

@@ -95,6 +95,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
9595
mission is to support the collaborative development of Odoo features and
9696
promote its widespread use.
9797

98-
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_allowed_product>`_ project on GitHub.
98+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/19.0/purchase_allowed_product>`_ project on GitHub.
9999

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

purchase_allowed_product/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "Purchase and Invoice Allowed Product",
77
"summary": "This module allows to select only products that can be "
88
"supplied by the vendor",
9-
"version": "18.0.1.0.0",
9+
"version": "19.0.1.0.0",
1010
"category": "Accounting & Finance",
1111
"website": "https://github.com/OCA/purchase-workflow",
1212
"author": "Akretion, Odoo Community Association (OCA)",

purchase_allowed_product/models/product.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@
33
# Copyright 2020 Tecnativa - Pedro M. Baeza
44
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
55

6-
from odoo import api, models
6+
from odoo import api, fields, models
77

88

99
class ProductProduct(models.Model):
1010
_inherit = "product.product"
1111

1212
@api.model
13-
def _search(
14-
self,
15-
domain,
16-
offset=0,
17-
limit=None,
18-
order=None,
19-
):
13+
def _search(self, domain, *args, **kwargs):
2014
if self.env.context.get("use_only_supplied_product"):
2115
restrict_supplier_id = self.env.context.get("restrict_supplier_id")
2216
seller = (
@@ -27,14 +21,12 @@ def _search(
2721
supplierinfos = self.env["product.supplierinfo"].search(
2822
[("partner_id", "=", seller.id)]
2923
)
30-
domain += [
24+
extra_domain = [
3125
"|",
3226
("product_tmpl_id", "in", supplierinfos.product_tmpl_id.ids),
3327
("id", "in", supplierinfos.product_id.ids),
3428
]
35-
return super()._search(
36-
domain,
37-
offset=offset,
38-
limit=limit,
39-
order=order,
40-
)
29+
30+
domain = fields.Domain.AND([domain, extra_domain])
31+
32+
return super()._search(domain, *args, **kwargs)

purchase_allowed_product/static/description/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>Purchase and Invoice Allowed Product</h1>
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375375
!! source digest: sha256:eb1b9dbaa74e94be393c30f67b80add2d636d716a513727c65216e10fe1b6cc1
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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/18.0/purchase_allowed_product"><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_allowed_product"><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_allowed_product"><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_allowed_product"><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>
378378
<p>This module adds a restriction in purchase and supplier invoices that
379379
has the mark “Order and invoice only supplied products” checked for
380380
allowing to select only products that can be supplied by the defined
@@ -399,7 +399,7 @@ <h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
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 to smash it by providing a detailed and welcomed
402-
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_allowed_product%0Aversion:%2018.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_allowed_product%0Aversion:%2019.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">
@@ -438,7 +438,7 @@ <h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
438438
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
439439
mission is to support the collaborative development of Odoo features and
440440
promote its widespread use.</p>
441-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/18.0/purchase_allowed_product">OCA/purchase-workflow</a> project on GitHub.</p>
441+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/19.0/purchase_allowed_product">OCA/purchase-workflow</a> project on GitHub.</p>
442442
<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>
443443
</div>
444444
</div>

purchase_allowed_product/tests/test_purchase_allowed_product.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55

66
from odoo.tests import Form
7+
from odoo.tests.common import tagged
78

89
from odoo.addons.base.tests.common import BaseCommon
910

1011

12+
@tagged("post_install", "-at_install")
1113
class TestPurchaseAllowedProduct(BaseCommon):
1214
@classmethod
1315
def setUpClass(cls):

0 commit comments

Comments
 (0)