# -*- coding: utf-8 -*- # import openerp.addons.decimal_precision as dp from openerp.exceptions import except_orm, Warning, RedirectWarning from openerp import models, fields, api, _ from openerp.tools.translate import _ from openerp import SUPERUSER_ID, api import openerp.addons.decimal_precision as dp class mrp_production(models.Model): _inherit = 'mrp.production' move_lines = fields.One2many( readonly=False, states={'done': [('readonly', True)]} ) @api.multi def write(self, vals ): res = super(mrp_production, self).write( vals ) for move in self.move_lines: if move.state == 'draft': # se de facut o copie a miscarii si trecuta miscarea la la productie la productie move.action_confirm() return res