查询源位置的条件=改为ilike
This commit is contained in:
@@ -366,10 +366,10 @@ class StockPicking(models.Model):
|
|||||||
# 设置外协出入单的名称
|
# 设置外协出入单的名称
|
||||||
def _get_name_Res(self, rescode):
|
def _get_name_Res(self, rescode):
|
||||||
last_picking = self.sudo().search([('name', 'like', rescode)], order='create_date DESC', limit=1)
|
last_picking = self.sudo().search([('name', 'like', rescode)], order='create_date DESC', limit=1)
|
||||||
logging.info('编号:' + last_picking.name)
|
|
||||||
if not last_picking:
|
if not last_picking:
|
||||||
num = "%04d" % 1
|
num = "%04d" % 1
|
||||||
else:
|
else:
|
||||||
|
logging.info('编号:' + last_picking.name)
|
||||||
m = int(last_picking.name[-3:]) + 1
|
m = int(last_picking.name[-3:]) + 1
|
||||||
num = "%04d" % m
|
num = "%04d" % m
|
||||||
return '%s%s' % (rescode, num)
|
return '%s%s' % (rescode, num)
|
||||||
@@ -419,7 +419,7 @@ class StockPicking(models.Model):
|
|||||||
location_id = self.env.ref(
|
location_id = self.env.ref(
|
||||||
'sf_manufacturing.stock_location_locations_virtual_outcontract').id,
|
'sf_manufacturing.stock_location_locations_virtual_outcontract').id,
|
||||||
location_dest_id = self.env['stock.location'].search(
|
location_dest_id = self.env['stock.location'].search(
|
||||||
[('barcode', '=', 'WH-PREPRODUCTION')]).id,
|
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id,
|
||||||
outcontract_picking_type_in = self.env.ref(
|
outcontract_picking_type_in = self.env.ref(
|
||||||
'sf_manufacturing.outcontract_picking_in').id,
|
'sf_manufacturing.outcontract_picking_in').id,
|
||||||
outcontract_picking_type_out = self.env.ref(
|
outcontract_picking_type_out = self.env.ref(
|
||||||
|
|||||||
Reference in New Issue
Block a user