Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/整体式刀具能力参数补充
This commit is contained in:
@@ -1,12 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import base64
|
import base64
|
||||||
|
import json, requests
|
||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from odoo.exceptions import UserError, ValidationError
|
from odoo.exceptions import UserError, ValidationError
|
||||||
|
|
||||||
import json, requests, logging
|
|
||||||
|
|
||||||
|
|
||||||
# sf排程
|
# sf排程
|
||||||
class sf_production_plan(models.Model):
|
class sf_production_plan(models.Model):
|
||||||
@@ -15,6 +13,7 @@ class sf_production_plan(models.Model):
|
|||||||
_description = 'sf_production_plan'
|
_description = 'sf_production_plan'
|
||||||
|
|
||||||
name = fields.Char(string='名称')
|
name = fields.Char(string='名称')
|
||||||
|
# selected = fields.Boolean(default=False)
|
||||||
production_id = fields.Many2one('mrp.production', '关联制造订单')
|
production_id = fields.Many2one('mrp.production', '关联制造订单')
|
||||||
product_qty = fields.Float(string='数量', digits='Product Unit of Measure', required=True, default=0.0)
|
product_qty = fields.Float(string='数量', digits='Product Unit of Measure', required=True, default=0.0)
|
||||||
date_planned_start = fields.Datetime(string='计划开始时间', required=True, index=True, copy=False,
|
date_planned_start = fields.Datetime(string='计划开始时间', required=True, index=True, copy=False,
|
||||||
@@ -146,6 +145,9 @@ class sf_production_plan(models.Model):
|
|||||||
|
|
||||||
# 当不设置计划结束时间时,增加计算计划结束时间的方法,根据采购周期加缓冲期两个值来算就可以了
|
# 当不设置计划结束时间时,增加计算计划结束时间的方法,根据采购周期加缓冲期两个值来算就可以了
|
||||||
def do_production_schedule(self):
|
def do_production_schedule(self):
|
||||||
|
if not self.production_line_id:
|
||||||
|
raise ValidationError("未选择生产线")
|
||||||
|
else:
|
||||||
aa = self.env['mrp.production'].sudo().search([('name', '=', self.name)])
|
aa = self.env['mrp.production'].sudo().search([('name', '=', self.name)])
|
||||||
workorder_time = 0
|
workorder_time = 0
|
||||||
print(aa.workorder_ids)
|
print(aa.workorder_ids)
|
||||||
@@ -240,6 +242,7 @@ class sf_production_plan(models.Model):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise UserError(e)
|
raise UserError(e)
|
||||||
|
|
||||||
|
|
||||||
# # sf生产排程
|
# # sf生产排程
|
||||||
# class sf_produce_plan(models.Model):
|
# class sf_produce_plan(models.Model):
|
||||||
# _name = 'sf.produce.plan'
|
# _name = 'sf.produce.plan'
|
||||||
@@ -266,3 +269,10 @@ class sf_production_plan(models.Model):
|
|||||||
# plan_end_time = plan_start_time + pl_time
|
# plan_end_time = plan_start_time + pl_time
|
||||||
# return plan_end_time
|
# return plan_end_time
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# 机台作业计划
|
||||||
|
class machine_work_schedule(models.Model):
|
||||||
|
_name = 'sf.machine.schedule'
|
||||||
|
_description = '机台作业计划'
|
||||||
|
|
||||||
|
name = fields.Char(string='机台名')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
access_sf_production_plan,sf.production.plan,model_sf_production_plan,base.group_user,1,1,1,1
|
access_sf_production_plan,sf.production.plan,model_sf_production_plan,base.group_user,1,1,1,1
|
||||||
|
access_sf_machine_schedule,sf.machine.schedule,model_sf_machine_schedule,base.group_user,1,1,1,1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
@@ -6,6 +6,7 @@
|
|||||||
<field name="model">sf.production.plan</field>
|
<field name="model">sf.production.plan</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="订单计划">
|
<tree string="订单计划">
|
||||||
|
<!-- <field name="selected" widget="boolean_toggle"/> -->
|
||||||
<!-- sequence、pl_no、pl_name、quantity、plan_start_time、plan_end_time、actual_start_time、actual_end_time、state、create_uid、create_date -->
|
<!-- sequence、pl_no、pl_name、quantity、plan_start_time、plan_end_time、actual_start_time、actual_end_time、state、create_uid、create_date -->
|
||||||
<!-- <field name="sequence"/> -->
|
<!-- <field name="sequence"/> -->
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
@@ -25,9 +26,10 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="订单计划">
|
<form string="订单计划">
|
||||||
<header>
|
<header>
|
||||||
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/>
|
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
|
||||||
<button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/>
|
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight"/>
|
||||||
<button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/>
|
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
|
||||||
|
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
|
||||||
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,produce"/> -->
|
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,produce"/> -->
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
@@ -212,6 +214,18 @@
|
|||||||
<!-- </gantt> -->
|
<!-- </gantt> -->
|
||||||
<!-- </field> -->
|
<!-- </field> -->
|
||||||
<!-- </record> -->
|
<!-- </record> -->
|
||||||
|
|
||||||
|
<record id="sf_machine_schedule_tree" model="ir.ui.view">
|
||||||
|
<field name="name">sf.machine.schedule.tree</field>
|
||||||
|
<field name="model">sf.machine.schedule</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="机台作业计划">
|
||||||
|
<field name="name"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record id="sf_production_plan_action" model="ir.actions.act_window">
|
<record id="sf_production_plan_action" model="ir.actions.act_window">
|
||||||
<field name="name">制造订单生产计划</field>
|
<field name="name">制造订单生产计划</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
@@ -254,6 +268,22 @@
|
|||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.actions.act_window" id="action_machine_work_schedule">
|
||||||
|
<!-- 自定义额外的动作 -->
|
||||||
|
<field name="name">机台作业计划</field>
|
||||||
|
<field name="type">ir.actions.act_window</field>
|
||||||
|
<field name="res_model">sf.machine.schedule</field>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
暂无机台作业计划
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
跟进请求的处理,并且和合作者沟通。
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="mrp_custom_menu"
|
id="mrp_custom_menu"
|
||||||
name="制造订单"
|
name="制造订单"
|
||||||
@@ -275,6 +305,13 @@
|
|||||||
action="sf_production_plan_action1"
|
action="sf_production_plan_action1"
|
||||||
parent="sf_production_plan_menu"
|
parent="sf_production_plan_menu"
|
||||||
/>
|
/>
|
||||||
|
<menuitem
|
||||||
|
id="machine_work_schedule"
|
||||||
|
name="机台作业计划"
|
||||||
|
sequence="200"
|
||||||
|
action="action_machine_work_schedule"
|
||||||
|
parent="sf_production_plan_menu"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
<!-- --><!-- 在现有菜单结构后面加入自定义的动作 -->
|
<!-- --><!-- 在现有菜单结构后面加入自定义的动作 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user