[IMP] Simplify inheritance of states

This commit is contained in:
mreficent
2019-08-09 20:40:47 +02:00
committed by ps-tubtim
parent e32df6daa6
commit e280239eef
2 changed files with 11 additions and 27 deletions

View File

@@ -1,24 +1,12 @@
# Copyright 2019 Open Source Integrators
# Copyright 2019 Eficent Business and IT Consulting Services, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
REQUEST_STATES = [
('draft', 'Draft'),
('submitted', 'Submitted'),
('open', 'In progress'),
('done', 'Done'),
('cancel', 'Cancelled')]
from odoo import api, models
class StockRequestOrder(models.Model):
_inherit = 'stock.request.order'
state = fields.Selection(selection=REQUEST_STATES, string='Status',
copy=False, default='draft', index=True,
readonly=True, track_visibility='onchange',
)
@api.multi
def action_submit(self):
for line in self.stock_request_ids: