工单下发调整
This commit is contained in:
@@ -16,6 +16,12 @@ from OCC.Extend.DataExchange import write_stl_file
|
|||||||
class ResProductMo(models.Model):
|
class ResProductMo(models.Model):
|
||||||
_inherit = 'product.template'
|
_inherit = 'product.template'
|
||||||
|
|
||||||
|
def _get_machining_precision(self):
|
||||||
|
machinings = self.env['sf.machining.accuracy'].sudo().search([])
|
||||||
|
|
||||||
|
list = [(m.sync_id, m.name) for m in machinings]
|
||||||
|
return list
|
||||||
|
|
||||||
model_file = fields.Binary('模型文件')
|
model_file = fields.Binary('模型文件')
|
||||||
categ_type = fields.Selection(string='产品的类别', related='categ_id.type', store=True)
|
categ_type = fields.Selection(string='产品的类别', related='categ_id.type', store=True)
|
||||||
model_name = fields.Char('模型名称')
|
model_name = fields.Char('模型名称')
|
||||||
@@ -23,12 +29,7 @@ class ResProductMo(models.Model):
|
|||||||
model_width = fields.Float('模型宽(mm)', digits=(16, 3))
|
model_width = fields.Float('模型宽(mm)', digits=(16, 3))
|
||||||
model_height = fields.Float('模型高(mm)', digits=(16, 3))
|
model_height = fields.Float('模型高(mm)', digits=(16, 3))
|
||||||
model_volume = fields.Float('模型体积(m³)')
|
model_volume = fields.Float('模型体积(m³)')
|
||||||
model_machining_precision = fields.Selection([
|
model_machining_precision = fields.Selection(selection=_get_machining_precision, string='加工精度')
|
||||||
('0.10', '±0.10mm'),
|
|
||||||
('0.05', '±0.05mm'),
|
|
||||||
('0.03', '±0.03mm'),
|
|
||||||
('0.02', '±0.02mm'),
|
|
||||||
('0.01', '±0.01mm')], string='加工精度')
|
|
||||||
model_processing_panel = fields.Char('模型加工面板')
|
model_processing_panel = fields.Char('模型加工面板')
|
||||||
model_remark = fields.Char('模型备注说明')
|
model_remark = fields.Char('模型备注说明')
|
||||||
length = fields.Float('长(mm)', digits=(16, 3))
|
length = fields.Float('长(mm)', digits=(16, 3))
|
||||||
|
|||||||
@@ -85,11 +85,12 @@ class SFMessageWork(models.Model):
|
|||||||
|
|
||||||
def request_url(self):
|
def request_url(self):
|
||||||
url = self.env['ir.config_parameter'].get_param('web.base.url')
|
url = self.env['ir.config_parameter'].get_param('web.base.url')
|
||||||
action_id = self.env.ref('sf_message.mrp_workorder_action_notify').id
|
action_id = self.env.ref('sf_message.mrp_workorder_issued_action').id
|
||||||
menu_id = self.env['ir.model.data'].search([('name', '=', 'module_stock_dropshipping')]).id
|
menu_id = self.env['ir.model.data'].search([('name', '=', 'module_stock_dropshipping')]).id
|
||||||
|
active_id = self.env['mrp.workcenter'].search([('name', '=', '工件装夹中心')]).id
|
||||||
# 查询参数
|
# 查询参数
|
||||||
params = {'menu_id': menu_id, 'action': action_id, 'model': 'mrp.workorder',
|
params = {'menu_id': menu_id, 'action': action_id, 'model': 'mrp.workorder',
|
||||||
'view_type': 'list', 'active_id': 1}
|
'view_type': 'list', 'active_id': active_id}
|
||||||
# 拼接查询参数
|
# 拼接查询参数
|
||||||
query_string = urlencode(params)
|
query_string = urlencode(params)
|
||||||
# 拼接URL
|
# 拼接URL
|
||||||
|
|||||||
@@ -30,5 +30,36 @@
|
|||||||
</p>
|
</p>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<record model="ir.actions.act_window" id="mrp_workorder_issued_action">
|
||||||
|
<field name="name">工单</field>
|
||||||
|
<field name="type">ir.actions.act_window</field>
|
||||||
|
<field name="res_model">mrp.workorder</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="view_ids" eval="[(5, 0, 0),
|
||||||
|
(0, 0, {'view_mode': 'tree', 'view_id': ref('mrp.mrp_production_workorder_tree_editable_view')}) ]"/>
|
||||||
|
<!-- (0, 0, {'view_mode': 'kanban', 'view_id': ref('mrp.workcenter_line_kanban')})-->
|
||||||
|
<!-- <field name="target">fullscreen</field>-->
|
||||||
|
<field name="target">current</field>
|
||||||
|
<field name="domain">[('state', '!=', 'cancel'),('schedule_state', '=', '已排')]</field>
|
||||||
|
<field name="context">{'search_default_product': 1, 'search_default_workcenter_id':
|
||||||
|
active_id,'search_default_ready': 1, 'search_default_progress': 1}
|
||||||
|
</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_workorder">
|
||||||
|
没有工单要做!
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
工作订单是作为制造订单的一部分执行的操作。
|
||||||
|
工序在物料清单中定义或直接添加到制造订单中。
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
使用工作台工作中心控制面板直接登记车间中的操作.
|
||||||
|
平板电脑为您的工人提供工作表,并允许他们报废产品,跟踪时间,
|
||||||
|
发起维护请求,执行质量测试等.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -20,6 +20,12 @@ class QuickEasyOrder(models.Model):
|
|||||||
_description = '简易下单'
|
_description = '简易下单'
|
||||||
_order = 'id desc'
|
_order = 'id desc'
|
||||||
|
|
||||||
|
def _get_machining_precision(self):
|
||||||
|
machinings = self.env['sf.machining.accuracy'].sudo().search([])
|
||||||
|
|
||||||
|
list = [(m.sync_id, m.name) for m in machinings]
|
||||||
|
return list
|
||||||
|
|
||||||
name = fields.Char('订单编号', default=lambda self: self.env['ir.sequence'].next_by_code('quick.easy.order'))
|
name = fields.Char('订单编号', default=lambda self: self.env['ir.sequence'].next_by_code('quick.easy.order'))
|
||||||
model_length = fields.Float('长(mm)', digits=(16, 3))
|
model_length = fields.Float('长(mm)', digits=(16, 3))
|
||||||
model_width = fields.Float('宽(mm)', digits=(16, 3))
|
model_width = fields.Float('宽(mm)', digits=(16, 3))
|
||||||
@@ -27,12 +33,7 @@ class QuickEasyOrder(models.Model):
|
|||||||
model_volume = fields.Float('体积(mm³)', digits=(16, 3))
|
model_volume = fields.Float('体积(mm³)', digits=(16, 3))
|
||||||
model_processing_side = fields.Char('加工面', default='A')
|
model_processing_side = fields.Char('加工面', default='A')
|
||||||
model_feature = fields.Char('特征')
|
model_feature = fields.Char('特征')
|
||||||
machining_precision = fields.Selection([
|
model_machining_precision = fields.Selection(selection=_get_machining_precision, string='加工精度')
|
||||||
('0.10', '±0.10mm'),
|
|
||||||
('0.05', '±0.05mm'),
|
|
||||||
('0.03', '±0.03mm'),
|
|
||||||
('0.02', '±0.02mm'),
|
|
||||||
('0.01', '±0.01mm')], string='加工精度', default='0.10')
|
|
||||||
material_id = fields.Many2one('sf.production.materials', '材料', tracking=True)
|
material_id = fields.Many2one('sf.production.materials', '材料', tracking=True)
|
||||||
material_model_id = fields.Many2one('sf.materials.model', '型号', domain="[('materials_id', '=', material_id)]",
|
material_model_id = fields.Many2one('sf.materials.model', '型号', domain="[('materials_id', '=', material_id)]",
|
||||||
tracking=True)
|
tracking=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user