Merge branch 'feature/工单状态优化' into feature/库存优化
This commit is contained in:
@@ -931,13 +931,6 @@ class SfStockMoveLine(models.Model):
|
||||
if not record.destination_location_id.product_id:
|
||||
record.destination_location_id.product_id = record.product_id.id
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
|
||||
records = super(SfStockMoveLine, self).create(vals_list)
|
||||
self.put_shelf_location(records)
|
||||
return records
|
||||
|
||||
|
||||
class SfStockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
@@ -1122,6 +1115,12 @@ class SfPickingType(models.Model):
|
||||
'sf_warehouse.group_sf_stock_manager'
|
||||
)
|
||||
|
||||
def _get_action(self, action_xmlid):
|
||||
action = super(SfPickingType, self)._get_action(action_xmlid)
|
||||
if not self.env.user.has_group('base.group_system'):
|
||||
action['context']['create'] = False
|
||||
return action
|
||||
|
||||
|
||||
class CustomStockMove(models.Model):
|
||||
_name = 'stock.move'
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
<record model="ir.actions.act_window" id="stock.stock_picking_type_action">
|
||||
<field name="context">{'search_default_groupby_code':1}</field>
|
||||
<field name="domain">[('name', '!=', '制造')]</field>
|
||||
</record>
|
||||
|
||||
<record id="view_location_form_sf_inherit" model="ir.ui.view">
|
||||
|
||||
@@ -77,18 +77,20 @@ class ShelfLocationWizard(models.TransientModel):
|
||||
|
||||
def confirm_the_change(self):
|
||||
if self.destination_barcode_id:
|
||||
stocks = []
|
||||
if self.lot_id:
|
||||
self.current_barcode_id.product_sn_id = False
|
||||
self.destination_barcode_id.product_sn_id = self.lot_id.id
|
||||
self.create_stock_moves(self.lot_id, 1)
|
||||
stocks = self.create_stock_moves(self.lot_id, 1)
|
||||
elif self.current_product_sn_ids:
|
||||
for current_product_sn_id in self.current_product_sn_ids:
|
||||
self.create_stock_moves(current_product_sn_id.lot_id, current_product_sn_id.qty_num)
|
||||
stocks = self.create_stock_moves(current_product_sn_id.lot_id, current_product_sn_id.qty_num)
|
||||
current_product_sn_id.write({
|
||||
'qty_num': 0
|
||||
})
|
||||
else:
|
||||
raise ValidationError('没有需要变更的批次/序列号!')
|
||||
self.env['stock.move.line'].sudo().put_shelf_location(stocks[-1])
|
||||
else:
|
||||
raise ValidationError('请选择目标货位编码!')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user