Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop
This commit is contained in:
@@ -159,9 +159,6 @@ td.o_required_modifier {
|
||||
display:inline;
|
||||
}
|
||||
.diameter{
|
||||
display: flex !important;
|
||||
justify-content: flex-start !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
.o_address_format {
|
||||
display: flex !important;
|
||||
|
||||
@@ -55,8 +55,7 @@ class StatusChange(models.Model):
|
||||
logging.info('接口已经执行=============')
|
||||
else:
|
||||
traceback_error = traceback.format_exc()
|
||||
logging.error("bfm订单状态同步失败:%s request info %s" % traceback_error)
|
||||
logging.error('/api/get/state/get_order 请求失败{}'.format(ret))
|
||||
logging.error("bfm订单状态同步失败:%s" % traceback_error)
|
||||
raise UserError('工厂加工同步订单状态到bfm失败')
|
||||
except UserError as e:
|
||||
traceback_error = traceback.format_exc()
|
||||
|
||||
@@ -26,5 +26,13 @@
|
||||
<field name="name">坯料采购提醒</field>
|
||||
<field name="model">purchase.order</field>
|
||||
</record>
|
||||
<record id="bussiness_material_picking_remind" model="jikimo.message.bussiness.node">
|
||||
<field name="name">坯料发料提醒</field>
|
||||
<field name="model">stock.picking</field>
|
||||
</record>
|
||||
<record id="bussiness_mrp_workorder_remind" model="jikimo.message.bussiness.node">
|
||||
<field name="name">工单已下发通知</field>
|
||||
<field name="model">mrp.workorder</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -9,10 +9,7 @@ class SFMessagefunctionalToolAssembly(models.Model):
|
||||
@api.model_create_multi
|
||||
def create(self, vals):
|
||||
result = super(SFMessagefunctionalToolAssembly, self).create(vals)
|
||||
is_cam = False
|
||||
for obj in result:
|
||||
if obj.loading_task_source == '0' and obj.assemble_status == '0':
|
||||
is_cam = True
|
||||
if is_cam:
|
||||
self.add_queue('功能刀具组装')
|
||||
obj.add_queue('功能刀具组装')
|
||||
return result
|
||||
|
||||
@@ -9,10 +9,7 @@ class SFMessagefunctionalToolDismantle(models.Model):
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
result = super(SFMessagefunctionalToolDismantle, self).create(vals)
|
||||
is_dismantle = False
|
||||
for obj in result:
|
||||
if obj.dismantle_cause in ['寿命到期报废', '崩刀报废']and obj.state=='待拆解':
|
||||
is_dismantle = True
|
||||
if is_dismantle:
|
||||
self.add_queue('功能刀具寿命到期')
|
||||
obj.add_queue('功能刀具寿命到期')
|
||||
return result
|
||||
|
||||
@@ -1,13 +1,49 @@
|
||||
import re
|
||||
from odoo import models, fields, api, _
|
||||
|
||||
|
||||
class SFMessageStockPicking(models.Model):
|
||||
_name = 'stock.picking'
|
||||
_description = "库存调拨"
|
||||
_inherit = ['stock.picking', 'jikimo.message.dispatch']
|
||||
_inherit = ['stock.picking', 'jikimo.message.dispatch']
|
||||
|
||||
def button_validate(self):
|
||||
res = super(SFMessageStockPicking, self).button_validate()
|
||||
if self.location_id.name == '进货' and self.location_dest_id.name == '刀具房':
|
||||
if self.location_id.name == 'Vendors' and self.location_dest_id.name == '进货':
|
||||
self.add_queue('调拨入库')
|
||||
return res
|
||||
|
||||
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
|
||||
def _compute_state(self):
|
||||
super(SFMessageStockPicking, self)._compute_state()
|
||||
for record in self:
|
||||
if record.state == 'assigned' and record.check_in == 'PC':
|
||||
record.add_queue('坯料发料提醒')
|
||||
|
||||
def _get_message(self, message_queue_ids):
|
||||
contents = []
|
||||
product_id = []
|
||||
for message_queue_id in message_queue_ids:
|
||||
i = 0
|
||||
if message_queue_id.message_template_id.name == '坯料发料提醒':
|
||||
content = message_queue_id.message_template_id.content
|
||||
stock_picking_line = self.env['stock.picking'].search([('id', '=', int(message_queue_id.res_id))])
|
||||
mrp_production_info = self.env['mrp.production'].search(
|
||||
[('name', '=', stock_picking_line.origin)])
|
||||
mrp_production_list = self.env['mrp.production'].search(
|
||||
[('product_id', '=', mrp_production_info.product_id.id)])
|
||||
for mrp_production_line in mrp_production_list:
|
||||
picking_ids = mrp_production_line.picking_ids
|
||||
for picking_id in picking_ids:
|
||||
if picking_id.state == 'assigned' and picking_id.check_in == 'PC':
|
||||
i += 1
|
||||
if i > 0 and mrp_production_info.product_id.id not in product_id:
|
||||
url = message_queue_id.message_template_id.get_url(int(message_queue_id.res_id))
|
||||
content = content.replace('{{product_id}}', mrp_production_info.product_id.name).replace(
|
||||
'{{number}}', str(i)).replace('{{request_url}}', url)
|
||||
product_id.append(mrp_production_info.product_id.id)
|
||||
contents.append(content)
|
||||
else:
|
||||
res = super(SFMessageStockPicking, self)._get_message(message_queue_id)
|
||||
contents.append(res)
|
||||
return contents
|
||||
|
||||
@@ -13,4 +13,5 @@ class SfMessageTemplate(models.Model):
|
||||
res.append('sf.functional.tool.assembly')
|
||||
res.append('sf.functional.tool.dismantle')
|
||||
res.append('purchase.order')
|
||||
res.append('mrp.workorder')
|
||||
return res
|
||||
|
||||
@@ -3,4 +3,31 @@ from odoo import models, fields, api, _
|
||||
|
||||
class SFMessageWork(models.Model):
|
||||
_name = 'mrp.workorder'
|
||||
_inherit = ['mrp.workorder', 'jikimo.message.dispatch']
|
||||
_inherit = ['mrp.workorder', 'jikimo.message.dispatch']
|
||||
|
||||
@api.depends('production_availability', 'blocked_by_workorder_ids.state')
|
||||
def _compute_state(self):
|
||||
super(SFMessageWork, self)._compute_state()
|
||||
if self.state == 'ready' and self.routing_type == '装夹预调':
|
||||
self.add_queue('工单已下发通知')
|
||||
|
||||
def _get_message(self, message_queue_ids):
|
||||
contents = []
|
||||
product_id = []
|
||||
for message_queue_id in message_queue_ids:
|
||||
if message_queue_id.message_template_id.name == '工单已下发通知':
|
||||
content = message_queue_id.message_template_id.content
|
||||
mrp_workorder_line = self.env['mrp.workorder'].search([('id', '=', int(message_queue_id.res_id))])
|
||||
mrp_workorder_list = self.env['mrp.workorder'].search(
|
||||
[('product_id', '=', mrp_workorder_line.product_id.id), ('state', '=', 'ready'),
|
||||
('routing_type', '=', '装夹预调')])
|
||||
if len(mrp_workorder_list) > 0 and mrp_workorder_line.product_id.id not in product_id:
|
||||
url = message_queue_id.message_template_id.get_url(int(message_queue_id.res_id)) + "&active_id=1"
|
||||
content = content.replace('{{product_id}}', mrp_workorder_line.product_id.name).replace(
|
||||
'{{number}}', str(len(mrp_workorder_list))).replace(
|
||||
'{{part_number}}',
|
||||
mrp_workorder_line.part_number if mrp_workorder_line.part_number else "").replace(
|
||||
'{{request_url}}', url)
|
||||
product_id.append(mrp_workorder_line.product_id.id)
|
||||
contents.append(content)
|
||||
return contents
|
||||
|
||||
@@ -175,7 +175,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
new_price = res_order_lines_map.get(str(index))
|
||||
if order_line:
|
||||
# 修改单价
|
||||
order_line.write({'remark': new_price*order_line.product_uom_qty})
|
||||
order_line.write({'remark': round(new_price*order_line.product_uom_qty,2)})
|
||||
order_price = self.env['order.price'].sudo().search([('sale_order_id', '=',need_change_sale_order.id )])
|
||||
if not order_price:
|
||||
self.env['order.price'].sudo().create({'sale_order_id':need_change_sale_order.id})
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_sf_static_resource_datasync,sf_static_resource_datasync,model_sf_static_resource_datasync,base.group_user,1,1,1,1
|
||||
|
||||
access_order_price,order.price,model_order_price,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
access_order_price,order.price,model_order_price,sf_base.group_sale_director,1,1,1,1
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<menuitem sequence="22" name="销售订单bfm对比" id="menu_sale_order_bfm_price"
|
||||
action="order_price_tree_act"
|
||||
parent="sale.sale_order_menu"
|
||||
groups="base.group_user"
|
||||
groups="sf_base.group_sale_director"
|
||||
/>
|
||||
|
||||
<record id="view_order_price_tree" model="ir.ui.view">
|
||||
|
||||
@@ -84,7 +84,7 @@ class jikimo_bom(models.Model):
|
||||
|
||||
if option.name == '整体式刀具':
|
||||
domain = ['&'] + domain + [
|
||||
'|',
|
||||
'&',
|
||||
# 刀具直径
|
||||
('cutting_tool_blade_diameter', '=', self.tool_inventory_id.diameter),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user