auto_create_group should be false when group_propagation_option is not 'propagate'

This commit is contained in:
Jordi Ballester
2017-06-21 10:19:22 +02:00
committed by Laurent Mignon (ACSONE)
parent ecbaac78ae
commit af77b6ceff

View File

@@ -1,10 +1,15 @@
# -*- 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).
from openerp import fields, models
from openerp import api, fields, models
class ProcurementRule(models.Model):
_inherit = 'procurement.rule'
auto_create_group = fields.Boolean(string='Auto-create Procurement Group')
@api.onchange('group_propagation_option')
def _onchange_group_propagation_option(self):
if self.group_propagation_option != 'propagate':
self.auto_create_group = False