[MIG] procurement_auto_create_group: Migration to 12.0

This commit is contained in:
mreficent
2019-07-03 14:21:56 +02:00
committed by davidborromeo
parent cc535f804e
commit 5c815ae3a7
12 changed files with 48 additions and 43 deletions

View File

@@ -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

View File

@@ -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
@@ -26,7 +25,7 @@ class ProcurementGroup(models.Model):
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,
}

View File

@@ -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')