Merge branch 'develop' into release/release_2.9
This commit is contained in:
@@ -694,8 +694,8 @@ class StockPicking(models.Model):
|
|||||||
picking_in = self.create(
|
picking_in = self.create(
|
||||||
moves_in._get_new_picking_values_Res(item, workorder, 'WH/OCIN/'))
|
moves_in._get_new_picking_values_Res(item, workorder, 'WH/OCIN/'))
|
||||||
# pick_ids.append(picking_in.id)
|
# pick_ids.append(picking_in.id)
|
||||||
moves_in.write(
|
moves_in.write({'picking_id': picking_in.id})
|
||||||
{'picking_id': picking_in.id, 'state': 'waiting'})
|
moves_in._action_confirm()
|
||||||
moves_in._assign_picking_post_process(new=new_picking)
|
moves_in._assign_picking_post_process(new=new_picking)
|
||||||
# self.env.context.get('default_production_id')
|
# self.env.context.get('default_production_id')
|
||||||
moves_out = self.env['stock.move'].sudo().with_context(context).create(
|
moves_out = self.env['stock.move'].sudo().with_context(context).create(
|
||||||
@@ -705,8 +705,8 @@ class StockPicking(models.Model):
|
|||||||
picking_out = self.create(
|
picking_out = self.create(
|
||||||
moves_out._get_new_picking_values_Res(item, workorder, 'WH/OCOUT/'))
|
moves_out._get_new_picking_values_Res(item, workorder, 'WH/OCOUT/'))
|
||||||
# pick_ids.append(picking_out.id)
|
# pick_ids.append(picking_out.id)
|
||||||
moves_out.write(
|
moves_out.write({'picking_id': picking_out.id})
|
||||||
{'picking_id': picking_out.id, 'state': 'waiting'})
|
moves_out._action_confirm()
|
||||||
moves_out._assign_picking_post_process(new=new_picking)
|
moves_out._assign_picking_post_process(new=new_picking)
|
||||||
|
|
||||||
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
|
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ class SFMessageStockPicking(models.Model):
|
|||||||
for record in self:
|
for record in self:
|
||||||
if (record.state == 'assigned' and record.picking_type_id.sequence_code == 'PC'
|
if (record.state == 'assigned' and record.picking_type_id.sequence_code == 'PC'
|
||||||
and record.product_id.categ_id.type == '坯料'):
|
and record.product_id.categ_id.type == '坯料'):
|
||||||
|
jikimo_message_queue = record.get_message_queue(record.id)
|
||||||
|
if not jikimo_message_queue:
|
||||||
record.add_queue('坯料发料提醒')
|
record.add_queue('坯料发料提醒')
|
||||||
|
|
||||||
if record.picking_type_id.sequence_code == 'SFP' and record.state == 'done':
|
if record.picking_type_id.sequence_code == 'SFP' and record.state == 'done':
|
||||||
@@ -129,3 +131,14 @@ class SFMessageStockPicking(models.Model):
|
|||||||
# 拼接URL
|
# 拼接URL
|
||||||
full_url = url + "/web#" + query_string
|
full_url = url + "/web#" + query_string
|
||||||
return full_url
|
return full_url
|
||||||
|
|
||||||
|
def get_message_queue(self, res_id):
|
||||||
|
business_node_id = self.env.ref('sf_message.bussiness_material_picking_remind').id
|
||||||
|
message_template = self.env["jikimo.message.template"].sudo().search([
|
||||||
|
("model", "=", self._name),
|
||||||
|
("bussiness_node_id", "=", business_node_id)
|
||||||
|
], limit=1)
|
||||||
|
jikimo_message_queue = self.env['jikimo.message.queue'].sudo().search(
|
||||||
|
[('res_id', '=', res_id), ("message_status", "in", ("pending", "sent")),
|
||||||
|
('message_template_id', '=', message_template.id)])
|
||||||
|
return jikimo_message_queue
|
||||||
|
|||||||
@@ -157,7 +157,9 @@
|
|||||||
groups="sf_base.group_sf_stock_user"/>
|
groups="sf_base.group_sf_stock_user"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//header" position="inside">
|
<xpath expr="//header" position="inside">
|
||||||
<button name="batch_stock_move" type='object' string="批量调拨"/>
|
<button name="batch_stock_move" type='object' string="批量调拨"
|
||||||
|
invisible="context.get('stock_type','') in ('发料出库')"
|
||||||
|
/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='location_dest_id']" position="after">
|
<xpath expr="//field[@name='location_dest_id']" position="after">
|
||||||
<field name="product_uom_qty_sp"/>
|
<field name="product_uom_qty_sp"/>
|
||||||
@@ -165,6 +167,18 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="view_stock_picking_type_kanban_inherit" model="ir.ui.view">
|
||||||
|
<field name="name">stock.picking.type.kanban.view.inherit</field>
|
||||||
|
<field name="model">stock.picking.type</field>
|
||||||
|
<field name="inherit_id" ref="stock.stock_picking_type_kanban"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<!-- 找到按钮所在位置并添加 context -->
|
||||||
|
<xpath expr="//button[@name='get_action_picking_tree_ready']" position="attributes">
|
||||||
|
<attribute name="context">{'stock_type': name}</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="sf_view_stock_move_operations" model="ir.ui.view">
|
<record id="sf_view_stock_move_operations" model="ir.ui.view">
|
||||||
<field name="name">sf.stock.move.operations.form</field>
|
<field name="name">sf.stock.move.operations.form</field>
|
||||||
<field name="model">stock.move</field>
|
<field name="model">stock.move</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user