1.优化工件配送向导2.增加rfid码字段
This commit is contained in:
@@ -180,6 +180,11 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
detection_report = fields.Binary('检测报告', readonly=True)
|
detection_report = fields.Binary('检测报告', readonly=True)
|
||||||
is_remanufacture = fields.Boolean(string='是否重新生成制造订单', default=True)
|
is_remanufacture = fields.Boolean(string='是否重新生成制造订单', default=True)
|
||||||
|
|
||||||
|
@api.onchange('rfid_code')
|
||||||
|
def _onchange(self):
|
||||||
|
if self.rfid_code and self.state == 'progress':
|
||||||
|
self.workpiece_delivery_ids[0].write({'rfid_code': self.rfid_code})
|
||||||
|
|
||||||
def get_plan_workorder(self, production_line):
|
def get_plan_workorder(self, production_line):
|
||||||
tomorrow = (date.today() + timedelta(days=+1)).strftime("%Y-%m-%d")
|
tomorrow = (date.today() + timedelta(days=+1)).strftime("%Y-%m-%d")
|
||||||
tomorrow_start = tomorrow + ' 00:00:00'
|
tomorrow_start = tomorrow + ' 00:00:00'
|
||||||
@@ -1106,6 +1111,7 @@ class WorkPieceDelivery(models.Model):
|
|||||||
status = fields.Selection(
|
status = fields.Selection(
|
||||||
[('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态', default='待下发')
|
[('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态', default='待下发')
|
||||||
is_cnc_program_down = fields.Boolean('程序是否下发', default=False)
|
is_cnc_program_down = fields.Boolean('程序是否下发', default=False)
|
||||||
|
rfid_code = fields.Char('rfid码')
|
||||||
active = fields.Boolean(string="有效", default=True)
|
active = fields.Boolean(string="有效", default=True)
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
<attribute name="attrs">{'invisible':
|
<attribute name="attrs">{'invisible':
|
||||||
['|',("user_permissions","=",False),("name","=","获取CNC加工程序")]}
|
['|',("user_permissions","=",False),("name","=","获取CNC加工程序")]}
|
||||||
</attribute>
|
</attribute>
|
||||||
<!-- <attribute name="string">停工</attribute> -->
|
<!-- <attribute name="string">停工</attribute> -->
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='action_open_wizard']" position="attributes">
|
<xpath expr="//button[@name='action_open_wizard']" position="attributes">
|
||||||
<attribute name="invisible">1</attribute>
|
<attribute name="invisible">1</attribute>
|
||||||
@@ -111,36 +111,38 @@
|
|||||||
<field name='name' invisible="1"/>
|
<field name='name' invisible="1"/>
|
||||||
<field name='is_delivery' invisible="1"/>
|
<field name='is_delivery' invisible="1"/>
|
||||||
<!-- 工单form页面的开始停工按钮等 -->
|
<!-- 工单form页面的开始停工按钮等 -->
|
||||||
<!-- <button name="button_start" type="object" string="开始" class="btn-success" -->
|
<!-- <button name="button_start" type="object" string="开始" class="btn-success" -->
|
||||||
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','ready'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
|
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','ready'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
|
||||||
<!-- groups="sf_base.group_sf_mrp_user"/> -->
|
<!-- groups="sf_base.group_sf_mrp_user"/> -->
|
||||||
<!-- <button name="button_pending" type="object" string="暂停" class="btn-warning" -->
|
<!-- <button name="button_pending" type="object" string="暂停" class="btn-warning" -->
|
||||||
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','progress'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
|
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','progress'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
|
||||||
<!-- groups="sf_base.group_sf_mrp_user"/> -->
|
<!-- groups="sf_base.group_sf_mrp_user"/> -->
|
||||||
<!-- <button name="button_finish" type="object" string="完成" class="btn-success" -->
|
<!-- <button name="button_finish" type="object" string="完成" class="btn-success" -->
|
||||||
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','progress'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
|
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','progress'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
|
||||||
<!-- groups="sf_base.group_sf_mrp_user" confirm="是否确认完工"/> -->
|
<!-- groups="sf_base.group_sf_mrp_user" confirm="是否确认完工"/> -->
|
||||||
|
|
||||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||||
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"/>
|
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"/>
|
||||||
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
||||||
<button name="button_finish" type="object" string="完成" class="btn-success"
|
<button name="button_finish" type="object" string="完成" class="btn-success"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
||||||
|
|
||||||
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="阻塞" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="阻塞"
|
||||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}"/>
|
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
<button name="button_unblock" type="object" string="取消阻塞" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}"/>
|
||||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
|
<button name="button_unblock" type="object" string="取消阻塞"
|
||||||
|
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
|
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
|
||||||
|
|
||||||
<!-- <button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工" -->
|
<!-- <button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工" -->
|
||||||
<!-- context="{'default_workcenter_id': workcenter_id}" class="btn-danger" -->
|
<!-- context="{'default_workcenter_id': workcenter_id}" class="btn-danger" -->
|
||||||
<!-- groups="sf_base.group_sf_mrp_user" -->
|
<!-- groups="sf_base.group_sf_mrp_user" -->
|
||||||
<!-- attrs="{'invisible': ['|', ('production_state', '!=', 'pending_processing'), ('state','!=','progress')]}"/> -->
|
<!-- attrs="{'invisible': ['|', ('production_state', '!=', 'pending_processing'), ('state','!=','progress')]}"/> -->
|
||||||
<!-- <button name="button_unblock" type="object" string="Unblock" -->
|
<!-- <button name="button_unblock" type="object" string="Unblock" -->
|
||||||
<!-- context="{'default_workcenter_id': workcenter_id}" class="btn-danger" -->
|
<!-- context="{'default_workcenter_id': workcenter_id}" class="btn-danger" -->
|
||||||
<!-- groups="sf_base.group_sf_mrp_user" -->
|
<!-- groups="sf_base.group_sf_mrp_user" -->
|
||||||
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('state','=','done')]}"/> -->
|
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('state','=','done')]}"/> -->
|
||||||
<button name="button_workpiece_delivery" type="object" string="工件配送" class="btn-primary"
|
<button name="button_workpiece_delivery" type="object" string="工件配送" class="btn-primary"
|
||||||
attrs="{'invisible': ['|',('routing_type','!=','装夹预调'),('is_delivery','=',True)]}"/>
|
attrs="{'invisible': ['|',('routing_type','!=','装夹预调'),('is_delivery','=',True)]}"/>
|
||||||
|
|
||||||
@@ -622,12 +624,9 @@
|
|||||||
<field name="model">sf.workpiece.delivery</field>
|
<field name="model">sf.workpiece.delivery</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="工件配送">
|
<search string="工件配送">
|
||||||
<!-- <filter string="上产线且待下发" name="on_up"-->
|
|
||||||
<!-- domain="[('status', '=', '待下发'),('type','=',['上产线'])]"/>-->
|
|
||||||
<!-- <filter string="下产线且待下发" name="on_down"-->
|
|
||||||
<!-- domain="[('status', '=', '待下发'),('type','=',['下产线'])]"/>-->
|
|
||||||
<filter string="上产线" name="up" domain="[('type', '=', '上产线')]"/>
|
<filter string="上产线" name="up" domain="[('type', '=', '上产线')]"/>
|
||||||
<filter string="下产线" name="down" domain="[('type', '=', '下产线' )]"/>
|
<filter string="下产线" name="down" domain="[('type', '=', '下产线' )]"/>
|
||||||
|
<field name="rfid_code" invisible="1"/>
|
||||||
<field name="production_id"/>
|
<field name="production_id"/>
|
||||||
<field name="feeder_station_start_id"/>
|
<field name="feeder_station_start_id"/>
|
||||||
<field name="production_line_id"/>
|
<field name="production_line_id"/>
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ class WorkpieceDeliveryWizard(models.TransientModel):
|
|||||||
|
|
||||||
delivery_ids = fields.Many2many('sf.workpiece.delivery', string='配送')
|
delivery_ids = fields.Many2many('sf.workpiece.delivery', string='配送')
|
||||||
workorder_id = fields.Many2one('mrp.workorder', string='工单')
|
workorder_id = fields.Many2one('mrp.workorder', string='工单')
|
||||||
|
production_ids = fields.Many2many('mrp.production', string='制造订单号')
|
||||||
|
destination_production_line_id = fields.Many2one('sf.production.line', '目的生产线')
|
||||||
|
feeder_station_start_id = fields.Many2one('sf.agv.site', '起点接驳站')
|
||||||
|
feeder_station_destination_id = fields.Many2one('sf.agv.site', '目的接驳站')
|
||||||
|
|
||||||
|
|
||||||
def confirm(self):
|
def confirm(self):
|
||||||
if self.workorder_id:
|
if self.workorder_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user