[IMP] procurement_jit: validates sales order picking automatically
This commit is contained in:
@@ -2,3 +2,4 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import procurement_jit
|
||||
import sale
|
||||
|
||||
@@ -21,7 +21,7 @@ as possible and the scheduler time range is not taken into account anymore.
|
||||
In that case, you can not use priorities any more on the different picking.
|
||||
""",
|
||||
'website': 'https://www.odoo.com/page/manufacturing',
|
||||
'depends': ['procurement', 'stock'],
|
||||
'depends': ['sale_stock'],
|
||||
'data': [],
|
||||
'demo': [],
|
||||
'test': ['test/procurement_jit.yml'],
|
||||
|
||||
@@ -21,12 +21,3 @@ class procurement_order(osv.osv):
|
||||
return result
|
||||
return res
|
||||
|
||||
# TODO FP: This code should be uncommented to assign delivery orders directly
|
||||
# Vut there is code to fix in stock.py before, to not have purchase tests that fails
|
||||
# class stock_move(osv.osv):
|
||||
# _inherit = "stock.move"
|
||||
#
|
||||
# def action_confirm(self, cr, uid, ids, context=None):
|
||||
# res = super(stock_move, self).action_confirm(cr, uid, ids, context=context or {})
|
||||
# super(stock_move, self).action_assign(cr, uid, ids, context=context or {})
|
||||
# return res
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from openerp import api, fields, models, _
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
_inherit = "sale.order"
|
||||
|
||||
@api.multi
|
||||
def action_confirm(self):
|
||||
res = super(SaleOrder, self).action_confirm()
|
||||
for order in self:
|
||||
for pick in order.picking_ids:
|
||||
print pick.state
|
||||
order.picking_ids.filtered(lambda x: x.state=='confirmed').action_assign()
|
||||
return res
|
||||
|
||||
@@ -86,7 +86,6 @@ class SaleOrder(models.Model):
|
||||
res.update({'move_type': self.picking_policy, 'partner_id': self.partner_shipping_id.id})
|
||||
return res
|
||||
|
||||
|
||||
class SaleOrderLine(models.Model):
|
||||
_inherit = 'sale.order.line'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user