制造订单页面新增生产线和计划开始加工时间字段

This commit is contained in:
jinling.yang
2024-01-24 14:24:27 +08:00
parent 8f379a2635
commit 82f54b5d83
7 changed files with 359 additions and 370 deletions

View File

@@ -50,18 +50,7 @@ class MrpProduction(models.Model):
work_state = fields.Char('业务状态')
programming_state = fields.Char('编程状态')
glb_file = fields.Binary("glb模型文件")
production_line_id = fields.Many2one('sf.production.line', string='生产线', compute='_compute_production_line_id',
store=True)
plan_start_processing_time = fields.Datetime('计划开始加工时间')
@api.depends('name')
def _compute_production_line_id(self):
for production in self:
if production.name:
plan_production = self.env['sf.production.plan'].search([('production_id', '=', self.id)])
if plan_production:
production.production_line_id = plan_production.production_id.id
production.plan_start_processing_time = plan_production.date_planned_start
@api.depends(
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state',

View File

@@ -777,7 +777,7 @@ class WorkPieceDelivery(models.Model):
workorder_id = fields.Many2one('mrp.workorder', string='工单',
domain=[('name', 'in', ('装夹', '解除装夹'))])
name = fields.Char(related='workorder_id.production_id.name', string='工件编码/任务编码', store=True)
production_code = fields.Char(related='workorder_id.production_id.name', string='工件编码/任务编码', store=True)
plan_start_processing_time = fields.Datetime('计划开始加工时间')
workpiece_code = fields.Char('同运工件编码')
feeder_station_start = fields.Char('起点接驳站')

View File

@@ -18,19 +18,21 @@
<field name="product_qty" sum="Total Qty" string="数量" readonly="1" optional="show"/>
</xpath>
<xpath expr="//field[@name='product_qty']" position="after">
<field name="product_uom_id" string="计量单位" options="{'no_open':True,'no_create':True}" groups="uom.group_uom" optional="show"/>
<field name="product_uom_id" string="计量单位" options="{'no_open':True,'no_create':True}"
groups="uom.group_uom" optional="show"/>
</xpath>
<xpath expr="//field[@name='date_planned_start']" position="replace">
<field name="date_planned_start" optional="show"/>
<field name="date_planned_finished" string="计划结束时间"/>
<!-- <field name="date_deadline" widget="remaining_days" attrs="{'invisible': [('state', 'in', ['done', 'cancel'])]}" optional="show"/> -->
<!-- <field name="date_deadline" widget="remaining_days" attrs="{'invisible': [('state', 'in', ['done', 'cancel'])]}" optional="show"/> -->
</xpath>
<xpath expr="//field[@name='production_real_duration']" position="after">
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'" decoration-success="reservation_state == 'assigned'"/>
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'"
decoration-success="reservation_state == 'assigned'"/>
</xpath>
<!-- <xpath expr="//field[@name='state']" position="before"> -->
<!-- <field name="schedule_state" optional="show"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//field[@name='state']" position="before"> -->
<!-- <field name="schedule_state" optional="show"/> -->
<!-- </xpath> -->
<xpath expr="//field[@name='activity_ids']" position="replace">
<field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/>
</xpath>
@@ -39,44 +41,52 @@
</xpath>
<xpath expr="//field[@name='components_availability']" position="replace">
<field name="components_availability" options='{"lazy": true}'
attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}"
optional="hide"
decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'"
decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')"
decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/>
attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}"
optional="hide"
decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'"
decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')"
decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/>
</xpath>
<!-- <xpath expr="//field[@name='state']" position="after"> -->
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//field[@name='state']" position="after"> -->
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
<!-- </xpath> -->
</field>
</record>
<!-- 增加权限相关的按钮 -->
<!-- 制造订单的操作按钮只让制造用户可见 -->
<!-- 增加权限相关的按钮 -->
<!-- 制造订单的操作按钮只让制造用户可见 -->
<record id="custom_mrp_production_form_view" model="ir.ui.view">
<field name="name">custom.mrp.production.form</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="attributes">
<attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done</attribute>
<attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done
</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="after">
<field name="programming_no"/>
<field name="programming_no" readonly="1"/>
<field name="work_state" invisible="1"/>
<field name="programming_state"/>
<field name="programming_state" readonly="1"/>
</xpath>
<xpath expr="//header//button[@name='action_cancel']" position="replace">
<button name="action_cancel" type="object" string="取消" data-hotkey="z"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', True)]}" groups="sf_base.group_sf_mrp_user"/>
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', True)]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="(//header//button[@name='button_mark_done'])[1]" position="replace">
<button name="button_mark_done" attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '!=', [])]}" string="验证" type="object" class="oe_highlight"
confirm="There are no components to consume. Are you still sure you want to continue?" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
<button name="button_mark_done"
attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '!=', [])]}"
string="验证" type="object" class="oe_highlight"
confirm="There are no components to consume. Are you still sure you want to continue?"
data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="(//header//button[@name='button_mark_done'])[2]" position="replace">
<button name="button_mark_done" attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '=', [])]}" string="Validate" type="object" class="oe_highlight" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
<button name="button_mark_done"
attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '=', [])]}"
string="Validate" type="object" class="oe_highlight" data-hotkey="g"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="(//header//button[@name='button_mark_done'])[3]" position="replace">
<button name="button_mark_done" attrs="{'invisible': [
@@ -86,7 +96,8 @@
'|',
('state', 'not in', ('confirmed', 'progress')),
('qty_producing', '!=', 0),
('state', '!=', 'to_close')]}" string="Mark as Done" type="object" class="oe_highlight" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
('state', '!=', 'to_close')]}" string="Mark as Done" type="object" class="oe_highlight"
data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="(//header//button[@name='button_mark_done'])[4]" position="replace">
<button name="button_mark_done" attrs="{'invisible': [
@@ -96,61 +107,88 @@
'|',
('state', 'not in', ('confirmed', 'progress')),
('qty_producing', '!=', 0),
('state', '!=', 'to_close')]}" string="Mark as Done" type="object" class="oe_highlight" data-hotkey="g"
confirm="There are no components to consume. Are you still sure you want to continue?" groups="sf_base.group_sf_mrp_user"/>
('state', '!=', 'to_close')]}" string="Mark as Done" type="object" class="oe_highlight"
data-hotkey="g"
confirm="There are no components to consume. Are you still sure you want to continue?"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='button_unplan']" position="replace">
<button name="button_unplan" type="object" string="取消安排" attrs="{'invisible': ['|', ('is_planned', '=', False), ('state', '=', 'cancel')]}" data-hotkey="x" groups="sf_base.group_sf_mrp_user"/>
<button name="button_unplan" type="object" string="取消安排"
attrs="{'invisible': ['|', ('is_planned', '=', False), ('state', '=', 'cancel')]}"
data-hotkey="x" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='button_scrap']" position="replace">
<button name="button_scrap" type="object" string="报废" attrs="{'invisible': [('state', 'in', ('cancel', 'draft'))]}" data-hotkey="y" groups="sf_base.group_sf_mrp_user"/>
<button name="button_scrap" type="object" string="报废"
attrs="{'invisible': [('state', 'in', ('cancel', 'draft'))]}" data-hotkey="y"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_confirm']" position="replace">
<button name="action_confirm" attrs="{'invisible': [('state', '!=', 'draft')]}" string="Confirm" type="object" class="oe_highlight" data-hotkey="v" groups="sf_base.group_sf_mrp_user"/>
<button name="action_confirm" attrs="{'invisible': [('state', '!=', 'draft')]}" string="Confirm"
type="object" class="oe_highlight" data-hotkey="v" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='button_plan']" position="replace">
<button name="button_plan" attrs="{'invisible': ['|', '|', ('state', 'not in', ('confirmed', 'progress', 'to_close')), ('workorder_ids', '=', []), ('is_planned', '=', True)]}" type="object" string="Plan" class="oe_highlight" data-hotkey="x" groups="sf_base.group_sf_mrp_user"/>
<button name="button_plan"
attrs="{'invisible': ['|', '|', ('state', 'not in', ('confirmed', 'progress', 'to_close')), ('workorder_ids', '=', []), ('is_planned', '=', True)]}"
type="object" string="Plan" class="oe_highlight" data-hotkey="x"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_assign']" position="replace">
<button name="action_assign" attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done', 'cancel')), ('reserve_visible', '=', False)]}" string="Check availability" type="object" data-hotkey="q" groups="sf_base.group_sf_mrp_user"/>
<button name="action_assign"
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done', 'cancel')), ('reserve_visible', '=', False)]}"
string="Check availability" type="object" data-hotkey="q"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
<button name="do_unreserve" type="object" string="Unreserve" attrs="{'invisible': [('unreserve_visible', '=', False)]}" data-hotkey="w" groups="sf_base.group_sf_mrp_user"/>
<button name="do_unreserve" type="object" string="Unreserve"
attrs="{'invisible': [('unreserve_visible', '=', False)]}" data-hotkey="w"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}" string="Unlock" groups="sf_base.group_sf_mrp_user" type="object" help="Unlock the manufacturing order to adjust what has been consumed or produced." data-hotkey="l"/>
<button name="action_toggle_is_locked"
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}"
string="Unlock" groups="sf_base.group_sf_mrp_user" type="object"
help="Unlock the manufacturing order to adjust what has been consumed or produced."
data-hotkey="l"/>
</xpath>
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}" string="Lock" groups="sf_base.group_sf_mrp_user" type="object" help="Lock the manufacturing order to prevent changes to what has been consumed or produced." data-hotkey="l"/>
<button name="action_toggle_is_locked"
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}"
string="Lock" groups="sf_base.group_sf_mrp_user" type="object"
help="Lock the manufacturing order to prevent changes to what has been consumed or produced."
data-hotkey="l"/>
</xpath>
<xpath expr="//header//button[@name='action_serial_mass_produce_wizard']" position="replace">
<button name="action_serial_mass_produce_wizard" attrs="{'invisible': [('show_serial_mass_produce', '=', False)]}" string="Mass Produce" type="object" groups="sf_base.group_sf_mrp_user"/>
<button name="action_serial_mass_produce_wizard"
attrs="{'invisible': [('show_serial_mass_produce', '=', False)]}" string="Mass Produce"
type="object" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_cancel']" position="replace">
<button name="action_cancel" type="object" string="Cancel" data-hotkey="z"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', False)]}"
confirm="Some product moves have already been confirmed, this manufacturing order can't be completely cancelled. Are you still sure you want to process ?" groups="sf_base.group_sf_mrp_user"/>
<button name="action_cancel" type="object" string="Cancel" data-hotkey="z"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', False)]}"
confirm="Some product moves have already been confirmed, this manufacturing order can't be completely cancelled. Are you still sure you want to process ?"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='button_unbuild']" position="replace">
<button name="button_unbuild" type="object" string="Unbuild" attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v" groups="sf_base.group_sf_mrp_user"/>
<button name="button_unbuild" type="object" string="Unbuild"
attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
</field>
</record>
<!-- 工单的操作按钮只让制造用户可见 -->
<!-- 工单的操作按钮只让制造用户可见 -->
<record id="sf_mrp_production_workorder_tree_editable_view" model="ir.ui.view">
<field name="name">sf.mrp.production.workorder.tree.editable</field>
<field name="model">mrp.workorder</field>
@@ -158,76 +196,81 @@
<field name="arch" type="xml">
<xpath expr="//tree//button[@name='button_start']" position="replace">
<button name="button_start" type="object" string="Start" class="btn-success"
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}" groups="sf_base.group_sf_mrp_user"/>
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='button_pending']" position="replace">
<button name="button_pending" type="object" string="Pause" class="btn-warning"
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}" groups="sf_base.group_sf_mrp_user"/>
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='button_finish']" position="replace">
<button name="button_finish" type="object" string="Done" class="btn-success"
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}" groups="sf_base.group_sf_mrp_user"/>
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="replace">
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="Block" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}" groups="sf_base.group_sf_mrp_user"/>
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="Block"
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='button_unblock']" position="replace">
<button name="button_unblock" type="object" string="Unblock" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}" groups="sf_base.group_sf_mrp_user"/>
<button name="button_unblock" type="object" string="Unblock"
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='action_open_wizard']" position="replace">
<button name="action_open_wizard" type="object" icon="fa-external-link" class="oe_edit_only"
title="Open Work Order"
context="{'default_workcenter_id': workcenter_id}" groups="sf_base.group_sf_mrp_user"/>
context="{'default_workcenter_id': workcenter_id}" groups="sf_base.group_sf_mrp_user"/>
</xpath>
</field>
</record>
<!-- 制造订单列表视图header内的按钮只让制造用户可见 -->
<!-- 制造订单列表视图header内的按钮只让制造用户可见 -->
<record id="sf_mrp_production_tree_view" model="ir.ui.view">
<field name="name">sf.mrp.production.tree</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//header//button[@name='button_plan']" position="replace">
<!-- <button name="button_plan" type="object" string="安排" groups="sf_base.group_sf_mrp_user"/> -->
</xpath>
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
<button name="do_unreserve" type="object" string="取消保留" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_cancel']" position="replace">
<button name="action_cancel" type="object" string="取消" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<field name="name">sf.mrp.production.tree</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//header//button[@name='button_plan']" position="replace">
<!-- <button name="button_plan" type="object" string="安排" groups="sf_base.group_sf_mrp_user"/> -->
</xpath>
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
<button name="do_unreserve" type="object" string="取消保留" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_cancel']" position="replace">
<button name="action_cancel" type="object" string="取消" groups="sf_base.group_sf_mrp_user"/>
</xpath>
</field>
</record>
</field>
</record>
<!-- <record id="custom_mrp_production_form_view" model="ir.ui.view"> -->
<!-- <field name="name">custom.mrp.production.form</field> -->
<!-- <field name="model">mrp.production</field> -->
<!-- <field name="inherit_id" ref="mrp.mrp_production_form_view"/> -->
<!-- <field name="arch" type="xml"> -->
<!-- <xpath expr="//header//field[@name='state']" position="replace"> -->
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,已排程,progress,done"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//header" position="inside"> -->
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//sheet//group//group//field[@name='product_id']" position="after"> -->
<!-- <field name="production_line_id"/> -->
<!-- <field name="date_planned_finished" string="计划结束时间"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//sheet//group//group//field[@name='date_planned_start']" position="after"> -->
<!-- <field name="date_planned_finished"/> -->
<!-- </xpath> -->
<!-- </field> -->
<!-- </record> -->
<!-- <record id="custom_mrp_production_form_view" model="ir.ui.view"> -->
<!-- <field name="name">custom.mrp.production.form</field> -->
<!-- <field name="model">mrp.production</field> -->
<!-- <field name="inherit_id" ref="mrp.mrp_production_form_view"/> -->
<!-- <field name="arch" type="xml"> -->
<!-- <xpath expr="//header//field[@name='state']" position="replace"> -->
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,已排程,progress,done"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//header" position="inside"> -->
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//sheet//group//group//field[@name='product_id']" position="after"> -->
<!-- <field name="production_line_id"/> -->
<!-- <field name="date_planned_finished" string="计划结束时间"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//sheet//group//group//field[@name='date_planned_start']" position="after"> -->
<!-- <field name="date_planned_finished"/> -->
<!-- </xpath> -->
<!-- </field> -->
<!-- </record> -->
<record id="custom_view_mrp_production_filter" model="ir.ui.view">
<field name="name">custom.mrp.production.select</field>
@@ -243,24 +286,24 @@
</field>
</record>
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已完成" name="filter_done" domain="[('state', '=', 'done')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已取消" name="filter_cancel" domain="[('state', '=', 'cancel')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="进行中" name="filter_progress" domain="[('state', '=', 'progress')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已确认" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="草稿" name="filter_draft" domain="[('state', '=', 'draft')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已完成" name="filter_done" domain="[('state', '=', 'done')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已取消" name="filter_cancel" domain="[('state', '=', 'cancel')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="进行中" name="filter_progress" domain="[('state', '=', 'progress')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已确认" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="草稿" name="filter_draft" domain="[('state', '=', 'draft')]"/> -->
<!-- </xpath> -->
<!-- 产品模板修改>>>增加“规格”字段specification_id -->
<!-- 产品模板修改>>>增加“规格”字段specification_id -->
<record id="custom_product_template_kanban_view" model="ir.ui.view">
<field name="name">custom.Product.template.product.kanban</field>
<field name="model">product.template</field>
@@ -268,44 +311,52 @@
<field name="arch" type="xml">
<xpath expr="//kanban" position="replace">
<kanban sample="1" class="o_kanban_product_template">
<field name="id"/>
<field name="product_variant_count"/>
<field name="currency_id"/>
<field name="activity_state"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_image me-1">
<img t-att-src="kanban_image('product.template', 'image_128', record.id.raw_value)" alt="Product" class="o_image_64_contain"/>
</div>
<div class="oe_kanban_details">
<div class="o_kanban_record_top mb-0">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name"/>
<field name="id"/>
<field name="product_variant_count"/>
<field name="currency_id"/>
<field name="activity_state"/>
<progressbar field="activity_state"
colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_image me-1">
<img t-att-src="kanban_image('product.template', 'image_128', record.id.raw_value)"
alt="Product" class="o_image_64_contain"/>
</div>
<div class="oe_kanban_details">
<div class="o_kanban_record_top mb-0">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name"/>
</strong>
</div>
<field name="priority" widget="priority"/>
</div>
<div name="product_specification_id" class="mt-1">
规格:
<field name="specification_id"></field>
</div>
<t t-if="record.default_code.value">[<field name="default_code"/>]
</t>
<div t-if="record.product_variant_count.value &gt; 1"
groups="product.group_product_variant">
<strong>
<t t-esc="record.product_variant_count.value"/>
Variants
</strong>
</div>
<field name="priority" widget="priority"/>
</div>
<div name="product_specification_id" class="mt-1">
规格: <field name="specification_id"></field>
</div>
<t t-if="record.default_code.value">[<field name="default_code"/>]</t>
<div t-if="record.product_variant_count.value &gt; 1" groups="product.group_product_variant">
<strong>
<t t-esc="record.product_variant_count.value"/> Variants
</strong>
</div>
<div name="product_lst_price" class="mt-1">
价格: <field name="list_price" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"></field>
<div name="product_lst_price" class="mt-1">
价格:
<field name="list_price" widget="monetary"
options="{'currency_field': 'currency_id', 'field_digits': True}"></field>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</t>
</templates>
</kanban>
</xpath>
</field>
</record>

View File

@@ -402,14 +402,13 @@
<page string="工件配送" attrs='{"invisible": [("routing_type","!=","装夹预调")]}'>
<field name="workpiece_delivery_id" widget="one2many">
<tree>
<field name="name"/>
<field name="production_code" invisible="1"/>
<field name="workpiece_code"/>
<field name="feeder_station_start"/>
<field name="feeder_station_destination"/>
<field name="production_line_id"/>
<field name="task_delivery_time"/>
<field name="task_delivery_time"/>
<field name="task_completion_time"/>
<field name="production_line_id"/>
</tree>
</field>
</page>
@@ -514,7 +513,7 @@
<field name="model">sf.workpiece.delivery</field>
<field name="arch" type="xml">
<tree string="工件配送单列表" editable="bottom">
<field name="name"/>
<field name="production_code"/>
<field name="workpiece_code"/>
<field name="feeder_station_start"/>
<field name="production_line_id"/>
@@ -532,7 +531,7 @@
<field name="model">sf.workpiece.delivery</field>
<field name="arch" type="xml">
<search string="工件配送单列表">
<field name="name"/>
<field name="production_code"/>
<field name="workpiece_code"/>
<field name="feeder_station_start"/>
<field name="production_line_id"/>