Skip to content

Commit

Permalink
[MIG] procurement_auto_create_group: Migration to 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelRForgeFlow committed Jul 4, 2019
1 parent 43fcd95 commit a0e10a6
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 29 deletions.
10 changes: 5 additions & 5 deletions procurement_auto_create_group/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Procurement Auto Create Group
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-warehouse/tree/11.0/procurement_auto_create_group
:target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/procurement_auto_create_group
:alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-procurement_auto_create_group
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-procurement_auto_create_group
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/153/11.0
:target: https://runbot.odoo-community.org/runbot/153/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -66,7 +66,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/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/stock-logistics-warehouse/issues/new?body=module:%20procurement_auto_create_group%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20procurement_auto_create_group%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 Down Expand Up @@ -97,6 +97,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/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/11.0/procurement_auto_create_group>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/procurement_auto_create_group>`_ project on GitHub.

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

from . import models
4 changes: 2 additions & 2 deletions procurement_auto_create_group/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Procurement Auto Create Group",
"version": "11.0.1.0.0",
"version": "12.0.1.0.0",
"development_status": "Production/Stable",
"license": "AGPL-3",
"summary": "Allows to configure the system to propose automatically new "
Expand Down
4 changes: 3 additions & 1 deletion procurement_auto_create_group/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from . import procurement_rule
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import stock_rule
from . import procurement_group
7 changes: 3 additions & 4 deletions procurement_auto_create_group/models/procurement_group.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import api, models, _
from odoo.exceptions import UserError
Expand All @@ -26,7 +25,7 @@ def _prepare_auto_procurement_group_data(self):
name = self.env['ir.sequence'].next_by_code(
'procurement.group') or False
if not name:
raise UserError(_('No sequence defined for procurement group'))
raise UserError(_('No sequence defined for procurement group.'))
return {
'name': name
'name': name,
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models


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

auto_create_group = fields.Boolean(string='Auto-create Procurement Group')

Expand Down
6 changes: 3 additions & 3 deletions procurement_auto_create_group/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Procurement Auto Create Group</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="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/stock-logistics-warehouse/tree/11.0/procurement_auto_create_group"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-procurement_auto_create_group"><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/153/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="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/stock-logistics-warehouse/tree/12.0/procurement_auto_create_group"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-procurement_auto_create_group"><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/153/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 the system to propose automatically new procurement groups
when procuring.</p>
<p>This capability is important when you want to make sure that all the stock
Expand Down Expand Up @@ -416,7 +416,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/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/stock-logistics-warehouse/issues/new?body=module:%20procurement_auto_create_group%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/stock-logistics-warehouse/issues/new?body=module:%20procurement_auto_create_group%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 @@ -441,7 +441,7 @@ <h2><a class="toc-backref" href="#id7">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/stock-logistics-warehouse/tree/11.0/procurement_auto_create_group">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/procurement_auto_create_group">OCA/stock-logistics-warehouse</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: 2 additions & 0 deletions procurement_auto_create_group/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import test_auto_create
13 changes: 7 additions & 6 deletions procurement_auto_create_group/tests/test_auto_create.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# © 2017 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo.tests.common import TransactionCase


class TestProcurementAutoCreateGroup(TransactionCase):
def setUp(self, *args, **kwargs):
super(TestProcurementAutoCreateGroup, self).setUp(*args, **kwargs)

def setUp(self):
super(TestProcurementAutoCreateGroup, self).setUp()
self.group_obj = self.env['procurement.group']
self.rule_obj = self.env['procurement.rule']
self.rule_obj = self.env['stock.rule']
self.route_obj = self.env['stock.location.route']
self.move_obj = self.env['stock.move']
self.product_obj = self.env['product.product']
Expand Down Expand Up @@ -87,7 +88,7 @@ def test_02_auto_create_group(self):
self.assertTrue(move.group_id, "Procurement Group not assigned.")

def test_03_onchange_method(self):
"""Test onchange method for procurement rule."""
"""Test onchange method for stock rule."""
proc_rule = self.rule_1
self.assertTrue(proc_rule.auto_create_group)
proc_rule.write({'group_propagation_option': 'none'})
Expand Down
8 changes: 4 additions & 4 deletions procurement_auto_create_group/views/procurement_view.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record model="ir.ui.view" id="view_procurement_rule_form">
<field name="name">procurement.rule.form - procurement_auto_create_group</field>
<field name="model">procurement.rule</field>
<field name="inherit_id" ref="stock.view_procurement_rule_form"/>
<record model="ir.ui.view" id="view_stock_rule_form">
<field name="name">stock.rule.form - procurement_auto_create_group</field>
<field name="model">stock.rule</field>
<field name="inherit_id" ref="stock.view_stock_rule_form"/>
<field name="arch" type="xml">
<field name="group_propagation_option" position="after">
<field name="auto_create_group"
Expand Down

0 comments on commit a0e10a6

Please sign in to comment.