库存处增加批量调拨功能

This commit is contained in:
mgw
2024-06-06 15:44:20 +08:00
parent 81327f04de
commit 4459ed2e81
3 changed files with 32 additions and 6 deletions

View File

@@ -67,9 +67,10 @@ class JdEclp(models.Model):
"""
判断是否为出库单
"""
if self.name:
is_check_out = self.name.split('/')
self.check_out = is_check_out[1]
for record in self:
if record.name:
is_check_out = record.name.split('/')
record.check_out = is_check_out[1]
@api.depends('carrier_tracking_ref')
def query_bill_pdf(self):

View File

@@ -859,14 +859,36 @@ class SfStockPicking(models.Model):
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')
def _check_is_in(self):
"""
判断是否为出库单
"""
if self.name:
is_check_in = self.name.split('/')
self.check_in = is_check_in[1]
for record in self:
if record.name:
is_check_in = record.name.split('/')
record.check_in = is_check_in[1]
def button_validate(self):
"""

View File

@@ -149,6 +149,9 @@
<button name="action_assign" type="object" string="检查可用量"
groups="sf_base.group_sf_stock_user"/>
</xpath>
<xpath expr="//header" position="inside">
<button name="batch_stock_move" type='object' string="批量调拨"/>
</xpath>
</field>
</record>