mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[ADD] mrp_auto_assign
This commit is contained in:
committed by
JordiMForgeFlow
parent
84e7b239e4
commit
31365cb1b1
6
mrp_auto_assign/models/__init__.py
Normal file
6
mrp_auto_assign/models/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2017 Akretion (http://www.akretion.com). All Rights Reserved
|
||||
# @author Florian DA COSTA <florian.dacosta@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import mrp_production
|
||||
19
mrp_auto_assign/models/mrp_production.py
Normal file
19
mrp_auto_assign/models/mrp_production.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2017 Akretion (http://www.akretion.com). All Rights Reserved
|
||||
# @author Florian DA COSTA <florian.dacosta@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models
|
||||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MrpProduction(models.Model):
|
||||
_inherit = 'mrp.production'
|
||||
|
||||
@api.model
|
||||
def create(self, values):
|
||||
production = super(MrpProduction, self).create(values)
|
||||
if production.availability != 'none':
|
||||
production.action_assign()
|
||||
return production
|
||||
Reference in New Issue
Block a user