Skip to content

Commit

Permalink
[MIG] procurement_purchase_no_grouping: Migration to 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tardo committed Jun 17, 2019
1 parent 48479c9 commit f5a9779
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 23 deletions.
11 changes: 6 additions & 5 deletions procurement_purchase_no_grouping/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Procurement Purchase No Grouping
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/11.0/procurement_purchase_no_grouping
:target: https://github.com/OCA/purchase-workflow/tree/12.0/procurement_purchase_no_grouping
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-11-0/purchase-workflow-11-0-procurement_purchase_no_grouping
:target: https://translation.odoo-community.org/projects/purchase-workflow-12-0/purchase-workflow-12-0-procurement_purchase_no_grouping
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/142/11.0
:target: https://runbot.odoo-community.org/runbot/142/12.0
:alt: Try me on Runbot

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

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

Expand All @@ -72,6 +72,7 @@ Contributors
* Pedro M. Baeza
* Sergio Teruel
* Carlos Dauden
* Alexandre Díaz

* Ana Juaristi <ajuaristo@gmail.com>
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es>
Expand All @@ -89,6 +90,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/11.0/procurement_purchase_no_grouping>`_ project on GitHub.
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/12.0/procurement_purchase_no_grouping>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 0 additions & 2 deletions procurement_purchase_no_grouping/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from . import models
4 changes: 2 additions & 2 deletions procurement_purchase_no_grouping/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

{
'name': 'Procurement Purchase No Grouping',
'version': '11.0.1.0.0',
'version': '12.0.1.0.0',
'author': 'AvanzOSC,'
'Tecnativa,'
'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/purchase-workflow',
'category': 'Procurements',
'depends': [
'purchase',
'purchase_stock',
],
'data': [
'views/product_category_view.xml',
Expand Down
4 changes: 1 addition & 3 deletions procurement_purchase_no_grouping/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from . import product_category
from . import procurement_rule
from . import stock_rule
from . import purchase_order
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from odoo import api, models


class ProcurementRule(models.Model):
_inherit = 'procurement.rule'
class StockRule(models.Model):
_inherit = 'stock.rule'

@api.multi
def _run_buy(self, product_id, product_qty, product_uom, location_id,
name, origin, values):
grouping = product_id.categ_id.procured_purchase_grouping
self_wc = self.with_context(grouping=grouping)
return super(ProcurementRule, self_wc)._run_buy(
return super(StockRule, self_wc)._run_buy(
product_id, product_qty, product_uom, location_id, name,
origin, values)

Expand Down
1 change: 1 addition & 0 deletions procurement_purchase_no_grouping/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Pedro M. Baeza
* Sergio Teruel
* Carlos Dauden
* Alexandre Díaz

* Ana Juaristi <ajuaristo@gmail.com>
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es>
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Procurement Purchase No Grouping</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/11.0/procurement_purchase_no_grouping"><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-11-0/purchase-workflow-11-0-procurement_purchase_no_grouping"><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/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<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/12.0/procurement_purchase_no_grouping"><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-12-0/purchase-workflow-12-0-procurement_purchase_no_grouping"><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/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows to not group generated purchase orders from procurements.
The grouping behaviour can be configurable at product category level.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -400,7 +400,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20procurement_purchase_no_grouping%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20procurement_purchase_no_grouping%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -419,6 +419,7 @@ <h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<li>Pedro M. Baeza</li>
<li>Sergio Teruel</li>
<li>Carlos Dauden</li>
<li>Alexandre Díaz</li>
</ul>
</li>
<li>Ana Juaristi &lt;<a class="reference external" href="mailto:ajuaristo&#64;gmail.com">ajuaristo&#64;gmail.com</a>&gt;</li>
Expand All @@ -432,7 +433,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/11.0/procurement_purchase_no_grouping">OCA/purchase-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/12.0/procurement_purchase_no_grouping">OCA/purchase-workflow</a> project on GitHub.</p>
<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>
</div>
</div>
Expand Down
2 changes: 0 additions & 2 deletions procurement_purchase_no_grouping/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from . import test_procurement_purchase_no_grouping
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ def setUpClass(cls):
cls.location = cls.env.ref('stock.stock_location_stock')
cls.picking_type = cls.env.ref('stock.picking_type_in')
cls.origin = 'Test procurement_purchase_no_grouping'
cls.stock_location_route = cls.env.ref('purchase.route_warehouse0_buy')
cls.procurement_rule = cls.stock_location_route.pull_ids[0]
cls.stock_location_route = cls.env.ref(
'purchase_stock.route_warehouse0_buy')
cls.stock_rule = cls.stock_location_route.rule_ids[0]
cls.values = {
# FIXME: Core doesn't find correctly supplier if not recordset
'company_id': cls.env.user.company_id,
'date_planned': fields.Datetime.now(),
}

def _run_procurement(self):
self.procurement_rule._run_buy(
self.stock_rule._run_buy(
self.product, 1, self.product.uom_id, self.location, False,
self.origin, self.values,
)
Expand Down

0 comments on commit f5a9779

Please sign in to comment.