mrp_production.py 824 B

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