库存处增加批量调拨功能
This commit is contained in:
@@ -67,9 +67,10 @@ class JdEclp(models.Model):
|
|||||||
"""
|
"""
|
||||||
判断是否为出库单
|
判断是否为出库单
|
||||||
"""
|
"""
|
||||||
if self.name:
|
for record in self:
|
||||||
is_check_out = self.name.split('/')
|
if record.name:
|
||||||
self.check_out = is_check_out[1]
|
is_check_out = record.name.split('/')
|
||||||
|
record.check_out = is_check_out[1]
|
||||||
|
|
||||||
@api.depends('carrier_tracking_ref')
|
@api.depends('carrier_tracking_ref')
|
||||||
def query_bill_pdf(self):
|
def query_bill_pdf(self):
|
||||||
|
|||||||
@@ -859,14 +859,36 @@ class SfStockPicking(models.Model):
|
|||||||
|
|
||||||
check_in = fields.Char(string='查询是否为入库单', compute='_check_is_in')
|
check_in = fields.Char(string='查询是否为入库单', compute='_check_is_in')
|
||||||
|
|
||||||
|
def batch_stock_move(self):
|
||||||
|
"""
|
||||||
|
批量调拨,非就绪状态的会被忽略,完成后有通知提示
|
||||||
|
"""
|
||||||
|
for record in self:
|
||||||
|
if record.state != 'assigned':
|
||||||
|
continue
|
||||||
|
record.action_set_quantities_to_reservation()
|
||||||
|
record.button_validate()
|
||||||
|
|
||||||
|
notification_message = '批量调拨完成!请注意,状态非就绪的单据会被忽略'
|
||||||
|
return {
|
||||||
|
'effect': {
|
||||||
|
'fadeout': 'fast',
|
||||||
|
'message': notification_message,
|
||||||
|
'img_url': '/web/image/%s/%s/image_1024' % (
|
||||||
|
self.create_uid._name, self.create_uid.id) if 0 else '/web/static/img/smile.svg',
|
||||||
|
'type': 'rainbow_man',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@api.depends('name')
|
@api.depends('name')
|
||||||
def _check_is_in(self):
|
def _check_is_in(self):
|
||||||
"""
|
"""
|
||||||
判断是否为出库单
|
判断是否为出库单
|
||||||
"""
|
"""
|
||||||
if self.name:
|
for record in self:
|
||||||
is_check_in = self.name.split('/')
|
if record.name:
|
||||||
self.check_in = is_check_in[1]
|
is_check_in = record.name.split('/')
|
||||||
|
record.check_in = is_check_in[1]
|
||||||
|
|
||||||
def button_validate(self):
|
def button_validate(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -149,6 +149,9 @@
|
|||||||
<button name="action_assign" type="object" string="检查可用量"
|
<button name="action_assign" type="object" string="检查可用量"
|
||||||
groups="sf_base.group_sf_stock_user"/>
|
groups="sf_base.group_sf_stock_user"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//header" position="inside">
|
||||||
|
<button name="batch_stock_move" type='object' string="批量调拨"/>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user